@@ -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 ); |