Code Duplication    Length = 16-16 lines in 2 locations

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

class.json-api-endpoints.php 1 location

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