• Hi Mike and thanks a lot for this awesome plugin, so useful.

    I would like to remove from all anchors the apostrophes inserted in anchor URL (“rsquo”), witch is not really nice when we share URLs.

    I think that it can be done on functions.php, but i don’t know the right code (i don’t understand php language…).

    Would it be something like that to add ?

    $new_string = str_replace( "'", '', $string);

    And finally, with the code you provided in your FAQ :

    function my_custom_anchor( $anchor )
    {$new_string = str_replace( "'", '', $string);( $anchor );}
    add_filter( 'toc_url_anchor_target', 'my_custom_anchor' );

    I have tried but it is of course not the correct code/way of writing.

    Thank you very much if you have time to answer and correct me.

    https://wordpress.org/plugins/table-of-contents-plus/

  • The topic ‘How to remove apostrophes ("rsquo") from anchors URL’ is closed to new replies.