@@ 242-257 (lines=16) @@ | ||
239 | * |
|
240 | * @return array Whitelisted post types. |
|
241 | */ |
|
242 | public function get_whitelisted_post_types() { |
|
243 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
244 | ||
245 | /** |
|
246 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
247 | * |
|
248 | * @module json-api |
|
249 | * |
|
250 | * @since 2.2.3 |
|
251 | * |
|
252 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
253 | */ |
|
254 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
255 | ||
256 | return array_unique( $allowed_types ); |
|
257 | } |
|
258 | ||
259 | // copied and modified a little from class.json-api-endpoints.php |
|
260 | private function user_can_view_post( $post ) { |
@@ 1725-1740 (lines=16) @@ | ||
1722 | * |
|
1723 | * @return array Whitelisted post types. |
|
1724 | */ |
|
1725 | protected function _get_whitelisted_post_types() { |
|
1726 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
1727 | ||
1728 | /** |
|
1729 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
1730 | * |
|
1731 | * @module json-api |
|
1732 | * |
|
1733 | * @since 2.2.3 |
|
1734 | * |
|
1735 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
1736 | */ |
|
1737 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
1738 | ||
1739 | return array_unique( $allowed_types ); |
|
1740 | } |
|
1741 | ||
1742 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
1743 |