0

I'm looking for how hide or remove Link Relationship (XFN) from Menus tab (In red on the picture below)

enter image description here

  • On the top right of the menu screen you can find Screen Options where you can hide it – Wilco Nov 21 '17 at 11:58
  • Thanks. But i want it to be permenant for all users with out go to the top screen each time a new users is created. – sampaii Nov 21 '17 at 21:58
0

I did some research and I don't think there are options to remove these "advanced screen options". You can however remove the entire screen options tab . If you really want to remove just that option you should be able to do it with css or jquery to hide/remove the options.

jQuery solution

place the following in your functions.php

function abc_load_scripts_on_admin() {

    $screen = get_current_screen();

    if( $screen->ID == 'nav-menus' ) {

        wp_enqueue_script( 'abc_remove_xfn', get_stylesheet_directory_uri(). '/remove_xfn.js' );
    }
}
add_action( 'admin_enqueue_scripts', 'abc_load_scripts_on_admin' );

create a file in your theme with the name remove_xfn.js.

Add the following jQuery to newly created file

jQuery( document ).ready( function() {

   jQuery( '#xfn-hide' ).parent().remove();
   jQuery( '.field-xfn' ).remove();
});

this removes both the xfn option in the screen settings and the actual setting for each menu item if its somehow turned on.

I also found the plugin Adminize wich might do what you want but I haven't tried it yet.

0

In Menu Section On Top Bar Screen Option, there is Option to Hide or Show Link Relationship Tab. Please Check Below Screenshot

  • Thanks. But i want it to be permenant for all users without go to the top screen each time a new users is created. – sampaii Nov 21 '17 at 21:58
0

You can hide field using jquery, put below code into your functions.php file. Also, You can hide other field using the same function to modification some changes.

function customize_nav_menu_screen_option() { 
?>
<script>
    jQuery( document ).ready( function() {

   jQuery( '#xfn-hide' ).parent().remove();
   jQuery( '.field-xfn' ).remove();
});
</script>
<?php
}
add_action( 'admin_footer','customize_nav_menu_screen_option' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.