• Hi,

    I want pagination text update where it says “Items” in admin post listing page.
    I want to update it with post type name, Lets say for posts it should show posts, for posts type Testimonials it should say testimonials etc.
    Please help how it can be done.
    Target text Screenshot

    • This topic was modified 6 years, 4 months ago by dvpl.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You could use the translation functions filter “gettext” to custom “translate” item or items to any word you desire. The trick would be knowing what post type the gettext filter should use. Or for that matter, when it is appropriate to change the word at all. “item” may occur in other places besides the admin post screens.

    The solution would be to add your gettext callback from within another admin screen callback where the post type is known and you’re sure adding a gettext filter is appropriate. It might be a good idea to remove the callback after it’s no longer needed for the current screen.

    Try using “restrict_manage_posts” as the action from which to add a gettext filter. It’s completely unrelated to your task, but it fires at the right time (I think) and the post type is passed as a parameter. Untested.

    You may not even need to remove the gettext filter. Finding the right hooks for this sort of thing is a matter of tracing through code execution in source until you see likely filters or actions being applied. If the suggested action does not work, start with wp-admin/edit.php and start tracing through code looking for likely hooks. Methods for the $wp_list_table object would be most promising. The post type should be available from the global $wp_query object if it’s not otherwise available in the callback.

    Thread Starter dvpl

    (@dvpl)

    Thanks @bcworkz,
    I will try the same.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPresss Admin Post listing Pagination Text Update’ is closed to new replies.