[wp-trac] [WordPress Trac] #58616: Replace apostrophe with hyphen for slugs

WordPress Trac noreply at wordpress.org
Sun Jun 25 15:43:57 UTC 2023


#58616: Replace apostrophe with hyphen for slugs
--------------------------+------------------------------
 Reporter:  anrghg        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:
 Severity:  major         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by anrghg):

 Forgot to change the variable names to WordPress’:
 {{{#!php
 <?php
 /**
  * Converts punctuation apostrophe to hyphen-minus.
  */
 $title = str_replace(
         array(
                 '’',  // Punctuation apostrophe.
                 '\'', // ASCII apostrophe.
         ),
         '-',
         $title
 );

 /**
  * Converts letter apostrophe and ʻokina to underscore.
  */
 $title = str_replace(
         array(
                 'ʼ',  // Letter apostrophe.
                 'ʻ',  // ʻokina.
         ),
         '_',
         $title
 );
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58616#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list