You have the wrong values , you can’t use ←
, instead use the right encoding which in that case is ←
and also %s
for the title.
Also you only want this to run on two pages.
function back_to_site_text( $translated ) {
if ( in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) )
$translated = str_ireplace( '← Back to %s', 'Head back to My Site', $translated );
return $translated;
}
add_filter('gettext', 'back_to_site_text');
Related Posts:
- Check if page parent has certain template
- Handling Body class based on Template
- WordPress Gravatar filter is removing my custom attributes
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- How to have different site identity logos on each page on Astra Theme [closed]
- Must filter functions receive all arguments passed to them?
- Assign new post author IF another user in custom field on post transition
- Is there a hook that I can use when a fatal error occurs?
- How to make a image-size selected by default in Media upload – WP v3.5
- Apply class to every paragraph that holds image?
- Remove “Insert from URL” link in Media upload – WP 3.5
- How to change the wp-login.php page title?
- Set media upload attachment link to none and hide it in WP v3.5
- How can I hook into and edit the text of a wp_nav_menu tag?
- How to remove a metabox from menu editor page?
- add_filter to post-gallery and remove all ‘s?
- How to overwrite youtube embed?
- Rewriting search and pagination base
- Remove class that has been added by parent theme
- How do I know what variables are passed in a filter/action and what their meaning is?
- Why do filters/actions require an argument count?
- Getting my head round WordPress filter
- How To Change The Html of Products filtration sidebar in Woocommerce?
- How to set a custom path, for ajax image upload folder in admin?
- Insert all post IDs in new database table
- How to use return in my custom function instead of echo
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- Add a class to the anchor tag on HTML5 gallery
- add_action shortcut?
- Login/logout in header
- How to control WordPress image metadata (using Imagick)?
- Edit incorrect password message WordPress
- Add data attribute to each li in menu
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Removing “wpautop” (auto tags) only on certain pages?
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Why ajax doesn’t work on certain wordpress hooks?
- Print last modified date only on posts
- How to add an arrow to menu items has submenus
- Error in custom php function doesn’t exist
- Return a numerical function value in Customizer controls
- getting logged in user info (wp-load.php) from parent directory
- Unique icons next to each WordPress menu item
- Problem with login form
- Log in / Log Out Custom Button
- Add item to top of menu using a filter in functions.php
- How to make modifications only to certain elements of an HTML string on the server-side?
- Override a function defined in wp-includes/comment-template.php
- Run a code only on theme activation only during first activation
- Content filter won’t work
- Why does the post_type_link hook everything twice?
- Warning: in_array() null given in PHP function
- Upload multiple files in randomly generated folder using wp_upload_bits
- Add meta tags to a custom header
- How can I hook into the wp_mail function used by BackWPup?
- Custom query vars filters problem with pagination
- Adding function to child theme’s function.php
- Creating customized php files in theme folder
- How to pass hook variable to function?
- How to sort WooCommerce products page by latest in-stock items first?
- Filter wordpress posts without searching the keywords in the post content
- Variation prices breakdown only for single product page
- How do I add a function to parent theme
- How to remove get_header From all single pages in wordpress with functions.php without plugin?
- Apply function.php filter only if url not has /amp/
- Adding custom field to product category and show it to shop/category shop page
- Change lost password url to a mailto URL in WordPress
- Remove span tags from WooCommerce Downloads page
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- How to edit post meta data before publishing the post it self wordpress?
- Restrict wordpress access to logged users only
- Fatal error: Uncaught Error: Class ‘WP_Block_Styles_Registry’
- Custom meta box is not displaying value showing tag as empty
- using filter and hook inside class
- Discount in the specific product title using keyword ( Woocoommerce )
- Menu not updating for logged in users after redirect
- Reload page with a different shortcode when a user selects from a dropdown
- Refresh page after login with litespeed cache
- WordPress Ajax filter: Create two loops for different output styles?
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- Redirecting the lost password page request when using a custon login page
- Hook into all password resets in WordPress and get password before hashing?
- is_user_logged_in() not working in homepage
- Getting page / post URL on publish and / or update
- How to remove title tag with this filter
- Why transition_post_type hook is called twice for the same post?
- str_replace not preserving whitespace
- Woocommerce Price Text
- Limit Taxonomy Parents
- WordPress HTML Helper
- Display a post based on its metabox selection
- Search box background on a different page template
- Display a list of users with avatar filterable with alphabets
- How to add custom checkout field in user details mail template
- For each loop will not append to the_content hook
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- How to change wp-admin and wp-login urls
- How to pass value to add_filter wpcf7_form_tag from another function?
- Add text below WooCommerce short description if metabox value is true