Code Duplication    Length = 16-16 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1699-1714 (lines=16) @@
1696
	 *
1697
	 * @return array Whitelisted post types.
1698
	 */
1699
	protected function _get_whitelisted_post_types() {
1700
		$allowed_types = array( 'post', 'page', 'revision' );
1701
1702
		/**
1703
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
1704
		 *
1705
		 * @module json-api
1706
		 *
1707
		 * @since 2.2.3
1708
		 *
1709
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
1710
		 */
1711
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
1712
1713
		return array_unique( $allowed_types );
1714
	}
1715
1716
	function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) {
1717

sal/class.json-api-site-base.php 1 location

@@ 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 ) {