@@ 1182-1192 (lines=11) @@ | ||
1179 | * |
|
1180 | * @return bool Whether this cmb should be shown. |
|
1181 | */ |
|
1182 | public function should_show() { |
|
1183 | // Default to showing this cmb |
|
1184 | $show = true; |
|
1185 | ||
1186 | // Use the callback to determine showing the cmb, if it exists |
|
1187 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
1188 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
1189 | } |
|
1190 | ||
1191 | return $show; |
|
1192 | } |
|
1193 | ||
1194 | /** |
|
1195 | * Generate a unique nonce field for each registered meta_box |
@@ 921-931 (lines=11) @@ | ||
918 | * |
|
919 | * @return bool Whether the field should be shown. |
|
920 | */ |
|
921 | public function should_show() { |
|
922 | // Default to showing the field |
|
923 | $show = true; |
|
924 | ||
925 | // Use the callback to determine showing the field, if it exists |
|
926 | if ( is_callable( $this->args( 'show_on_cb' ) ) ) { |
|
927 | $show = call_user_func( $this->args( 'show_on_cb' ), $this ); |
|
928 | } |
|
929 | ||
930 | return $show; |
|
931 | } |
|
932 | ||
933 | /** |
|
934 | * Displays the results of the param callbacks. |