Code Duplication    Length = 11-11 lines in 2 locations

includes/CMB2.php 1 location

@@ 1101-1111 (lines=11) @@
1098
	 *
1099
	 * @return bool Whether this cmb should be shown.
1100
	 */
1101
	public function should_show() {
1102
		// Default to showing this cmb
1103
		$show = true;
1104
1105
		// Use the callback to determine showing the cmb, if it exists
1106
		if ( is_callable( $this->prop( 'show_on_cb' ) ) ) {
1107
			$show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this );
1108
		}
1109
1110
		return $show;
1111
	}
1112
1113
	/**
1114
	 * Generate a unique nonce field for each registered meta_box

includes/CMB2_Field.php 1 location

@@ 884-894 (lines=11) @@
881
	 *
882
	 * @return bool Whether the field should be shown.
883
	 */
884
	public function should_show() {
885
		// Default to showing the field
886
		$show = true;
887
888
		// Use the callback to determine showing the field, if it exists
889
		if ( is_callable( $this->args( 'show_on_cb' ) ) ) {
890
			$show = call_user_func( $this->args( 'show_on_cb' ), $this );
891
		}
892
893
		return $show;
894
	}
895
896
	/**
897
	 * Displays the results of the param callbacks.