@@ -646,7 +646,7 @@ |
||
646 | 646 | * handlers should be copied when the theme context is loaded by the REST API. |
647 | 647 | * |
648 | 648 | * @param array $copy_dirs Copy paths with actions to be copied |
649 | - * @return array Copy paths with featured content plugin |
|
649 | + * @return string[] Copy paths with featured content plugin |
|
650 | 650 | */ |
651 | 651 | function wpcom_rest_api_featured_content_copy_plugin_actions( $copy_dirs ) { |
652 | 652 | $copy_dirs[] = __FILE__; |
@@ -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 | global $wpdb; |
33 | 38 | |
@@ -704,6 +709,11 @@ discard block |
||
704 | 709 | } |
705 | 710 | |
706 | 711 | // /sites/%s/posts/%d/delete -> $blog_id, $post_id |
712 | + |
|
713 | + /** |
|
714 | + * @param string $path |
|
715 | + * @param integer $post_id |
|
716 | + */ |
|
707 | 717 | function delete_post( $path, $blog_id, $post_id ) { |
708 | 718 | $post = get_post( $post_id ); |
709 | 719 | if ( !$post || is_wp_error( $post ) ) { |
@@ -743,6 +753,11 @@ discard block |
||
743 | 753 | } |
744 | 754 | |
745 | 755 | // /sites/%s/posts/%d/restore -> $blog_id, $post_id |
756 | + |
|
757 | + /** |
|
758 | + * @param string $path |
|
759 | + * @param integer $post_id |
|
760 | + */ |
|
746 | 761 | function restore_post( $path, $blog_id, $post_id ) { |
747 | 762 | $args = $this->query_args(); |
748 | 763 | $post = get_post( $post_id ); |
@@ -763,6 +778,10 @@ discard block |
||
763 | 778 | return $this->get_post_by( 'ID', $post->ID, $args['context'] ); |
764 | 779 | } |
765 | 780 | |
781 | + /** |
|
782 | + * @param boolean $delete_featured_image |
|
783 | + * @param string $featured_image |
|
784 | + */ |
|
766 | 785 | protected function parse_and_set_featured_image( $post_id, $delete_featured_image, $featured_image ) { |
767 | 786 | if ( $delete_featured_image ) { |
768 | 787 | delete_post_thumbnail( $post_id ); |
@@ -111,6 +111,9 @@ discard block |
||
111 | 111 | wp_enqueue_script( 'a8c_wpcom_masterbar_overrides', $this->wpcom_static_url( '/wp-content/mu-plugins/admin-bar/masterbar-overrides/masterbar.js' ), array(), '20170630' ); |
112 | 112 | } |
113 | 113 | |
114 | + /** |
|
115 | + * @param string $file |
|
116 | + */ |
|
114 | 117 | function wpcom_static_url( $file ) { |
115 | 118 | if ( ! empty( $this->sandbox_url ) ) { |
116 | 119 | // For testing undeployed changes to remotely enqueued scripts and styles. |
@@ -293,6 +296,9 @@ discard block |
||
293 | 296 | return $primary_anchor . $secondary_anchor; |
294 | 297 | } |
295 | 298 | |
299 | + /** |
|
300 | + * @param string $class |
|
301 | + */ |
|
296 | 302 | public function create_menu_item_anchor( $class, $url, $label, $id ) { |
297 | 303 | return '<a href="' . $url . '" class="' . $class . '" id="' . $id . '">' . $label . '</a>'; |
298 | 304 | } |