@@ 1608-1623 (lines=16) @@ | ||
1605 | * |
|
1606 | * @return array Whitelisted post types. |
|
1607 | */ |
|
1608 | protected function _get_whitelisted_post_types() { |
|
1609 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
1610 | ||
1611 | /** |
|
1612 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
1613 | * |
|
1614 | * @module json-api |
|
1615 | * |
|
1616 | * @since 2.2.3 |
|
1617 | * |
|
1618 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
1619 | */ |
|
1620 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
1621 | ||
1622 | return array_unique( $allowed_types ); |
|
1623 | } |
|
1624 | ||
1625 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
1626 |
@@ 202-217 (lines=16) @@ | ||
199 | * |
|
200 | * @return array Whitelisted post types. |
|
201 | */ |
|
202 | public function get_whitelisted_post_types() { |
|
203 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
204 | ||
205 | /** |
|
206 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
207 | * |
|
208 | * @module json-api |
|
209 | * |
|
210 | * @since 2.2.3 |
|
211 | * |
|
212 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
213 | */ |
|
214 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
215 | ||
216 | return array_unique( $allowed_types ); |
|
217 | } |
|
218 | ||
219 | // copied and modified a little from class.json-api-endpoints.php |
|
220 | private function user_can_view_post( $post ) { |