~canonical-sysadmins/wordpress/5.0

« back to all changes in this revision

Viewing changes to wp-includes/class-wp-widget.php

  • Committer: Barry Price
  • Date: 2017-11-17 04:49:02 UTC
  • mfrom: (1.1.30 upstream)
  • Revision ID: barry.price@canonical.com-20171117044902-5frux4ycbq6g9fyf
Merge WP4.9 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
         * Root ID for all widgets of this type.
24
24
         *
25
25
         * @since 2.8.0
26
 
         * @access public
27
26
         * @var mixed|string
28
27
         */
29
28
        public $id_base;
32
31
         * Name for this widget type.
33
32
         *
34
33
         * @since 2.8.0
35
 
         * @access public
36
34
         * @var string
37
35
         */
38
36
        public $name;
41
39
         * Option name for this widget type.
42
40
         *
43
41
         * @since 2.8.0
44
 
         * @access public
45
42
         * @var string
46
43
         */
47
44
        public $option_name;
50
47
         * Alt option name for this widget type.
51
48
         *
52
49
         * @since 2.8.0
53
 
         * @access public
54
50
         * @var string
55
51
         */
56
52
        public $alt_option_name;
59
55
         * Option array passed to wp_register_sidebar_widget().
60
56
         *
61
57
         * @since 2.8.0
62
 
         * @access public
63
58
         * @var array
64
59
         */
65
60
        public $widget_options;
68
63
         * Option array passed to wp_register_widget_control().
69
64
         *
70
65
         * @since 2.8.0
71
 
         * @access public
72
66
         * @var array
73
67
         */
74
68
        public $control_options;
77
71
         * Unique ID number of the current instance.
78
72
         *
79
73
         * @since 2.8.0
80
 
         * @access public
81
74
         * @var bool|int
82
75
         */
83
76
        public $number = false;
86
79
         * Unique ID string of the current instance (id_base-number).
87
80
         *
88
81
         * @since 2.8.0
89
 
         * @access public
90
82
         * @var bool|string
91
83
         */
92
84
        public $id = false;
98
90
         * not happen twice.
99
91
         *
100
92
         * @since 2.8.0
101
 
         * @access public
102
93
         * @var bool
103
94
         */
104
95
        public $updated = false;
113
104
         * Sub-classes should over-ride this function to generate their widget code.
114
105
         *
115
106
         * @since 2.8.0
116
 
         * @access public
117
107
         *
118
108
         * @param array $args     Display arguments including 'before_title', 'after_title',
119
109
         *                        'before_widget', and 'after_widget'.
131
121
         * saved/updated.
132
122
         *
133
123
         * @since 2.8.0
134
 
         * @access public
135
124
         *
136
125
         * @param array $new_instance New settings for this instance as input by the user via
137
126
         *                            WP_Widget::form().
146
135
         * Outputs the settings update form.
147
136
         *
148
137
         * @since 2.8.0
149
 
         * @access public
150
138
         *
151
139
         * @param array $instance Current settings.
152
140
         * @return string Default return is 'noform'.
162
150
         * PHP5 constructor.
163
151
         *
164
152
         * @since 2.8.0
165
 
         * @access public
166
153
         *
167
154
         * @param string $id_base         Optional Base ID for the widget, lowercase and unique. If left empty,
168
155
         *                                a portion of the widget's class name will be used Has to be unique.
184
171
         * PHP4 constructor.
185
172
         *
186
173
         * @since 2.8.0
187
 
         * @access public
188
174
         *
189
175
         * @see __construct()
190
176
         *
209
195
         *
210
196
         * @since 2.8.0
211
197
         * @since 4.4.0 Array format field names are now accepted.
212
 
         * @access public
213
198
         *
214
199
         * @param string $field_name Field name
215
200
         * @return string Name attribute for $field_name
230
215
         *
231
216
         * @since 2.8.0
232
217
         * @since 4.4.0 Array format field IDs are now accepted.
233
 
         * @access public
234
218
         *
235
219
         * @param string $field_name Field name.
236
220
         * @return string ID attribute for `$field_name`.
243
227
         * Register all widget instances of this widget class.
244
228
         *
245
229
         * @since 2.8.0
246
 
         * @access public
247
230
         */
248
231
        public function _register() {
249
232
                $settings = $this->get_settings();
275
258
         * Sets the internal order number for the widget instance.
276
259
         *
277
260
         * @since 2.8.0
278
 
         * @access public
279
261
         *
280
262
         * @param int $number The unique order number of this widget instance compared to other
281
263
         *                    instances of the same class.
289
271
         * Retrieves the widget display callback.
290
272
         *
291
273
         * @since 2.8.0
292
 
         * @access public
293
274
         *
294
275
         * @return callable Display callback.
295
276
         */
301
282
         * Retrieves the widget update callback.
302
283
         *
303
284
         * @since 2.8.0
304
 
         * @access public
305
285
         *
306
286
         * @return callable Update callback.
307
287
         */
313
293
         * Retrieves the form callback.
314
294
         *
315
295
         * @since 2.8.0
316
 
         * @access public
317
296
         *
318
297
         * @return callable Form callback.
319
298
         */
330
309
         * to transients, or anywhere else.
331
310
         *
332
311
         * @since 3.9.0
333
 
         * @access public
334
312
         *
335
313
         * @global WP_Customize_Manager $wp_customize
336
314
         *
347
325
         * Finds the instance and calls WP_Widget::widget().
348
326
         *
349
327
         * @since 2.8.0
350
 
         * @access public
351
328
         *
352
329
         * @param array     $args        Display arguments. See WP_Widget::widget() for information
353
330
         *                               on accepted arguments.
404
381
         * Handles changed settings (Do NOT override).
405
382
         *
406
383
         * @since 2.8.0
407
 
         * @access public
408
384
         *
409
385
         * @global array $wp_registered_widgets
410
386
         *
489
465
         * Generates the widget control form (Do NOT override).
490
466
         *
491
467
         * @since 2.8.0
492
 
         * @access public
493
468
         *
494
469
         * @param int|array $widget_args {
495
470
         *     Optional. Internal order number of the widget instance, or array of multi-widget arguments.
543
518
                         *
544
519
                         * @since 2.8.0
545
520
                         *
546
 
                         * @param WP_Widget $this     The widget instance, passed by reference.
 
521
                         * @param WP_Widget $this     The widget instance (passed by reference).
547
522
                         * @param null      $return   Return null if new fields are added.
548
523
                         * @param array     $instance An array of the widget's settings.
549
524
                         */
556
531
         * Registers an instance of the widget class.
557
532
         *
558
533
         * @since 2.8.0
559
 
         * @access public
560
534
         *
561
535
         * @param integer $number Optional. The unique order number of this widget instance
562
536
         *                        compared to other instances of the same class. Default -1.
571
545
         * Saves the settings for all instances of the widget class.
572
546
         *
573
547
         * @since 2.8.0
574
 
         * @access public
575
548
         *
576
549
         * @param array $settings Multi-dimensional array of widget instance settings.
577
550
         */
584
557
         * Retrieves the settings for all instances of the widget class.
585
558
         *
586
559
         * @since 2.8.0
587
 
         * @access public
588
560
         *
589
561
         * @return array Multi-dimensional array of widget instance settings.
590
562
         */