@@ 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. |
@@ 1236-1246 (lines=11) @@ | ||
1233 | * |
|
1234 | * @return bool Whether this cmb should be shown. |
|
1235 | */ |
|
1236 | public function should_show() { |
|
1237 | // Default to showing this cmb |
|
1238 | $show = true; |
|
1239 | ||
1240 | // Use the callback to determine showing the cmb, if it exists |
|
1241 | if ( is_callable( $this->prop( 'show_on_cb' ) ) ) { |
|
1242 | $show = (bool) call_user_func( $this->prop( 'show_on_cb' ), $this ); |
|
1243 | } |
|
1244 | ||
1245 | return $show; |
|
1246 | } |
|
1247 | ||
1248 | /** |
|
1249 | * Generate a unique nonce field for each registered meta_box |