I wouldn’t recommending any core files.
Instead, you can filter the title and make your changes, like so:
add_filter( 'document_title_parts', function( $title ) ) {
// $title is an array of parts
if ( strlen( $title['title'] ) > 10 ) {
$title['title'] = substr( $title['title'], 0, 5 ); // Show only first 5 characters
}
return $title;
}, 10, 1 );
Related Posts:
- When is it appropriate to put functions on page template vs. functions.php?
- When to check if a function exists
- Can I change header.php of current theme through a plugin function?
- Maximum lifetime for nonce
- Customise Grouped Product display in Woocommerce with custom column
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Add function to Dokan ajax class
- Dynamic banner for use on external sites
- How do i best handle custom plugin page actions?
- Plugin Form Submission Best Practice
- Best way to abort plugin in case of insufficient PHP version?
- What do you think about custom designed plugin/theme options UIs?
- Where to put third party PHP library?
- Optimize shortcode callbacks
- How to integrate a PHP webmail script into the backend of WordPress?
- Is There A Hook To Process The Content Of The Text Widget?
- How to log plugin errors to plugin error_log file
- Which to use to execute code during the saving of a plugin settings page?
- function triggered by “manage_users_custom_column” filter not working
- WordPress plugin how to run function when button is clicked
- Shortcodes, output buffering, and WordPress functions
- Custom theme sufficient or custom plugin neccessary for this feature set?
- How to create custom home page via plugin?
- Adding callback function for wp_ajax_ has no effect
- Sessions not creating correctly in custom function
- Dynamically Override Fancy Title
- Featured Image not showing in admin
- Problem with `wp_mail()`
- Calling a function from functions.php in custom page/ blog post
- What is the difference between current_page_parent and current_page_ancestor?
- Plugin development: is adding empty index.php files necessary?
- Nuance in adding CPT and TAX to a submenu
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- Override the core function locate_template
- Widget update function not saving values
- PHP can I add line numbers to file_get_contents()
- $content variable – Is this a reserved variable for a WordPress function? – php / wordpress
- How to use WP_Term with (menu) argument in the wp_nav_menu?
- WordPress after content Hook & external template part
- override pluggable.php functions
- Disable The Events Calendar plugin from loading its scripts
- Applying OO patterns and principles to plugin development
- creating custom function to log actions in plugin
- Is it possible to change a term slug before being saved to the database?
- How to customize a permalink (URL) structure?
- Create a free scripts and styles template within a plugin
- Adding option to Gallery shortcode
- How to modify the comments to be displayed in a post?
- How can I turn a custom wordpress page into a product page?
- Incorporate small angular feature in my wordpress site
- How to Bind one post object Type with other postobject Type in Advanced Custom field [closed]
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Enqueue script globally
- WordPress class, using add_action to call member function does not work
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Update Data parameter of a wp_localize_script() call
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Add Password Generator on password protected page
- Show message from backend
- Print Dashboard submenu name and filename
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Call to undefined function is_home() or any conditional tags
- wp_schedule_event is registered but function isn’t running
- Converting core modification to a plugin
- How to replace settings in WordPress plugin from a theme
- How to remove/replace current page template?
- Remove Permalink Meta Box not working?
- Setting post_id for single.php based on URL without a redirect
- using admin functions on frontend
- Javascript Function Called Too Early in PHP Script
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- Change the behaviour of a button
- How to create a custom post-new.php page for plugin , no wp menu
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Redirection from a specific page for users logged in but not with membership
- Save meta box data from selected dropdown list in bbpress reply form
- working code, not working – Plugin Dev
- How would I correctly implement a new if statement in a child functions file?
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Create Customization panel for Plugins not for theme
- external Integration with wordpress timeout error
- foreach argument to get specific file types getting too many returns
- Implementing Select2 plugin into WordPress
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- How do I integrate my Child Theme into a Custom Template?
- Managing Custom Designed Content
- Template file structure , wordpress hook for altering the template
- How can I see a varibles value when my plugin runs?
- Can I access WordPress API’s from within plugin scripts?
- How can I add recent posts to menu like mashable
- Change the search results header from plugin
- Client Profiles
- Custom options page for themes
- Call do_action() within WordPress cronjob
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- Developing an IP lookup function using an API
- post_row_actions filter from parent theme not executing in child theme
- Add File field in WooCommerce Box office plugin
- Custom Gutenberg Block ‘Stylized List’ – Incorrect Rendering and Looping of List Items