| @@ 170-185 (lines=16) @@ | ||
| 167 | * |
|
| 168 | * @return array Whitelisted post types. |
|
| 169 | */ |
|
| 170 | private function _get_whitelisted_post_types() { |
|
| 171 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
| 172 | ||
| 173 | /** |
|
| 174 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
| 175 | * |
|
| 176 | * @module json-api |
|
| 177 | * |
|
| 178 | * @since 2.2.3 |
|
| 179 | * |
|
| 180 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
| 181 | */ |
|
| 182 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
| 183 | ||
| 184 | return array_unique( $allowed_types ); |
|
| 185 | } |
|
| 186 | ||
| 187 | // copied and modified a little from class.json-api-endpoints.php |
|
| 188 | private function user_can_view_post( $post ) { |
|
| @@ 1587-1602 (lines=16) @@ | ||
| 1584 | * |
|
| 1585 | * @return array Whitelisted post types. |
|
| 1586 | */ |
|
| 1587 | protected function _get_whitelisted_post_types() { |
|
| 1588 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
| 1589 | ||
| 1590 | /** |
|
| 1591 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
| 1592 | * |
|
| 1593 | * @module json-api |
|
| 1594 | * |
|
| 1595 | * @since 2.2.3 |
|
| 1596 | * |
|
| 1597 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
| 1598 | */ |
|
| 1599 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
| 1600 | ||
| 1601 | return array_unique( $allowed_types ); |
|
| 1602 | } |
|
| 1603 | ||
| 1604 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
| 1605 | ||