@@ 1762-1777 (lines=16) @@ | ||
1759 | * |
|
1760 | * @return array Whitelisted post types. |
|
1761 | */ |
|
1762 | protected function _get_whitelisted_post_types() { |
|
1763 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
1764 | ||
1765 | /** |
|
1766 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
1767 | * |
|
1768 | * @module json-api |
|
1769 | * |
|
1770 | * @since 2.2.3 |
|
1771 | * |
|
1772 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
1773 | */ |
|
1774 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
1775 | ||
1776 | return array_unique( $allowed_types ); |
|
1777 | } |
|
1778 | ||
1779 | function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { |
|
1780 |
@@ 252-267 (lines=16) @@ | ||
249 | * |
|
250 | * @return array Whitelisted post types. |
|
251 | */ |
|
252 | public function get_whitelisted_post_types() { |
|
253 | $allowed_types = array( 'post', 'page', 'revision' ); |
|
254 | ||
255 | /** |
|
256 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. |
|
257 | * |
|
258 | * @module json-api |
|
259 | * |
|
260 | * @since 2.2.3 |
|
261 | * |
|
262 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. |
|
263 | */ |
|
264 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); |
|
265 | ||
266 | return array_unique( $allowed_types ); |
|
267 | } |
|
268 | ||
269 | // copied and modified a little from class.json-api-endpoints.php |
|
270 | private function user_can_view_post( $post ) { |