| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 4 | function callback( $path = '', $blog_id = 0 ) { |
||
| 5 | $blog_id = $this->api->switch_to_blog_and_validate_user( $this->api->get_blog_id( $blog_id ) ); |
||
| 6 | if ( is_wp_error( $blog_id ) ) { |
||
| 7 | return $blog_id; |
||
| 8 | } |
||
| 9 | |||
| 10 | $input = $this->input(); |
||
| 11 | |||
| 12 | $post_ids = (array) $input['post_ids']; |
||
| 13 | |||
| 14 | $result = array( |
||
| 15 | 'results' => array(), |
||
| 16 | ); |
||
| 17 | |||
| 18 | foreach( $post_ids as $post_id ) { |
||
| 19 | $result['results'][ $post_id ] = $this->delete_post( $path, $blog_id, $post_id ); |
||
| 20 | } |
||
| 21 | |||
| 22 | return $result; |
||
| 23 | } |
||
| 24 | } |
||
| 25 |