| @@ 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. |
|
| @@ 1154-1164 (lines=11) @@ | ||
| 1151 | * |
|
| 1152 | * @return bool Whether this cmb should be shown. |
|
| 1153 | */ |
|
| 1154 | public function should_show() { |
|
| 1155 | // Default to showing this cmb |
|
| 1156 | $show = true; |
|
| 1157 | ||
| 1158 | // Use the callback to determine showing the cmb, if it exists |
|
| 1159 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
| 1160 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
| 1161 | } |
|
| 1162 | ||
| 1163 | return $show; |
|
| 1164 | } |
|
| 1165 | ||
| 1166 | /** |
|
| 1167 | * Generate a unique nonce field for each registered meta_box |
|