TradeMark & Registered Symbols in Url / Permalink — issue
-
Link indicated here is a sample of the problem now.
This link will return a error Page :
This page isn’t working https://www.allstars.com.sg redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTSSo I’m trying to remove the Trademark ? & Registered ? from the permalink.
Is there a code I can use so that all current and future Permalinks generated do not contain these characters?
I have tried the following but it doesn’t work.
Error :
Don’t Panic
The code snippet you are trying to save produced a fatal error on line 9:syntax error, unexpected ‘public’ (T_PUBLIC), expecting end of file….
<?php add_action('wp_insert_post_data', __NAMESPACE__ . 'processPermalink'); /** * Processes the permalink so we can remove any characters that may cause a problem when communicating * with the API. * * @param array $data The array of information about the post. * @return array $data The data without the malformed information in the post name for the URL. */ public function processPermalink($data) { if (!in_array($data['post_status'], array('draft', 'pending', 'auto-draft'))) { $data['post_name'] = preg_replace( '/(%ef%b8%8f|?|?|?|™|®|©|™|®|©)/', '', $data['post_name'] ); } return $data; }
The page I need help with: [log in to see the link]
- The topic ‘TradeMark & Registered Symbols in Url / Permalink — issue’ is closed to new replies.