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