elmanisero

link dinamico menu personalizzato

Aug 22nd, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. /**
  2. * Link menu personalizzato con lo stesso dominio
  3. * Se si vuole un menu tipo http://mydomain.com/myCustomPage
  4. * bisogna scrivere nel link %ROOT%/myCustomPage
  5. * e nell'etichetta myCustomPage
  6. */
  7. global $MYTEST;
  8. $MYTEST[] = "HEELO";
  9. add_filter('wp_nav_menu_items','apply_relative_menu_item', 10, 2);
  10. function apply_relative_menu_item($items, $args){
  11. global $MYTEST;
  12. $items = preg_replace("#http://%ROOT%#", get_bloginfo("url"), $items);
  13. $MYTEST[] = $items;
  14. return $items;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment