Maybe you can add a higher priority to your filter as the 3rd parameter of the hook:
/**
* Modify the data
*
* @param String $data
*
* @return String $data
*/
function change_title( $data ) {
global $post;
return 'Page ID ' . $data;
}
add_filter( 'the_title', 'change_title', 15 );
The default priority is 10 so it could be that a later filter is overwriting what you have.
Related Posts:
- Why doesn’t this function work when I know that the IP Address is “true”?
- How to change dynamically page title according to variable data?
- Add PHP code after title in single post pages?
- Remove Site Name from wp_title WITHOUT removing from attribute
- Modify WordPress Page Title ()
- get_the_archive_title hook unwanted changes!
- wordpress filtering out caps in wp_title? (UpperCase is changed to Uppercase)
- The title of an attachment is not working
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- How to add a custom CSS class to core blocks in Gutenberg editor?
- Filter translations (gettext strings) on specific admin pages
- Is it possible to use object in add_action?
- Filter hook before create order WooCommerce
- How to auto-translate custom user roles?
- Adding revision support to WooCommerce product content
- add_filter for specific pages
- How to add attribute to output with wp_video_shortcode add_filter
- Remove WPML’s home_url filter
- Change default settings used by gallery shortcode
- PHP5, Inheritance, Singleton – action & filter hook limitations
- Please explain me what the do_action does
- How Can I Have A URL Changed Based on the Originating URL?
- Add ‘if exists’ to filter
- how to remove filter from wordpress shortcode output
- Change email from and display name with a filter action
- How to check if “media_send_to_editor” is audio?
- Changing Order of Filters
- Please help me through this example with a filter to understand how they work
- Filter custom post types in archive
- WordPress tag cloud add more links
- How can I filter block registration based on post-type? (Block alignment settings)
- wp_insert_post_data filter not working correctly after upgrade to WordPress 5
- Modify site URL via functions.php of a theme
- Yoast SEO hooks overriding themselves
- Passing variable from child theme to parent theme
- Question about how do wordpress filters/actions work
- How to center oEmbedded content
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- Add Sortable Column For All Post Types
- How to take options from form fields and turn them in to links?
- When to use add_action when registering/enqueuing scripts
- How add a group by to the query used by the media library?
- How to properly modify WP Vary or any existing headers?
- How to remove medium size class in gravity form for input tag?
- Custom wp_query time filter on meta_value
- Filter Hook callback error, is it due to using $this inside a filter or something else?
- get post id within add_filter()
- How To Override A WooCommerce AJAX Function
- Can I override the content array using the_posts filter?
- Modify page title and subtitle with a plugin
- Media upload default title from file name
- Admin post list – adding an option to the date filter dropdown
- Use of comment_reply_link_args filter
- How to use do_shortcode_tag to modify the output of a shortcode?
- Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
- Changing the argument of a function
- Alter existing page contents based on url
- Error using wp_mail inside custom function
- How to include add_filter() in a condition based on $post data
- Admin: how to make a custom list filter button send GET queryvars
- Modifying WP_Title For Custom Post Type
- custom gallery filter with image caption as link title?
- Is this hook really deprecated? ( manage_{$taxonomy}_custom_column )
- arguments for comment_notification_text filter
- Add_filter rel=”prettyphoto” to WP3.4.1
- How can i filter wordpress users by custom feild?
- The gettext hook doesnt work on text with links
- How to filter the source URL of all images on every page
- How to redirect a unique link based on login status
- “The editor has encountered an unexpected error” After add defer tag to java script
- Create different flavours of excerpt
- Is it possible to assign a css id to a row in plugins list table?
- How to bridge the gap between dynamic back-end data and front-end output?
- How to loop year & month condition together to filter correctly via AJAX?
- add_action with associative array
- Why does wp_die() not work when inside a namespace?
- Apply pre_get_posts filter in a certain moment (just for a particular block of posts)
- Modify oembed code conditionally
- Set post featured image to author image
- How to Change the WordPress Locale with the ‘locale’ Filter?
- meta box loop problem with a search filter
- Modify Default URL for /wp-includes/js/wp-emoji.js?ver=4.6.1
- Read More in the actual excerpt
- wp_editor customization
- posts_results filter function memory errors
- Is it possible to include the add_filter() function within a shortcode function
- Activate short codes for all post queries?
- Save something to global var in add_filter
- Loading a sidebar on an Ajax call
- the_excerpt() does not work with has_excerpt()?
- filter on the_content stopped working when I updated to WP 3.6.1
- Replace Paid Shipping Method With Free Shipping Method WooCommerce [duplicate]
- Wrapping Featured Image on Add/Edit Page in div?
- Clean/filter HTML inserted to post content by XML RPC
- how to localize the number of wordpress post views?
- Is it possible to make get variable out of filter in Class?
- How do you disable the verification process of user email changes?
- Can you call a filter hook by “add_action”?
- Why isn’t this add_filter function working as expected?