@@ 283-298 (lines=16) @@ | ||
280 | * |
|
281 | * @return array Whitelisted post types. |
|
282 | */ |
|
283 | public function get_whitelisted_post_types() { |
|
284 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
285 | ||
286 | /** |
|
287 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
288 | * |
|
289 | * @module json-api |
|
290 | * |
|
291 | * @since 2.2.3 |
|
292 | * |
|
293 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
294 | */ |
|
295 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
296 | ||
297 | return array_unique( $allowed_types ); |
|
298 | } |
|
299 | ||
300 | // copied and modified a little from class.json-api-endpoints.php |
|
301 | private function user_can_view_post( $post ) { |
@@ 1803-1818 (lines=16) @@ | ||
1800 | * |
|
1801 | * @return array Whitelisted post types. |
|
1802 | */ |
|
1803 | protected function _get_whitelisted_post_types() { |
|
1804 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
1805 | ||
1806 | /** |
|
1807 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
1808 | * |
|
1809 | * @module json-api |
|
1810 | * |
|
1811 | * @since 2.2.3 |
|
1812 | * |
|
1813 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
1814 | */ |
|
1815 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
1816 | ||
1817 | return array_unique( $allowed_types ); |
|
1818 | } |
|
1819 | ||
1820 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
1821 |