WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/13/2012 04:18:42 PM (8 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-admin/includes/upgrade.php

    r21500 r21501  
    400400        upgrade_340();
    401401
     402    if ( $wp_current_db_version < 21501 )
     403        upgrade_350();
     404
    402405    maybe_disable_automattic_widgets();
    403406
     
    11801183        }
    11811184    }
     1185}
     1186
     1187/**
     1188 * Execute changes made in WordPress 3.5.
     1189 *
     1190 * @since 3.5.0
     1191 */
     1192function upgrade_350() {
     1193    global $wp_current_db_version, $wpdb;
     1194
     1195    if ( $wp_current_db_version < 21501 && $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) )
     1196        update_option( 'link_manager_enabled', 1 ); // Previously set to 0 by populate_options()
    11821197}
    11831198
Note: See TracChangeset for help on using the changeset viewer.