@@ 884-894 (lines=11) @@ | ||
881 | * |
|
882 | * @return bool Whether the field should be shown. |
|
883 | */ |
|
884 | public function should_show() { |
|
885 | // Default to showing the field |
|
886 | $show = true; |
|
887 | ||
888 | // Use the callback to determine showing the field, if it exists |
|
889 | if ( is_callable( $this->args( 'show_on_cb' ) ) ) { |
|
890 | $show = call_user_func( $this->args( 'show_on_cb' ), $this ); |
|
891 | } |
|
892 | ||
893 | return $show; |
|
894 | } |
|
895 | ||
896 | /** |
|
897 | * Displays the results of the param callbacks. |
@@ 1110-1120 (lines=11) @@ | ||
1107 | * |
|
1108 | * @return bool Whether this cmb should be shown. |
|
1109 | */ |
|
1110 | public function should_show() { |
|
1111 | // Default to showing this cmb |
|
1112 | $show = true; |
|
1113 | ||
1114 | // Use the callback to determine showing the cmb, if it exists |
|
1115 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
1116 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
1117 | } |
|
1118 | ||
1119 | return $show; |
|
1120 | } |
|
1121 | ||
1122 | /** |
|
1123 | * Generate a unique nonce field for each registered meta_box |