Code Duplication    Length = 5-5 lines in 3 locations

core/Container/Term_Meta_Container.php 1 location

@@ 87-91 (lines=5) @@
84
	 * @return bool
85
	 **/
86
	public function is_valid_save( $term_id = null ) {
87
		if ( ! isset( $_REQUEST[ $this->get_nonce_name() ] ) || ! wp_verify_nonce( $_REQUEST[ $this->get_nonce_name() ], $this->get_nonce_name() ) ) { // Input var okay.
88
			return false;
89
		} else if ( $term_id < 1 ) {
90
			return false;
91
		}
92
93
		return true;
94
	}

core/Container/Post_Meta_Container.php 1 location

@@ 155-159 (lines=5) @@
152
	public function is_valid_save( $post_id = 0 ) {
153
		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
154
			return false;
155
		} else if ( ! isset( $_REQUEST[ $this->get_nonce_name() ] ) || ! wp_verify_nonce( $_REQUEST[ $this->get_nonce_name() ], $this->get_nonce_name() ) ) { // Input var okay.
156
			return false;
157
		} else if ( $post_id < 1 ) {
158
			return false;
159
		}
160
161
		return $this->is_valid_save_conditions( $post_id );
162
	}

core/Container/User_Meta_Container.php 1 location

@@ 68-72 (lines=5) @@
65
	 * @return bool
66
	 **/
67
	public function is_valid_save( $user_id = 0 ) {
68
		if ( ! isset( $_REQUEST[ $this->get_nonce_name() ] ) || ! wp_verify_nonce( $_REQUEST[ $this->get_nonce_name() ], $this->get_nonce_name() ) ) { // Input var okay.
69
			return false;
70
		} else if ( ! $this->is_valid_attach() ) {
71
			return false;
72
		}
73
74
		return $this->is_valid_save_conditions( $user_id );
75
	}