• Resolved GSmith84

    (@gsmith84)


    Hey WordPress Pros,

    I have a client project with a heavily modified thesis running on WordPress 3.1. The wp_nav_menu is an extensive part of a multi-menu system.

    The problem I’m having is I need to add custom menu entries that will output a variable being passed via a specific rewrite. The variable is {$refid} and it works in all the theme files etc…

    However adding the custom entry I notice the curly brackets get stripped after saving the menu. I tried searching for wp_nav_menu filters so I could at the very least prevent this stripping from taking place but I wasn’t able to find anything specific.

    Any ideas for this would be welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    I think your safest alternative would be to use the WordPress Shortcode API for this. Here is a link to the documentation.
    That would allow you to use straight brackets instead of curly ones which should not be tampered with by WP or Thesis.
    LMK if this helps or if you need additional help.

    Thread Starter GSmith84

    (@gsmith84)

    I actually got it to work by using this filter…

    function myclean_url( $url, $original_url ) {
        return esc_html( $original_url );
    }
    add_filter( 'clean_url', 'myclean_url', 10, 2 );

    [Please post code snippets between backticks or use the code button.]

    Glad to know you figured it out.
    Please don’t forget to mark the thread as resolved. Thanks!
    Happy WordPressing, ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_nav_menu filter to prevent stripping characters like { }’ is closed to new replies.