I just realized that there was a typo in the code. The meta-tag should read ‘prod_hierar’ instead of ‘prod-hier’. This fixes the issue. (Too much experimenting, I guess ..).
Function ‘wms_hierarchy_col_orderby()‘ thus becomes:
function wms_hierarchy_col_orderby( $vars ) {
if ( isset( $vars['orderby'] ) && 'prod_hierar' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'meta_key' => 'prod_hierar',
'orderby' => 'meta_value'
) );
}
return $vars;
}
Related Posts:
- custom field in admin columns
- Add filter menu to admin list of posts (of custom type) to filter posts by custom field values
- How to filter post listing (in WP dashboard posts listing) using a custom field (search functionality)?
- Filter post listing by meta value which is a date
- Adding Custom Field to Taxonomy Input :Panel
- How to prevent custom fields from being cleared during a bulk edit?
- Custom bulk action for media gallery items
- Add custom column to custom post type overview in backend
- How to show custom field’s value under post/page title in wp-admin
- Add More Fields to Users Pages (Admin Panel)
- Admin meta Image Path
- How make a custom search on backend in WordPress without plugin?
- Custom Fields box in the post editor: Replace textareas with input elements
- Client PDF Upload (Catalogue) – Automatically update link to PDF
- Button inside Custom Meta Box triggering the Update Button
- I need a “Choose from existing content” popin
- Hide custom column in admin template screen (Elementor) [closed]
- WordPress Media Uploader custom Javascript not working
- WordPress colorpicker save both hex and RGB
- Add custom column for custom field
- Jquery on custom-field backend
- Search & column order by meta value in admin
- WordPress admin area: select box with 12.000+ options
- Link fields in User Admin list
- Save custom post data outside of default post form
- Decouple page name from page title
- How can I display only the post titles from a selected category in columns?
- Can’t sort custom column on user.php by number / meta_value_num?
- How to order a Custom Fields in admin panel
- How to automatically create a custom field when a post is published?
- custom field with links
- Shortcode not picking up custom field
- add multiple values (array) to post meta_input
- Order by a meta field in query loop
- Assign class to Drop Down Selections in WooCommerce Products Custom Fields
- Grouped Custom Meta Fields without plugin
- How to display search query as formatted text?
- Problem display
- Google not index my Custom 404 page ?why?
- Dynamic background image used in css after selector
- Show/Hide Featured Image or replace it with custom field [closed]
- How to create a searchable database with a single-field search box at the front end? [closed]
- Tons of Custom Fields [closed]
- How can i put a custom field inside this php
- Add custom fields to specific menus
- Custom Fields after update to WordPress 6
- Custom fields: Split data from single custom field’s sub-array to separate custom fields when saving post
- How can I copy value from dropdown once I select it to text area as text?
- Dynamically update Custom Fields to display new dates
- Site uses wpdb to fetch meta_keys but just displays first meta_key from a page (the post uses the same meta_key “filmmaker” more than once)
- How to get all specific fields from one ACF Group?
- How to apply Local Business Google Schema dynamically on a Custom Post single template?
- Create taxonomy terms from custom field values
- Add fields to edit in custom widget
- Save Custom Meta Value on Media Upload
- Archive for custom fields?
- Truncating characters in Advanced Custom Fields works some places but not others?
- Set new url from custom post field
- How to make donation button dynamic on chariti theme [closed]
- Add CSS class to posts with certain meta key
- Is there a way to read JSON data inside Custom Fields without editing PHP? [closed]
- save all acf options in one meta_value [closed]
- Conditional display based on ACF checkbox
- How to add new Metadata options (Date, Author, etc.) for Posts?
- WP Query Args – search by meta_key or title
- acf field repeater link don’t work
- Can running a WP-Cron to update_post_meta cause performance issues?
- custom field value is blank or empty
- Saving multiple custom meta box fields
- How to add an ACF only for parent term?
- How to add a custom field to the comments “Quick Edit” screen?
- Match submitted array fields with the MYSQL database fields to update them correctly in PHP
- Multiple triggers when publishing, saving or updating a post in WordPress
- If possible a field ID transfom in a Custom Field?
- Best way for managing images of ads banners
- Crop custom image size vs actual size
- ACF in radio button cf7
- Modal pop-up HTML code works on other sites or HTML viewers but not in the custom HTML block within a wordpress page?
- Set post status to draft after validating post meta values in save_post hook
- Automatically changing a posts status to draft based on magic fields [closed]
- Multiple permalinks for a single post from custom field
- Search for meta_query does not return any result if combined with title
- get Custom field label (select/dropdown) on front end
- get_the_ID() retrieves same ID on Gutenberg’s Query Loop
- How to display WordPress Twenty Twenty-Four’s built-in custom field in a post (or page)?
- How to conditionally display an ACF custom textarea contents only to those users chosen from an ACF User field
- Can I count every article following extracted meta value?
- Adding the numerical values from a custom field from all posts in a category
- Why the value of the selector doesnt remain visible in the custom field after I edit the post?
- How to hide a field on the frontend of a Buddypress page by field ID according to user roles and login status?
- Custom fields – get_post_meta giving null
- Custom fields empty after refreshing page
- I have design Tab in a Bootstrap 5 in row. And repeat row in ACF. only 1st row tab data is show. other row data off tabcontent appearing display:none
- Populate Elementor Form based on first selection
- Best Practice for storing aggregate data by date or other criteria?
- Custom post type needs to capability to create and edit by some specific user role
- Skip un-set meta fields (“Invalid field: fieldname”) when using `wp post list` and displaying custom fields
- Adding amount to cart when input field is filled
- SQL query based on two different custom field values
- Conditionally get ACF field in WordPress nav walker based on parent menu item?