| @@ 896-906 (lines=11) @@ | ||
| 893 | * |
|
| 894 | * @return bool Whether the field should be shown. |
|
| 895 | */ |
|
| 896 | public function should_show() { |
|
| 897 | // Default to showing the field |
|
| 898 | $show = true; |
|
| 899 | ||
| 900 | // Use the callback to determine showing the field, if it exists |
|
| 901 | if ( is_callable( $this->args( 'show_on_cb' ) ) ) { |
|
| 902 | $show = call_user_func( $this->args( 'show_on_cb' ), $this ); |
|
| 903 | } |
|
| 904 | ||
| 905 | return $show; |
|
| 906 | } |
|
| 907 | ||
| 908 | /** |
|
| 909 | * Displays the results of the param callbacks. |
|
| @@ 1138-1148 (lines=11) @@ | ||
| 1135 | * |
|
| 1136 | * @return bool Whether this cmb should be shown. |
|
| 1137 | */ |
|
| 1138 | public function should_show() { |
|
| 1139 | // Default to showing this cmb |
|
| 1140 | $show = true; |
|
| 1141 | ||
| 1142 | // Use the callback to determine showing the cmb, if it exists |
|
| 1143 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
| 1144 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
| 1145 | } |
|
| 1146 | ||
| 1147 | return $show; |
|
| 1148 | } |
|
| 1149 | ||
| 1150 | /** |
|
| 1151 | * Generate a unique nonce field for each registered meta_box |
|