| @@ 204-219 (lines=16) @@ | ||
| 201 | * |
|
| 202 | * @return array Whitelisted post types. |
|
| 203 | */ |
|
| 204 | public function get_whitelisted_post_types() { |
|
| 205 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
| 206 | ||
| 207 | /** |
|
| 208 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
| 209 | * |
|
| 210 | * @module json-api |
|
| 211 | * |
|
| 212 | * @since 2.2.3 |
|
| 213 | * |
|
| 214 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
| 215 | */ |
|
| 216 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
| 217 | ||
| 218 | return array_unique( $allowed_types ); |
|
| 219 | } |
|
| 220 | ||
| 221 | // copied and modified a little from class.json-api-endpoints.php |
|
| 222 | private function user_can_view_post( $post ) { |
|
| @@ 1666-1681 (lines=16) @@ | ||
| 1663 | * |
|
| 1664 | * @return array Whitelisted post types. |
|
| 1665 | */ |
|
| 1666 | protected function _get_whitelisted_post_types() { |
|
| 1667 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
| 1668 | ||
| 1669 | /** |
|
| 1670 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
| 1671 | * |
|
| 1672 | * @module json-api |
|
| 1673 | * |
|
| 1674 | * @since 2.2.3 |
|
| 1675 | * |
|
| 1676 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
| 1677 | */ |
|
| 1678 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
| 1679 | ||
| 1680 | return array_unique( $allowed_types ); |
|
| 1681 | } |
|
| 1682 | ||
| 1683 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
| 1684 | ||