Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 177-192 (lines=16) @@
174
	 *
175
	 * @return array Whitelisted post types.
176
	 */
177
	private function _get_whitelisted_post_types() {
178
		$allowed_types = array( 'post', 'page', 'revision' );
179
180
		/**
181
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
182
		 *
183
		 * @module json-api
184
		 *
185
		 * @since 2.2.3
186
		 *
187
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
188
		 */
189
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
190
191
		return array_unique( $allowed_types );
192
	}
193
194
	// copied and modified a little from class.json-api-endpoints.php
195
	private function user_can_view_post( $post ) {

class.json-api-endpoints.php 1 location

@@ 1575-1590 (lines=16) @@
1572
	 *
1573
	 * @return array Whitelisted post types.
1574
	 */
1575
	protected function _get_whitelisted_post_types() {
1576
		$allowed_types = array( 'post', 'page', 'revision' );
1577
1578
		/**
1579
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
1580
		 *
1581
		 * @module json-api
1582
		 *
1583
		 * @since 2.2.3
1584
		 *
1585
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
1586
		 */
1587
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
1588
1589
		return array_unique( $allowed_types );
1590
	}
1591
1592
	function handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs = array(), $force_parent_id = false ) {
1593