Code Duplication    Length = 11-11 lines in 2 locations

includes/CMB2.php 1 location

@@ 1225-1235 (lines=11) @@
1222
	 *
1223
	 * @return bool Whether this cmb should be shown.
1224
	 */
1225
	public function should_show() {
1226
		// Default to showing this cmb
1227
		$show = true;
1228
1229
		// Use the callback to determine showing the cmb, if it exists
1230
		if ( is_callable( $this->prop( 'show_on_cb' ) ) ) {
1231
			$show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this );
1232
		}
1233
1234
		return $show;
1235
	}
1236
1237
	/**
1238
	 * Generate a unique nonce field for each registered meta_box

includes/CMB2_Field.php 1 location

@@ 926-936 (lines=11) @@
923
	 *
924
	 * @return bool Whether the field should be shown.
925
	 */
926
	public function should_show() {
927
		// Default to showing the field
928
		$show = true;
929
930
		// Use the callback to determine showing the field, if it exists
931
		if ( is_callable( $this->args( 'show_on_cb' ) ) ) {
932
			$show = call_user_func( $this->args( 'show_on_cb' ), $this );
933
		}
934
935
		return $show;
936
	}
937
938
	/**
939
	 * Displays the results of the param callbacks.