@@ 250-265 (lines=16) @@ | ||
247 | * |
|
248 | * @return array Whitelisted post types. |
|
249 | */ |
|
250 | public function get_whitelisted_post_types() { |
|
251 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
252 | ||
253 | /** |
|
254 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
255 | * |
|
256 | * @module json-api |
|
257 | * |
|
258 | * @since 2.2.3 |
|
259 | * |
|
260 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
261 | */ |
|
262 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
263 | ||
264 | return array_unique( $allowed_types ); |
|
265 | } |
|
266 | ||
267 | // copied and modified a little from class.json-api-endpoints.php |
|
268 | private function user_can_view_post( $post ) { |
@@ 1737-1752 (lines=16) @@ | ||
1734 | * |
|
1735 | * @return array Whitelisted post types. |
|
1736 | */ |
|
1737 | protected function _get_whitelisted_post_types() { |
|
1738 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
1739 | ||
1740 | /** |
|
1741 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
1742 | * |
|
1743 | * @module json-api |
|
1744 | * |
|
1745 | * @since 2.2.3 |
|
1746 | * |
|
1747 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
1748 | */ |
|
1749 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
1750 | ||
1751 | return array_unique( $allowed_types ); |
|
1752 | } |
|
1753 | ||
1754 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
1755 |