| @@ 1123-1133 (lines=11) @@ | ||
| 1120 | * |
|
| 1121 | * @return bool Whether this cmb should be shown. |
|
| 1122 | */ |
|
| 1123 | public function should_show() { |
|
| 1124 | // Default to showing this cmb |
|
| 1125 | $show = true; |
|
| 1126 | ||
| 1127 | // Use the callback to determine showing the cmb, if it exists |
|
| 1128 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
| 1129 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
| 1130 | } |
|
| 1131 | ||
| 1132 | return $show; |
|
| 1133 | } |
|
| 1134 | ||
| 1135 | /** |
|
| 1136 | * Generate a unique nonce field for each registered meta_box |
|
| @@ 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. |
|