@@ 1145-1155 (lines=11) @@ | ||
1142 | * |
|
1143 | * @return bool Whether this cmb should be shown. |
|
1144 | */ |
|
1145 | public function should_show() { |
|
1146 | // Default to showing this cmb |
|
1147 | $show = true; |
|
1148 | ||
1149 | // Use the callback to determine showing the cmb, if it exists |
|
1150 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
1151 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
1152 | } |
|
1153 | ||
1154 | return $show; |
|
1155 | } |
|
1156 | ||
1157 | /** |
|
1158 | * Generate a unique nonce field for each registered meta_box |
@@ 909-919 (lines=11) @@ | ||
906 | * |
|
907 | * @return bool Whether the field should be shown. |
|
908 | */ |
|
909 | public function should_show() { |
|
910 | // Default to showing the field |
|
911 | $show = true; |
|
912 | ||
913 | // Use the callback to determine showing the field, if it exists |
|
914 | if ( is_callable( $this->args( 'show_on_cb' ) ) ) { |
|
915 | $show = call_user_func( $this->args( 'show_on_cb' ), $this ); |
|
916 | } |
|
917 | ||
918 | return $show; |
|
919 | } |
|
920 | ||
921 | /** |
|
922 | * Displays the results of the param callbacks. |