| @@ 274-289 (lines=16) @@ | ||
| 271 | * |
|
| 272 | * @return array Whitelisted post types. |
|
| 273 | */ |
|
| 274 | public function get_whitelisted_post_types() { |
|
| 275 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
| 276 | ||
| 277 | /** |
|
| 278 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
| 279 | * |
|
| 280 | * @module json-api |
|
| 281 | * |
|
| 282 | * @since 2.2.3 |
|
| 283 | * |
|
| 284 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
| 285 | */ |
|
| 286 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
| 287 | ||
| 288 | return array_unique( $allowed_types ); |
|
| 289 | } |
|
| 290 | ||
| 291 | // copied and modified a little from class.json-api-endpoints.php |
|
| 292 | private function user_can_view_post( $post ) { |
|
| @@ 1783-1798 (lines=16) @@ | ||
| 1780 | * |
|
| 1781 | * @return array Whitelisted post types. |
|
| 1782 | */ |
|
| 1783 | protected function _get_whitelisted_post_types() { |
|
| 1784 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
| 1785 | ||
| 1786 | /** |
|
| 1787 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
| 1788 | * |
|
| 1789 | * @module json-api |
|
| 1790 | * |
|
| 1791 | * @since 2.2.3 |
|
| 1792 | * |
|
| 1793 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
| 1794 | */ |
|
| 1795 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
| 1796 | ||
| 1797 | return array_unique( $allowed_types ); |
|
| 1798 | } |
|
| 1799 | ||
| 1800 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
| 1801 | ||