Code Duplication    Length = 11-11 lines in 2 locations

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.

includes/CMB2.php 1 location

@@ 1116-1126 (lines=11) @@
1113
	 *
1114
	 * @return bool Whether this cmb should be shown.
1115
	 */
1116
	public function should_show() {
1117
		// Default to showing this cmb
1118
		$show = true;
1119
1120
		// Use the callback to determine showing the cmb, if it exists
1121
		if ( is_callable( $this->prop( 'show_on_cb' ) ) ) {
1122
			$show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this );
1123
		}
1124
1125
		return $show;
1126
	}
1127
1128
	/**
1129
	 * Generate a unique nonce field for each registered meta_box