I just should make
Method 1
$object->set('meta_key', 'post_views_count');
Method 2
$query->set( 'meta_key', 'post_views_count' );
Method 3
$vars['meta_key'] = 'post_views_count';
Related Posts:
- How can I remove the “Add New” button in my custom post type?
- Admin notice not displaying
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- manage_edit-{post_type}_sortable_columns sorts, but wrong!
- Creating a “glossary” of WordPress posts of a specific post type
- Sorting custom post types in edit.php : Post disappear
- How can I sort the order of multiple custom field values in a custom post type?
- Sort custom post column by generated value?
- Custom post type order by post_title
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- Custom order of CPT posts by title, in wp-admin area by default
- Row actions for custom post types?
- Add content in custom post type page after the title and before columns
- How do I programmatically add items of content to a custom post type?
- Filtering Posts by Multiple Taxonomy Terms such as in an Admin Post Listing?
- How to sort a table of custom posts by column containing custom field
- how to create my own edit.php admin page code or template for my custom post type
- Ajax filter with custom taxonomies
- Custom post type loops with different page templates
- How can I programmatically save data into custom fields that contain serialized data?
- Row actions not showing? Why?
- Displaying custom post type on front page
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- Remove “Get Shortlink” button in admin of custom post type
- Dynamic Custom Post Type Plugin
- How to filter out post type meta?
- Output custom post shortcode. Help spot the error.
- Blog page showing same content as homepage
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- How to rank custom post type from score points
- How do increase the amount of links shown down the left in the admin menu?
- Very Slow Page – How to Optimize # of Queries?
- Custom post type permalink returns bad url
- How to display selected taxonomies by their parent
- Custom Field Order by Last Name and First Name
- get the custom post type title/name
- Push metadata in array
- Get custom post type list for every category shortcode
- Default sort on admin columns with meta date hides draft posts with empty date value
- How do i calculate the total of values of custom fields in custom post types?
- Custom Post List View: Page or something else?
- Custom post type – get_day_link()
- Filter term taxonomy metabox in custom post type
- Use custom metabox to update automatically a post after a given date
- get_post_meta not working on publishing
- WordPress custom post type split into pages
- Assign External Database Queries to Global Variables and Make Them Accessible
- Different Category system needed for the Custom Post Type
- Specifying Mouseover Icon for Custom Post
- Hide Status Option From WordPress Publish Metabox and Rename Published on:
- Get data from PHP to JavaScript to set position of each post on front page
- Custom posts of one type have disappeared from admin. Still appear on site [closed]
- How to get the custom post list to admin user edit page?
- Removing full title and breadcrumb header container for a specific post type
- Query custom post types & Taxonomies and list them in a table on a page
- Using Pagination for Custom Post Type and keeps returning 404
- Nested Custom Taxonomies | Incorrect posts when querying
- Validate Custom Post Type fields
- meta query not retrieving posts
- How do I get the index for a custom post?
- Commas not displaying in implode
- add custom tags for custom post type in wordpress
- CPT Repeatable Fields + Undefined Index
- foreach loop inside the loop creating duplicates in output
- Custom loop request based on custom field
- Custom Post Type Causes Error: Warning: call_user_func_array()
- Is it a connection or relationship between 2 custom post types?
- Change Text in Admin Panel
- redirect after submiting post for review
- How can I put content before my custom post type default pages?
- Custom front-end form for adding post – Category problem
- get_posts() returns empty on custom post type /wp-admin/edit.php
- Get only parent post in archive post
- update custom taxonomy custom fields
- Filter taxonomy by CPT
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Tell wordpress to show a single page instead of an archive page
- Get meta values from parent post and save in child post
- sorting in wp query based on custom field value
- PHP Notice: Unidentified index
- Duplicate posts in my custom loop
- How to override post-new.php with custom template
- Include images from pages in wp search.php results in default wp search
- WordPress loop add heading before first of type
- get_post_meta for Custom Post Type ( CPT )
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- Meta box not saving
- Featured image in custom post is being disabled
- Custom Search not working
- Filtering in admin broken for custom post type in 3.8.1?
- Custom Post-type not returning the right child_of
- WordPress Set A Static Page/Template For All Sub-Pages
- Add HTML before a specific div?
- How to hide home title on pages and posts?
- Is there any way of not using my_init_method in the following code (that creates a custom post type)?
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- Custom post type is_singular condtional not working when managing sidebar display
- Issue displaying multiple TinyMCE editors with WPAlchemy