There is, unfortunately, no “pretty” way to do this (i.e. without using string replacing or rewriting a big chunck of functionality). So, resorting to preg_replace
…
We’ll need to filter the links, and it’s good to see that you’ve already found the proper filters! Looping through the views and using a regular expression, we can remove the element containing the post count. Implementing this for posts, you’ll need something like this:
add_filter( 'views_edit-post', 'wpse149143_edit_posts_views' );
function wpse149143_edit_posts_views( $views ) {
foreach ( $views as $index => $view ) {
$views[ $index ] = preg_replace( '/ <span class="count">\([0-9]+\)<\/span>/', '', $view );
}
return $views;
}
Related Posts:
- Increasing post view count automatically [duplicate]
- Get total views of all posts by author
- C++ – how to find the length of an integer
- How can I make a PHP counter?
- Counting the posts of a loop (WP_Query)?
- Category and children post count
- How to display 2 equal columns of li based on the count of items in wp_nav_menu divided by 2?
- Show weekly posts statistic in WordPress
- Count number of posts by author in a category
- How we count the user draft posts
- Double count view in archive.php
- What is the best way to count and display the number of posts?
- How can I count post views of REST API calls and update them in an ACF field?
- Get count of terms with a post and another taxonomy term?
- How can I get global $post to work for CPT and update user?
- Get Gravity Forms field values and count how many? [closed]
- Counting posts in custom post type by author
- Show ellipsis (…) only if the number of characters exceeds limit defined in substr
- Post Views / Hit Counter Problem?
- Count post views in loop
- Count post + add number =
- How to do simple addition to increase favorites count of my wordpress posts
- Count posts published in one particular day: the lighter way
- What is the best way to do this? [closed]
- Search Count WordPress Theme
- How to read out the excerpt length (for if-condition)
- $count_posts->draft & published
- Count the total views of all user posts published
- Author.php Page views counter
- CountPost WordPress Custom Taxonomy
- get the count of table rows
- How to calculate posts number? [closed]
- How make animation increase of number
- Having problems getting the number of plays in a WordPress Playlist from an audio file
- How to show the amount of post that have on the site?
- Counting the number of elements with the values of x in a vector
- How can I count the occurrences of a list item?
- Attempt to present UIViewController on UIViewController whose view is not in the window hierarchy
- Count how many files in directory PHP
- select * from table where column = something or, when unavailable, column = something else
- Creating a custom MCE view for your shortcodes [closed]
- Count posts that have specific taxonomy term attached
- Popular posts by view with Jetpack
- Count singular post views automatically
- User Published Post Count
- How to use global post counter in the loop?
- Show that current post is number X out of X
- Counting pageviews on high-traffic cached sites
- Change post category based on latest posts views
- How to get the number of child categories a specific parent category has?
- How to add “time” data this?
- get_queried_object error How to show post count by month in the taxonomy page
- wp_count_posts, wp_count_terms and wp_count_comments for specific user?
- How to count custom post types with conditional operators
- Count posts with specific term_meta
- How to count rows of table in the_content()
- Display posts count in front of the tag, for each tag
- How to improve post views count display?
- User’s total comment count excluding comments on their own posts
- Post count by month of taxonmy term
- custom post type category count shortcode
- Counting posts with argument without retrieving the posts
- Show posts count for Categories and Tags in wp_nav_menu
- How to add category post count in main navigation menu [closed]
- How to show the number of website visitors in my theme
- Show the amount of posts in a tag in a specific category has
- How can I count ACF sub_field with a certain value
- How do I insert a after every 5 posts in a WordPress Loop that infinitely loads posts?
- Get Author Count By Day, Week and Month
- How to count other posts not having specific taxonomy terms?
- counting trackbacks, pingbacks and comments of a post
- Divide post content in three columns
- How to Define Custom Number of Items in Comment Feed
- Order terms by count – missing terms
- count the number of views of a post excluding own views
- Count user posts and store the number for later use
- How include comment and post count of user in this custom query
- How to reset post views count
- Allow a specific user role I have created to only upload one image to his media library
- Author post count in category
- get_queried_object not work in taxonomy page
- Show post count in custom taxonomy page
- How can i show post views using specified post ID?
- How Can I add show_post_count in get_archives_link?
- Modify the category post counting function
- Implementation to count page visits of unique visitors based on a cookie
- Add subcategories posts to the counts column at the admin’s categories list
- count_posts to a standalone link
- How can I make post view count editable? [closed]
- divide custom field values in div every two values
- How to mark every 3rd post
- How to add a post counter to the list of custom taxonomy terms?
- how to localize the number of wordpress post views?
- How to limit the number of posts a user can publish based on user type
- How to add together (get the sum) a field from all author’s posts
- Counting number of identical meta keys
- How do I count the number of pages a user has seen on my site, and force them to log in after a certain amount
- Display post count on archive page in reverse order
- How to add portfolio category post count in main navigation menu?
- How do i display the number of images on the “post screen”