Code Duplication    Length = 16-16 lines in 2 locations

class.json-api-endpoints.php 1 location

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

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

@@ 242-257 (lines=16) @@
239
	 *
240
	 * @return array Whitelisted post types.
241
	 */
242
	public function get_whitelisted_post_types() {
243
		$allowed_types = array( 'post', 'page', 'revision' );
244
245
		/**
246
		 * Filter the post types Jetpack has access to, and can synchronize with WordPress.com.
247
		 *
248
		 * @module json-api
249
		 *
250
		 * @since 2.2.3
251
		 *
252
		 * @param array $allowed_types Array of whitelisted post types. Default to `array( 'post', 'page', 'revision' )`.
253
		 */
254
		$allowed_types = apply_filters( 'rest_api_allowed_post_types', $allowed_types );
255
256
		return array_unique( $allowed_types );
257
	}
258
259
	// copied and modified a little from class.json-api-endpoints.php
260
	private function user_can_view_post( $post ) {