Code Duplication    Length = 9-13 lines in 2 locations

core/Container/Nav_Menu_Item_Container.php 1 location

@@ 144-156 (lines=13) @@
141
	 * @param int $object_id
142
	 * @return bool
143
	 */
144
	public function is_valid_attach_for_object( $object_id = null ) {
145
		$post = get_post( $object_id );
146
147
		if ( ! $post ) {
148
			return false;
149
		}
150
151
		if ( $post->post_type !== 'nav_menu_item' ) {
152
			return false;
153
		}
154
155
		return $this->all_conditions_pass( intval( $post->ID ) );
156
	}
157
158
	/**
159
	 * Output the container markup

core/Container/Post_Meta_Container.php 1 location

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