| @@ 228-243 (lines=16) @@ | ||
| 225 | * |
|
| 226 | * @return array Whitelisted post types. |
|
| 227 | */ |
|
| 228 | public function get_whitelisted_post_types() { |
|
| 229 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
| 230 | ||
| 231 | /** |
|
| 232 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
| 233 | * |
|
| 234 | * @module json-api |
|
| 235 | * |
|
| 236 | * @since 2.2.3 |
|
| 237 | * |
|
| 238 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
| 239 | */ |
|
| 240 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
| 241 | ||
| 242 | return array_unique( $allowed_types ); |
|
| 243 | } |
|
| 244 | ||
| 245 | // copied and modified a little from class.json-api-endpoints.php |
|
| 246 | private function user_can_view_post( $post ) { |
|
| @@ 1708-1723 (lines=16) @@ | ||
| 1705 | * |
|
| 1706 | * @return array Whitelisted post types. |
|
| 1707 | */ |
|
| 1708 | protected function _get_whitelisted_post_types() { |
|
| 1709 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
| 1710 | ||
| 1711 | /** |
|
| 1712 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
| 1713 | * |
|
| 1714 | * @module json-api |
|
| 1715 | * |
|
| 1716 | * @since 2.2.3 |
|
| 1717 | * |
|
| 1718 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
| 1719 | */ |
|
| 1720 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
| 1721 | ||
| 1722 | return array_unique( $allowed_types ); |
|
| 1723 | } |
|
| 1724 | ||
| 1725 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
| 1726 | ||