WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/07/2010 02:28:40 PM (9 years ago)
Author:
westi
Message:

Introduce can_edit_site to replace inline checks on whether or not the site_id is for the current Network. See #15716.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r16748 r16764  
    722722    return false;
    723723}
     724/**
     725 * Whether or not we can edit this site from this page
     726 *
     727 * By default editing of sites is restricted to the Network Admin for that site_id this allows for this to be overridden
     728 *
     729 * @since 3.1.0
     730 * @param integer $site_id The site id to check.
     731 */
     732function can_edit_site( $site_id ) {
     733    global $wpdb;
     734       
     735    if ($site_id == $wpdb->siteid )
     736        $result = true;
     737    else
     738        $result = false;
     739   
     740    return apply_filters( 'can_edit_site', $result, $site_id );
     741}
    724742?>
Note: See TracChangeset for help on using the changeset viewer.