Code Duplication    Length = 11-11 lines in 2 locations

includes/CMB2_Field.php 1 location

@@ 903-913 (lines=11) @@
900
	 *
901
	 * @return bool Whether the field should be shown.
902
	 */
903
	public function should_show() {
904
		// Default to showing the field
905
		$show = true;
906
907
		// Use the callback to determine showing the field, if it exists
908
		if ( is_callable( $this->args( 'show_on_cb' ) ) ) {
909
			$show = call_user_func( $this->args( 'show_on_cb' ), $this );
910
		}
911
912
		return $show;
913
	}
914
915
	/**
916
	 * Displays the results of the param callbacks.

includes/CMB2.php 1 location

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