Make WordPress Core


Ignore:
Timestamp:
08/13/2012 04:18:42 PM (14 years ago)
Author:
nacin
Message:

Hide the link manager from the UI on upgrade, if the site has no links. New DB option, link_manager_enabled.

Enforce this by denying the 'manage_links' capability, which hides the All Links, Add New Link, and Link Categories screens. Hide WP_Widget_Links and the UI for the default_link_category as well.

Convert all references to 'posts and links' when handling reassignment on user deletion to just 'posts'.

see #21307.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r21496 r21501  
    12271227            $caps[] = 'do_not_allow';
    12281228        break;
     1229    case 'manage_links' :
     1230        if ( get_option( 'link_manager_enabled' ) )
     1231            $caps[] = $cap;
     1232        else
     1233            $caps[] = 'do_not_allow';
     1234        break;
    12291235    default:
    12301236        // Handle meta capabilities for custom post types.
Note: See TracChangeset for help on using the changeset viewer.