Support » Plugin: Responsive Menu - Create Mobile-Friendly Menu » hooks to change menu entries texts

  • Resolved jaimevives

    (@jaimevives)


    Are there hooks to change the entries texts via functions.php? I’ve some special characters that I want to get ride of.

    For example, I got ride of them on the breadcrumbs with this code:

    add_filter( ‘woocommerce_get_breadcrumb’, ‘change_breadcrumb’ );
    function change_breadcrumb( $crumbs ) {
    $new_crumbs=array();
    foreach ( $crumbs as $key => $crumb ) {
    $new_crumbs[]=str_replace( ‘|’, ‘ ‘, $crumb );
    }
    return $new_crumbs;
    }

    Is there something similar I can do to replace them on the responsive menu?

    Thanks…

Viewing 4 replies - 1 through 4 (of 4 total)
  • Peter Featherstone

    (@peterfeatherstone-1)

    Hey there,

    There are built in filters already for WordPress for changing the output of menu items.

    Have you tried these already?

    Please advise

    Peter

    Thread Starter jaimevives

    (@jaimevives)

    Thanks for the ultrafast response!

    No, I’m a WP newbie and didn’t figure out that… of course this should work, as your plugin just takes its input from the wordpress menu.

    I will try that and come back to report the solution just in case another “Responsive Menu” user comes looking for it.

    Thanks again,


    Jaime

    Thread Starter jaimevives

    (@jaimevives)

    Just using “the_title” was enough:

    function change_menu_titles($title){
    $title=str_replace( ‘|’, ‘ ‘, $title );
    return $title;
    }
    add_filter( ‘the_title’, ‘change_menu_titles’ );

    Thanks again for the pointer…


    Jaime

    Peter Featherstone

    (@peterfeatherstone-1)

    Hey Jaime,

    Excellent work! Glad you were able to work it out without too much trouble 🙂

    Peter

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘hooks to change menu entries texts’ is closed to new replies.