~ubuntu-branches/debian/jessie/wordpress/jessie

« back to all changes in this revision

Viewing changes to wp-includes/class-wp-customize-section.php

  • Committer: Package Import Robot
  • Author(s): Craig Small
  • Date: 2014-04-17 20:56:19 UTC
  • mfrom: (1.2.35)
  • Revision ID: package-import@ubuntu.com-20140417205619-nurbet6eho4yvwfv
Tags: 3.9+dfsg-1
* New upstream release
* 3.9 seems to handle different locations for plugins so the
  plugin directory handling patches have been cut back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/**
3
3
 * Customize Section Class.
4
4
 *
 
5
 * A UI container for controls, managed by the WP_Customize_Manager.
 
6
 *
5
7
 * @package WordPress
6
8
 * @subpackage Customize
7
9
 * @since 3.4.0
8
10
 */
9
11
class WP_Customize_Section {
 
12
 
 
13
        /**
 
14
         * WP_Customize_Manager instance.
 
15
         *
 
16
         * @since 3.4.0
 
17
         * @access public
 
18
         * @var WP_Customize_Manager
 
19
         */
10
20
        public $manager;
 
21
 
 
22
        /**
 
23
         * Unique identifier.
 
24
         *
 
25
         * @since 3.4.0
 
26
         * @access public
 
27
         * @var string
 
28
         */
11
29
        public $id;
12
 
        public $priority       = 10;
13
 
        public $capability     = 'edit_theme_options';
 
30
 
 
31
        /**
 
32
         * Priority of the section which informs load order of sections.
 
33
         *
 
34
         * @since 3.4.0
 
35
         * @access public
 
36
         * @var integer
 
37
         */
 
38
        public $priority = 10;
 
39
 
 
40
        /**
 
41
         * Capability required for the section.
 
42
         *
 
43
         * @since 3.4.0
 
44
         * @access public
 
45
         * @var string
 
46
         */
 
47
        public $capability = 'edit_theme_options';
 
48
 
 
49
        /**
 
50
         * Theme feature support for the section.
 
51
         *
 
52
         * @since 3.4.0
 
53
         * @access public
 
54
         * @var string|array
 
55
         */
14
56
        public $theme_supports = '';
15
 
        public $title          = '';
16
 
        public $description    = '';
 
57
 
 
58
        /**
 
59
         * Title of the section to show in UI.
 
60
         *
 
61
         * @since 3.4.0
 
62
         * @access public
 
63
         * @var string
 
64
         */
 
65
        public $title = '';
 
66
 
 
67
        /**
 
68
         * Description to show in the UI.
 
69
         *
 
70
         * @since 3.4.0
 
71
         * @access public
 
72
         * @var string
 
73
         */
 
74
        public $description = '';
 
75
 
 
76
        /**
 
77
         * Customizer controls for this section.
 
78
         *
 
79
         * @since 3.4.0
 
80
         * @access public
 
81
         * @var array
 
82
         */
17
83
        public $controls;
18
84
 
19
85
        /**
20
86
         * Constructor.
21
87
         *
 
88
         * Any supplied $args override class property defaults.
 
89
         *
22
90
         * @since 3.4.0
23
91
         *
24
 
         * @param WP_Customize_Manager $manager
25
 
         * @param string $id An specific ID of the section.
26
 
         * @param array $args Section arguments.
 
92
         * @param WP_Customize_Manager $manager Customizer bootstrap instance.
 
93
         * @param string               $id      An specific ID of the section.
 
94
         * @param array                $args    Section arguments.
27
95
         */
28
96
        function __construct( $manager, $id, $args = array() ) {
29
97
                $keys = array_keys( get_class_vars( __CLASS__ ) );
41
109
        }
42
110
 
43
111
        /**
44
 
         * Check if the theme supports the section and check user capabilities.
 
112
         * Checks required user capabilities and whether the theme has the
 
113
         * feature support required by the section.
45
114
         *
46
115
         * @since 3.4.0
47
116
         *
66
135
                if ( ! $this->check_capabilities() )
67
136
                        return;
68
137
 
 
138
                /**
 
139
                 * Fires before rendering a Customizer section.
 
140
                 *
 
141
                 * @since 3.4.0
 
142
                 *
 
143
                 * @param WP_Customize_Section $this WP_Customize_Section instance.
 
144
                 */
69
145
                do_action( 'customize_render_section', $this );
70
 
                do_action( 'customize_render_section_' . $this->id );
 
146
                /**
 
147
                 * Fires before rendering a specific Customizer section.
 
148
                 *
 
149
                 * The dynamic portion of the hook name, $this->id, refers to the ID
 
150
                 * of the specific Customizer section to be rendered.
 
151
                 *
 
152
                 * @since 3.4.0
 
153
                 */
 
154
                do_action( "customize_render_section_{$this->id}" );
71
155
 
72
156
                $this->render();
73
157
        }
74
158
 
75
159
        /**
76
 
         * Render the section.
 
160
         * Render the section, and the controls that have been added to it.
77
161
         *
78
162
         * @since 3.4.0
79
163
         */