Code Duplication    Length = 11-11 lines in 2 locations

includes/CMB2.php 1 location

@@ 1134-1144 (lines=11) @@
1131
	 *
1132
	 * @return bool Whether this cmb should be shown.
1133
	 */
1134
	public function should_show() {
1135
		// Default to showing this cmb
1136
		$show = true;
1137
1138
		// Use the callback to determine showing the cmb, if it exists
1139
		if ( is_callable( $this->prop( 'show_on_cb' ) ) ) {
1140
			$show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this );
1141
		}
1142
1143
		return $show;
1144
	}
1145
1146
	/**
1147
	 * Generate a unique nonce field for each registered meta_box

includes/CMB2_Field.php 1 location

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