Code Duplication    Length = 9-13 lines in 2 locations

core/Container/Nav_Menu_Item_Container.php 1 location

@@ 125-137 (lines=13) @@
122
	 * @param int $object_id
123
	 * @return bool
124
	 */
125
	public function is_valid_attach_for_object( $object_id = null ) {
126
		$post = get_post( $object_id );
127
128
		if ( ! $post ) {
129
			return false;
130
		}
131
132
		if ( $post->post_type !== 'nav_menu_item' ) {
133
			return false;
134
		}
135
136
		return $this->all_conditions_pass( intval( $post->ID ) );
137
	}
138
139
	/**
140
	 * Output the container markup

core/Container/Post_Meta_Container.php 1 location

@@ 181-189 (lines=9) @@
178
	 * @param int $object_id
179
	 * @return bool
180
	 */
181
	public function is_valid_attach_for_object( $object_id = null ) {
182
		$post = get_post( intval( $object_id ) );
183
184
		if ( ! $post ) {
185
			return false;
186
		}
187
188
		return $this->all_conditions_pass( intval( $post->ID ) );
189
	}
190
191
	/**
192
	 * Add meta box for each of the container post types