@@ 1181-1191 (lines=11) @@ | ||
1178 | * |
|
1179 | * @return bool Whether this cmb should be shown. |
|
1180 | */ |
|
1181 | public function should_show() { |
|
1182 | // Default to showing this cmb |
|
1183 | $show = true; |
|
1184 | ||
1185 | // Use the callback to determine showing the cmb, if it exists |
|
1186 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
1187 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
1188 | } |
|
1189 | ||
1190 | return $show; |
|
1191 | } |
|
1192 | ||
1193 | /** |
|
1194 | * Generate a unique nonce field for each registered meta_box |
@@ 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. |