| @@ 903-913 (lines=11) @@ | ||
| 900 | * |
|
| 901 | * @return bool Whether the field should be shown. |
|
| 902 | */ |
|
| 903 | public function should_show() { |
|
| 904 | // Default to showing the field |
|
| 905 | $show = true; |
|
| 906 | ||
| 907 | // Use the callback to determine showing the field, if it exists |
|
| 908 | if ( is_callable( $this->args( 'show_on_cb' ) ) ) { |
|
| 909 | $show = call_user_func( $this->args( 'show_on_cb' ), $this ); |
|
| 910 | } |
|
| 911 | ||
| 912 | return $show; |
|
| 913 | } |
|
| 914 | ||
| 915 | /** |
|
| 916 | * Displays the results of the param callbacks. |
|
| @@ 1221-1231 (lines=11) @@ | ||
| 1218 | * |
|
| 1219 | * @return bool Whether this cmb should be shown. |
|
| 1220 | */ |
|
| 1221 | public function should_show() { |
|
| 1222 | // Default to showing this cmb |
|
| 1223 | $show = true; |
|
| 1224 | ||
| 1225 | // Use the callback to determine showing the cmb, if it exists |
|
| 1226 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
| 1227 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
| 1228 | } |
|
| 1229 | ||
| 1230 | return $show; |
|
| 1231 | } |
|
| 1232 | ||
| 1233 | /** |
|
| 1234 | * Generate a unique nonce field for each registered meta_box |
|