| @@ 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 ) { | |
| @@ 1718-1733 (lines=16) @@ | ||
| 1715 | * | |
| 1716 | * @return array Whitelisted post types. | |
| 1717 | */ | |
| 1718 | 	protected function _get_whitelisted_post_types() { | |
| 1719 | $allowed_types = array( 'post', 'page', 'revision' ); | |
| 1720 | ||
| 1721 | /** | |
| 1722 | * Filter the post types Jetpack has access to, and can synchronize with WordPress.com. | |
| 1723 | * | |
| 1724 | * @module json-api | |
| 1725 | * | |
| 1726 | * @since 2.2.3 | |
| 1727 | * | |
| 1728 | * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`. | |
| 1729 | */ | |
| 1730 | $allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types ); | |
| 1731 | ||
| 1732 | return array_unique( $allowed_types ); | |
| 1733 | } | |
| 1734 | ||
| 1735 | 	function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) { | |
| 1736 | ||