@@ 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. |
@@ 1105-1115 (lines=11) @@ | ||
1102 | * |
|
1103 | * @return bool Whether this cmb should be shown. |
|
1104 | */ |
|
1105 | public function should_show() { |
|
1106 | // Default to showing this cmb |
|
1107 | $show = true; |
|
1108 | ||
1109 | // Use the callback to determine showing the cmb, if it exists |
|
1110 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
1111 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
1112 | } |
|
1113 | ||
1114 | return $show; |
|
1115 | } |
|
1116 | ||
1117 | /** |
|
1118 | * Generate a unique nonce field for each registered meta_box |