@@ 1637-1652 (lines=16) @@ | ||
1634 | * |
|
1635 | * @return array Whitelisted post types. |
|
1636 | */ |
|
1637 | protected function _get_whitelisted_post_types() { |
|
1638 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
1639 | ||
1640 | /** |
|
1641 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
1642 | * |
|
1643 | * @module json-api |
|
1644 | * |
|
1645 | * @since 2.2.3 |
|
1646 | * |
|
1647 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
1648 | */ |
|
1649 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
1650 | ||
1651 | return array_unique( $allowed_types ); |
|
1652 | } |
|
1653 | ||
1654 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
1655 |
@@ 204-219 (lines=16) @@ | ||
201 | * |
|
202 | * @return array Whitelisted post types. |
|
203 | */ |
|
204 | public function get_whitelisted_post_types() { |
|
205 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
206 | ||
207 | /** |
|
208 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
209 | * |
|
210 | * @module json-api |
|
211 | * |
|
212 | * @since 2.2.3 |
|
213 | * |
|
214 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
215 | */ |
|
216 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
217 | ||
218 | return array_unique( $allowed_types ); |
|
219 | } |
|
220 | ||
221 | // copied and modified a little from class.json-api-endpoints.php |
|
222 | private function user_can_view_post( $post ) { |