Code Duplication    Length = 11-11 lines in 2 locations

includes/CMB2.php 1 location

@@ 1243-1253 (lines=11) @@
1240
	 *
1241
	 * @return bool Whether this cmb should be shown.
1242
	 */
1243
	public function should_show() {
1244
		// Default to showing this cmb
1245
		$show = true;
1246
1247
		// Use the callback to determine showing the cmb, if it exists
1248
		if ( is_callable( $this->prop( 'show_on_cb' ) ) ) {
1249
			$show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this );
1250
		}
1251
1252
		return $show;
1253
	}
1254
1255
	/**
1256
	 * Generate a unique nonce field for each registered meta_box

includes/CMB2_Field.php 1 location

@@ 999-1009 (lines=11) @@
996
	 *
997
	 * @return bool Whether the field should be shown.
998
	 */
999
	public function should_show() {
1000
		// Default to showing the field
1001
		$show = true;
1002
1003
		// Use the callback to determine showing the field, if it exists
1004
		if ( is_callable( $this->args( 'show_on_cb' ) ) ) {
1005
			$show = call_user_func( $this->args( 'show_on_cb' ), $this );
1006
		}
1007
1008
		return $show;
1009
	}
1010
1011
	/**
1012
	 * Displays the results of the param callbacks.