Unhiding the Custom Fields metabox in the WP Admin UI
As a user, I have the need to add some extra fields on my installation using custom forms of Vantage which is great. But these fields aren't currently showing in the
WP Admin UI -- you have to use the Vantage "Edit Listing" form to get access to the custom fields.
After some checking, it seems that there is currently no way to unhide the "Custom Fields Metabox" in the WordPress Admin UI without touching the core Vantage files.
To Users
For those of you who may want to make it appear on their web sites, you can do the following:
1. Go to the Vantage Theme directory under "includes/admin".
2. Edit the file listing-single.php. In line 16 (Vantage v1.2):
Code:
function va_listing_metaboxes() {
$remove_boxes = array( 'commentstatusdiv', 'commentsdiv', 'postexcerpt', 'revisionsdiv', 'postcustom', 'authordiv' );
foreach ( $remove_boxes as $id ) {
remove_meta_box( $id, VA_LISTING_PTYPE, 'normal' );
}
}
3. Just remove "
'postcustom'," (Note: Don't forget the comma). Resulting to:
Code:
function va_listing_metaboxes() {
$remove_boxes = array( 'commentstatusdiv', 'commentsdiv', 'postexcerpt', 'revisionsdiv', 'authordiv' );
foreach ( $remove_boxes as $id ) {
remove_meta_box( $id, VA_LISTING_PTYPE, 'normal' );
}
}
You'll now be able to see custom fields un the
WP Admin UI.
To The AppTheme's Vantage Team
I would like to request the Vantage Team to modify the
listing-single.php code by adding a
WP filter so that the Metaboxes can be controlled in a Vantage Child Theme.
The code would be fairly straight forward and would involve changing a single line in
listing-single.php file and could be sent out fairly quickly as a minor update.
It will be something like the one below:
Code:
function va_listing_metaboxes() {
$remove_boxes = apply_filters( 'va_listing_metaboxes',
array( 'commentstatusdiv', 'commentsdiv', 'postexcerpt', 'revisionsdiv', 'postcustom', 'authordiv' ) );
foreach ( $remove_boxes as $id ) {
remove_meta_box( $id, VA_LISTING_PTYPE, 'normal' );
}
}
Hope it can be accomodated. Thanks.