@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * Show the container only on terms from the specified taxonomies. |
188 | 188 | * |
189 | 189 | * @param string|array $taxonomies |
190 | - * @return object $this |
|
190 | + * @return Term_Meta_Container $this |
|
191 | 191 | **/ |
192 | 192 | public function show_on_taxonomy( $taxonomies ) { |
193 | 193 | $taxonomies = (array) $taxonomies; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * Show the container only on particular term level. |
202 | 202 | * |
203 | 203 | * @param int $term_level |
204 | - * @return object $this |
|
204 | + * @return Term_Meta_Container $this |
|
205 | 205 | */ |
206 | 206 | public function show_on_level( $term_level ) { |
207 | 207 | $this->settings['show_on_level'] = $term_level; |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * |
303 | 303 | * @see init() |
304 | 304 | * @param array $settings |
305 | - * @return object $this |
|
305 | + * @return Container $this |
|
306 | 306 | **/ |
307 | 307 | public function setup( $settings = array() ) { |
308 | 308 | if ( $this->setup_ready ) { |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | * assigned to them instead. |
468 | 468 | * |
469 | 469 | * @param array $fields |
470 | - * @return object $this |
|
470 | + * @return Container $this |
|
471 | 471 | **/ |
472 | 472 | public function add_fields( $fields ) { |
473 | 473 | foreach ( $fields as $field ) { |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | * |
494 | 494 | * @param string $tab_name |
495 | 495 | * @param array $fields |
496 | - * @return object $this |
|
496 | + * @return Container $this |
|
497 | 497 | */ |
498 | 498 | public function add_tab( $tab_name, $fields ) { |
499 | 499 | $this->add_template( 'tabs', array( $this, 'template_tabs' ) ); |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | * Assign datastore instance for use by the container fields |
692 | 692 | * |
693 | 693 | * @param Datastore_Interface $datastore |
694 | - * @return object $this |
|
694 | + * @return Container $this |
|
695 | 695 | **/ |
696 | 696 | public function set_datastore( Datastore_Interface $datastore, $set_as_default = false ) { |
697 | 697 | if ( $set_as_default && !$this->has_default_datastore() ) { |
@@ -326,8 +326,8 @@ discard block |
||
326 | 326 | /** |
327 | 327 | * Assign DataStore instance for use during load, save and delete |
328 | 328 | * |
329 | - * @param object $datastore |
|
330 | - * @return object $this |
|
329 | + * @param Datastore_Interface $datastore |
|
330 | + * @return Field $this |
|
331 | 331 | **/ |
332 | 332 | public function set_datastore( Datastore_Interface $datastore, $set_as_default = false ) { |
333 | 333 | if ( $set_as_default && !$this->has_default_datastore() ) { |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | /** |
342 | 342 | * Return the DataStore instance used by the field |
343 | 343 | * |
344 | - * @return object $datastore |
|
344 | + * @return Datastore_Interface $datastore |
|
345 | 345 | **/ |
346 | 346 | public function get_datastore() { |
347 | 347 | return $this->datastore; |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | * Assign the type of the container this field is in |
352 | 352 | * |
353 | 353 | * @param string |
354 | - * @return object $this |
|
354 | + * @return Field $this |
|
355 | 355 | **/ |
356 | 356 | public function set_context( $context ) { |
357 | 357 | $this->context = $context; |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | * name and the conditional logic fields. |
455 | 455 | * |
456 | 456 | * @param string $prefix |
457 | - * @return object $this |
|
457 | + * @return Field $this |
|
458 | 458 | **/ |
459 | 459 | public function set_prefix( $prefix ) { |
460 | 460 | $escaped_prefix = preg_quote( $this->name_prefix, '~' ); |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | * Set additional text to be displayed during field render, |
500 | 500 | * containing information and guidance for the user |
501 | 501 | * |
502 | - * @return object $this |
|
502 | + * @return Field $this |
|
503 | 503 | **/ |
504 | 504 | public function set_help_text( $help_text ) { |
505 | 505 | $this->help_text = $help_text; |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | * Alias for set_help_text() |
511 | 511 | * |
512 | 512 | * @see set_help_text() |
513 | - * @return object $this |
|
513 | + * @return Field $this |
|
514 | 514 | **/ |
515 | 515 | public function help_text( $help_text ) { |
516 | 516 | return $this->set_help_text( $help_text ); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | /** |
520 | 520 | * Return the field help text |
521 | 521 | * |
522 | - * @return object $this |
|
522 | + * @return string $this |
|
523 | 523 | **/ |
524 | 524 | public function get_help_text() { |
525 | 525 | return $this->help_text; |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | * Whether or not this value should be auto loaded. Applicable to theme options only. |
530 | 530 | * |
531 | 531 | * @param bool $autoload |
532 | - * @return object $this |
|
532 | + * @return Field $this |
|
533 | 533 | **/ |
534 | 534 | public function set_autoload( $autoload ) { |
535 | 535 | $this->autoload = $autoload; |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | * Whether or not this field will be initialized when the field is in the viewport (visible). |
550 | 550 | * |
551 | 551 | * @param bool $lazyload |
552 | - * @return object $this |
|
552 | + * @return Field $this |
|
553 | 553 | **/ |
554 | 554 | public function set_lazyload( $lazyload ) { |
555 | 555 | $this->lazyload = $lazyload; |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | * Set the field width. |
570 | 570 | * |
571 | 571 | * @param int $width |
572 | - * @return object $this |
|
572 | + * @return Field $this |
|
573 | 573 | **/ |
574 | 574 | public function set_width( $width ) { |
575 | 575 | $this->width = (int) $width; |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | * Add custom CSS class to the field html container. |
590 | 590 | * |
591 | 591 | * @param string|array $classes |
592 | - * @return object $this |
|
592 | + * @return Field $this |
|
593 | 593 | **/ |
594 | 594 | public function add_class( $classes ) { |
595 | 595 | if ( ! is_array( $classes ) ) { |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | * Whether this field is mandatory for the user |
614 | 614 | * |
615 | 615 | * @param bool $required |
616 | - * @return object $this |
|
616 | + * @return Field $this |
|
617 | 617 | **/ |
618 | 618 | public function set_required( $required = true ) { |
619 | 619 | $this->required = $required; |
@@ -662,6 +662,7 @@ discard block |
||
662 | 662 | /** |
663 | 663 | * Cleans up an object class for usage as HTML class |
664 | 664 | * |
665 | + * @param string $type |
|
665 | 666 | * @return string |
666 | 667 | */ |
667 | 668 | protected function clean_type( $type ) { |
@@ -679,7 +680,7 @@ discard block |
||
679 | 680 | /** |
680 | 681 | * Return an array of html classes to be used for the field container |
681 | 682 | * |
682 | - * @return array |
|
683 | + * @return string[] |
|
683 | 684 | */ |
684 | 685 | public function get_html_class() { |
685 | 686 | $html_classes = array(); |
@@ -22,7 +22,6 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Create a new nav menu item fields container |
24 | 24 | * |
25 | - * @param string $id ID of the container |
|
26 | 25 | **/ |
27 | 26 | public function __construct( $title ) { |
28 | 27 | parent::__construct( $title ); |
@@ -42,7 +41,6 @@ discard block |
||
42 | 41 | * Perform instance initialization after calling setup() |
43 | 42 | * |
44 | 43 | * @param int $menu_item_id Used to pass the correct menu_item_id to the Container object |
45 | - * @param bool $render Whether the container will render the fields. |
|
46 | 44 | */ |
47 | 45 | public function init( $menu_item_id = 0 ) { |
48 | 46 | $this->get_datastore()->set_id( $menu_item_id ); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | * Show the container only on pages whose parent is referenced by $parent_page_path. |
394 | 394 | * |
395 | 395 | * @param string $parent_page_path |
396 | - * @return object $this |
|
396 | + * @return Post_Meta_Container $this |
|
397 | 397 | **/ |
398 | 398 | public function show_on_page_children( $parent_page_path ) { |
399 | 399 | $page = get_page_by_path( $parent_page_path ); |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * Show the container only on particular page referenced by it's path. |
414 | 414 | * |
415 | 415 | * @param int|string $page page ID or page path |
416 | - * @return object $this |
|
416 | + * @return Post_Meta_Container $this |
|
417 | 417 | **/ |
418 | 418 | public function show_on_page( $page ) { |
419 | 419 | $page_id = absint( $page ); |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | * @see show_on_taxonomy_term() |
442 | 442 | * |
443 | 443 | * @param string $category_slug |
444 | - * @return object $this |
|
444 | + * @return Post_Meta_Container $this |
|
445 | 445 | **/ |
446 | 446 | public function show_on_category( $category_slug ) { |
447 | 447 | $this->settings['show_on']['category'] = $category_slug; |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | * Show the container only on pages whose template has filename $template_path. |
454 | 454 | * |
455 | 455 | * @param string|array $template_path |
456 | - * @return object $this |
|
456 | + * @return Post_Meta_Container $this |
|
457 | 457 | **/ |
458 | 458 | public function show_on_template( $template_path ) { |
459 | 459 | // Backwards compatibility where only pages support templates |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | * Hide the container from pages whose template has filename $template_path. |
479 | 479 | * |
480 | 480 | * @param string|array $template_path |
481 | - * @return object $this |
|
481 | + * @return Post_Meta_Container $this |
|
482 | 482 | **/ |
483 | 483 | public function hide_on_template( $template_path ) { |
484 | 484 | if ( is_array( $template_path ) ) { |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | * Levels start from 1 (top level post) |
499 | 499 | * |
500 | 500 | * @param int $level |
501 | - * @return object $this |
|
501 | + * @return Post_Meta_Container $this |
|
502 | 502 | **/ |
503 | 503 | public function show_on_level( $level ) { |
504 | 504 | if ( $level < 0 ) { |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | * |
516 | 516 | * @param string $taxonomy_slug |
517 | 517 | * @param string $term_slug |
518 | - * @return object $this |
|
518 | + * @return Post_Meta_Container $this |
|
519 | 519 | **/ |
520 | 520 | public function show_on_taxonomy_term( $term_slug, $taxonomy_slug ) { |
521 | 521 | $term = get_term_by( 'slug', $term_slug, $taxonomy_slug ); |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | * Learn more about {@link http://codex.wordpress.org/Post_Formats Post Formats (Codex)} |
533 | 533 | * |
534 | 534 | * @param string|array $post_format Name of the format as listed on Codex |
535 | - * @return object $this |
|
535 | + * @return Post_Meta_Container $this |
|
536 | 536 | **/ |
537 | 537 | public function show_on_post_format( $post_format ) { |
538 | 538 | if ( is_array( $post_format ) ) { |
@@ -554,8 +554,8 @@ discard block |
||
554 | 554 | /** |
555 | 555 | * Show the container only on posts from the specified type(s). |
556 | 556 | * |
557 | - * @param string|array $post_types |
|
558 | - * @return object $this |
|
557 | + * @param string $post_types |
|
558 | + * @return Post_Meta_Container $this |
|
559 | 559 | **/ |
560 | 560 | public function show_on_post_type( $post_types ) { |
561 | 561 | $post_types = (array) $post_types; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * Perform checks whether the current save() request is valid |
104 | 104 | * |
105 | 105 | * @param int $user_id ID of the user against which save() is ran |
106 | - * @return bool |
|
106 | + * @return null|boolean |
|
107 | 107 | **/ |
108 | 108 | public function is_valid_save_conditions( $user_id ) { |
109 | 109 | $valid = true; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Checks whether the current request is valid |
134 | 134 | * |
135 | - * @return bool |
|
135 | + * @return null|boolean |
|
136 | 136 | **/ |
137 | 137 | public function is_valid_save( $user_id = 0 ) { |
138 | 138 | if ( ! isset( $_REQUEST[ $this->get_nonce_name() ] ) || ! wp_verify_nonce( $_REQUEST[ $this->get_nonce_name() ], $this->get_nonce_name() ) ) { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * Show the container only on users who have the $role role. |
199 | 199 | * |
200 | 200 | * @param string $role |
201 | - * @return object $this |
|
201 | + * @return User_Meta_Container $this |
|
202 | 202 | **/ |
203 | 203 | public function show_on_user_role( $role ) { |
204 | 204 | $this->settings['show_on']['role'] = (array) $role; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * Show the container only for users who have either capabilities or roles setup |
211 | 211 | * |
212 | 212 | * @param array $show_for |
213 | - * @return object $this |
|
213 | + * @return User_Meta_Container $this |
|
214 | 214 | **/ |
215 | 215 | public function show_for( $show_for ) { |
216 | 216 | $this->settings['show_for'] = $this->parse_show_for( $show_for ); |
@@ -221,7 +221,6 @@ discard block |
||
221 | 221 | /** |
222 | 222 | * Validate and parse the show_for logic rules. |
223 | 223 | * |
224 | - * @param array $rules |
|
225 | 224 | * @return array |
226 | 225 | */ |
227 | 226 | protected function parse_show_for( $show_for ) { |
@@ -57,6 +57,7 @@ |
||
57 | 57 | * Sanitize a title to a filename |
58 | 58 | * |
59 | 59 | * @param string $title |
60 | + * @param string $extension |
|
60 | 61 | * @return string |
61 | 62 | */ |
62 | 63 | protected function title_to_filename( $title, $extension ) { |