Code Duplication    Length = 16-16 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1768-1783 (lines=16) @@
1765
	 *
1766
	 * @return array Whitelisted post types.
1767
	 */
1768
	protected function _get_whitelisted_post_types() {
1769
		$allowed_types = array( 'post', 'page', 'revision' );
1770
1771
		/**
1772
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
1773
		 *
1774
		 * @module json-api
1775
		 *
1776
		 * @since 2.2.3
1777
		 *
1778
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
1779
		 */
1780
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
1781
1782
		return array_unique( $allowed_types );
1783
	}
1784
1785
	function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) {
1786

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

@@ 262-277 (lines=16) @@
259
	 *
260
	 * @return array Whitelisted post types.
261
	 */
262
	public function get_whitelisted_post_types() {
263
		$allowed_types = array( 'post', 'page', 'revision' );
264
265
		/**
266
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
267
		 *
268
		 * @module json-api
269
		 *
270
		 * @since 2.2.3
271
		 *
272
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
273
		 */
274
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
275
276
		return array_unique( $allowed_types );
277
	}
278
279
	// copied and modified a little from class.json-api-endpoints.php
280
	private function user_can_view_post( $post ) {