| @@ 1242-1252 (lines=11) @@ | ||
| 1239 | * |
|
| 1240 | * @return bool Whether this cmb should be shown. |
|
| 1241 | */ |
|
| 1242 | public function should_show() { |
|
| 1243 | // Default to showing this cmb |
|
| 1244 | $show = true; |
|
| 1245 | ||
| 1246 | // Use the callback to determine showing the cmb, if it exists |
|
| 1247 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
| 1248 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
| 1249 | } |
|
| 1250 | ||
| 1251 | return $show; |
|
| 1252 | } |
|
| 1253 | ||
| 1254 | /** |
|
| 1255 | * Generate a unique nonce field for each registered meta_box |
|
| @@ 974-984 (lines=11) @@ | ||
| 971 | * |
|
| 972 | * @return bool Whether the field should be shown. |
|
| 973 | */ |
|
| 974 | public function should_show() { |
|
| 975 | // Default to showing the field |
|
| 976 | $show = true; |
|
| 977 | ||
| 978 | // Use the callback to determine showing the field, if it exists |
|
| 979 | if ( is_callable( $this->args( 'show_on_cb' ) ) ) { |
|
| 980 | $show = call_user_func( $this->args( 'show_on_cb' ), $this ); |
|
| 981 | } |
|
| 982 | ||
| 983 | return $show; |
|
| 984 | } |
|
| 985 | ||
| 986 | /** |
|
| 987 | * Displays the results of the param callbacks. |
|