Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

wordpress menu external link open in new window

Kay Blac answered on March 7, 2023 Popularity 6/10 Helpfulness 1/10

Contents


More Related Answers

  • how to redirect from home page to custom link if not logged in in wordpress
  • wp php redirect my account page url to custom url
  • wordpress add new page programmatically
  • add custom page to wordpress
  • move wordpress site to new domain
  • add custom link in my account menu wordpress
  • custom redirect url in wordpress
  • how to change wp-admin url in wordpress without plugin
  • create a custom page and call that page wordpress
  • after i migrate wordpress website to new domain I cant login to wordpress admin
  • wordpress url only root working
  • wordpress php get menu link page id

  • wordpress menu external link open in new window

    0

    // Add checkbox to menu item settings

    add_action('wp_nav_menu_item_custom_fields', 'add_custom_nav_fields', 10, 4);

    function add_custom_nav_fields($id, $item, $depth, $args) {

    $item_target = get_post_meta($item->ID, '_menu_item_target', true);

    ?>

    />

    }

    // Save checkbox value

    add_action('wp_update_nav_menu_item', 'update_custom_nav_fields', 10, 3);

    function update_custom_nav_fields($menu_id, $menu_item_db_id, $args) {

    if (isset($_REQUEST['menu-item-target'][$menu_item_db_id])) {

    $item_target_value = $_REQUEST['menu-item-target'][$menu_item_db_id];

    update_post_meta($menu_item_db_id, '_menu_item_target', $item_target_value);

    } else {

    delete_post_meta($menu_item_db_id, '_menu_item_target');

    }

    Popularity 6/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Mar 07 2023
    Kay Blac
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.