@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @param string $type The type of option to return. Defaults to 'compact'. |
29 | 29 | * |
30 | - * @return array |
|
30 | + * @return string[] |
|
31 | 31 | */ |
32 | 32 | public static function get_option_names( $type = 'compact' ) { |
33 | 33 | switch ( $type ) { |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | * @since 5.4.0 |
506 | 506 | * |
507 | 507 | * @param boolean $strip_unsafe_options If true, and by default, will strip out options necessary for the connection to WordPress.com. |
508 | - * @return array An array of all options managed via the Jetpack_Options class. |
|
508 | + * @return string[] An array of all options managed via the Jetpack_Options class. |
|
509 | 509 | */ |
510 | 510 | public static function get_all_jetpack_options( $strip_unsafe_options = true ) { |
511 | 511 | $jetpack_options = self::get_option_names(); |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | * |
549 | 549 | * @since 5.4.0 |
550 | 550 | * |
551 | - * @return array |
|
551 | + * @return string[] |
|
552 | 552 | */ |
553 | 553 | public static function get_all_wp_options() { |
554 | 554 | // A manual build of the wp options. |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * @todo Use $wpdb->prepare for the SQL query. |
202 | 202 | * |
203 | 203 | * @param array $config Full sync configuration for this sync module. |
204 | - * @return array Number of items yet to be enqueued. |
|
204 | + * @return integer Number of items yet to be enqueued. |
|
205 | 205 | */ |
206 | 206 | public function estimate_full_sync_actions( $config ) { |
207 | 207 | global $wpdb; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @access public |
239 | 239 | * |
240 | - * @return array Full sync actions of this module. |
|
240 | + * @return string[] Full sync actions of this module. |
|
241 | 241 | */ |
242 | 242 | public function get_full_sync_actions() { |
243 | 243 | return array( 'jetpack_full_sync_posts' ); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | * |
225 | 225 | * @param string $table Table name to validate. |
226 | 226 | * |
227 | - * @return mixed|string |
|
227 | + * @return string |
|
228 | 228 | * @throws Exception Throw an exception on validation failure. |
229 | 229 | */ |
230 | 230 | private function validate_table_name( $table ) { |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | * @param int|null $range_to The end of the range. |
483 | 483 | * @param int|null $limit How many values to return. |
484 | 484 | * |
485 | - * @return array|object|void |
|
485 | + * @return boolean |
|
486 | 486 | * @throws Exception Throws an exception if validation fails on the internal function calls. |
487 | 487 | */ |
488 | 488 | public function get_range_edges( $range_from = null, $range_to = null, $limit = null ) { |
@@ -249,6 +249,9 @@ |
||
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
252 | + /** |
|
253 | + * @param string $access_token |
|
254 | + */ |
|
252 | 255 | private static function verify_token( $access_token ) { |
253 | 256 | $request = array( |
254 | 257 | 'headers' => array( |
@@ -1264,7 +1264,6 @@ |
||
1264 | 1264 | * |
1265 | 1265 | * @since 4.3.0 |
1266 | 1266 | * |
1267 | - * @param WP_REST_Request $request The request sent to the WP REST API. |
|
1268 | 1267 | * |
1269 | 1268 | * @return object |
1270 | 1269 | */ |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | * Only enqueue block assets when needed. |
584 | 584 | * |
585 | 585 | * @param string $type Slug of the block. |
586 | - * @param array $script_dependencies Script dependencies. Will be merged with automatically |
|
586 | + * @param string[] $script_dependencies Script dependencies. Will be merged with automatically |
|
587 | 587 | * detected script dependencies from the webpack build. |
588 | 588 | * |
589 | 589 | * @return void |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | * |
838 | 838 | * @param string $slug Block slug. |
839 | 839 | * @param array $attr Block attributes. |
840 | - * @param array $extra Potential extra classes you may want to provide. |
|
840 | + * @param string[] $extra Potential extra classes you may want to provide. |
|
841 | 841 | * |
842 | 842 | * @return string $classes List of CSS classes for a block. |
843 | 843 | */ |
@@ -934,10 +934,10 @@ discard block |
||
934 | 934 | * @since 8.3.0 |
935 | 935 | * |
936 | 936 | * @param string $url URL saved as an attribute in block. |
937 | - * @param array $allowed Array of allowed hosts for that block, or regexes to check against. |
|
937 | + * @param string[] $allowed Array of allowed hosts for that block, or regexes to check against. |
|
938 | 938 | * @param bool $is_regex Array of regexes matching the URL that could be used in block. |
939 | 939 | * |
940 | - * @return bool|string |
|
940 | + * @return false|string |
|
941 | 941 | */ |
942 | 942 | public static function validate_block_embed_url( $url, $allowed = array(), $is_regex = false ) { |
943 | 943 | if ( |
@@ -28,6 +28,11 @@ discard block |
||
28 | 28 | |
29 | 29 | // /sites/%s/posts/new -> $blog_id |
30 | 30 | // /sites/%s/posts/%d -> $blog_id, $post_id |
31 | + |
|
32 | + /** |
|
33 | + * @param string $path |
|
34 | + * @param integer $post_id |
|
35 | + */ |
|
31 | 36 | function write_post( $path, $blog_id, $post_id ) { |
32 | 37 | $new = $this->api->ends_with( $path, '/new' ); |
33 | 38 | $args = $this->query_args(); |
@@ -610,6 +615,11 @@ discard block |
||
610 | 615 | } |
611 | 616 | |
612 | 617 | // /sites/%s/posts/%d/delete -> $blog_id, $post_id |
618 | + |
|
619 | + /** |
|
620 | + * @param string $path |
|
621 | + * @param integer $post_id |
|
622 | + */ |
|
613 | 623 | function delete_post( $path, $blog_id, $post_id ) { |
614 | 624 | $post = get_post( $post_id ); |
615 | 625 | if ( !$post || is_wp_error( $post ) ) { |
@@ -645,6 +655,11 @@ discard block |
||
645 | 655 | } |
646 | 656 | |
647 | 657 | // /sites/%s/posts/%d/restore -> $blog_id, $post_id |
658 | + |
|
659 | + /** |
|
660 | + * @param string $path |
|
661 | + * @param integer $post_id |
|
662 | + */ |
|
648 | 663 | function restore_post( $path, $blog_id, $post_id ) { |
649 | 664 | $args = $this->query_args(); |
650 | 665 | $post = get_post( $post_id ); |
@@ -665,6 +680,10 @@ discard block |
||
665 | 680 | return $this->get_post_by( 'ID', $post->ID, $args['context'] ); |
666 | 681 | } |
667 | 682 | |
683 | + /** |
|
684 | + * @param boolean $delete_featured_image |
|
685 | + * @param string $featured_image |
|
686 | + */ |
|
668 | 687 | private function parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image ) { |
669 | 688 | if ( $delete_featured_image ) { |
670 | 689 | delete_post_thumbnail( $post_id ); |
@@ -214,6 +214,11 @@ discard block |
||
214 | 214 | |
215 | 215 | // /sites/%s/posts/new -> $blog_id |
216 | 216 | // /sites/%s/posts/%d -> $blog_id, $post_id |
217 | + |
|
218 | + /** |
|
219 | + * @param string $path |
|
220 | + * @param integer $post_id |
|
221 | + */ |
|
217 | 222 | function write_post( $path, $blog_id, $post_id ) { |
218 | 223 | global $wpdb; |
219 | 224 | |
@@ -890,6 +895,10 @@ discard block |
||
890 | 895 | } |
891 | 896 | |
892 | 897 | // /sites/%s/posts/%d/delete -> $blog_id, $post_id |
898 | + |
|
899 | + /** |
|
900 | + * @param string $path |
|
901 | + */ |
|
893 | 902 | function delete_post( $path, $blog_id, $post_id ) { |
894 | 903 | $post = get_post( $post_id ); |
895 | 904 | if ( !$post || is_wp_error( $post ) ) { |
@@ -929,6 +938,10 @@ discard block |
||
929 | 938 | } |
930 | 939 | |
931 | 940 | // /sites/%s/posts/%d/restore -> $blog_id, $post_id |
941 | + |
|
942 | + /** |
|
943 | + * @param string $path |
|
944 | + */ |
|
932 | 945 | function restore_post( $path, $blog_id, $post_id ) { |
933 | 946 | $args = $this->query_args(); |
934 | 947 | $post = get_post( $post_id ); |
@@ -949,6 +962,10 @@ discard block |
||
949 | 962 | return $this->get_post_by( 'ID', $post->ID, $args['context'] ); |
950 | 963 | } |
951 | 964 | |
965 | + /** |
|
966 | + * @param boolean $delete_featured_image |
|
967 | + * @param string $featured_image |
|
968 | + */ |
|
952 | 969 | protected function parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image ) { |
953 | 970 | if ( $delete_featured_image ) { |
954 | 971 | delete_post_thumbnail( $post_id ); |
@@ -170,6 +170,9 @@ |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | + /** |
|
174 | + * @param string $plugin |
|
175 | + */ |
|
173 | 176 | protected function validate_plugin( $plugin ) { |
174 | 177 | if ( ! isset( $plugin) || empty( $plugin ) ) { |
175 | 178 | return new WP_Error( 'missing_plugin', __( 'You are required to specify a plugin to activate.', 'jetpack' ), 400 ); |