can_edit_network

The timeline below displays how wordpress function can_edit_network has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Determines whether or not this network from this page can be edited.
 *
 * By default editing of network is restricted to the Network Admin for that `$network_id`.
 * This function allows for this to be overridden.
 *
 * @since 3.1.0
 *
 * @param int $network_id The network ID to check.
 * @return bool True if network can be edited, false otherwise.
 */
function can_edit_network($network_id)
{
    if (get_current_network_id() === (int) $network_id) {
        $result = true;
    } else {
        $result = false;
    }
    /**
     * Filters whether this network can be edited from this page.
     *
     * @since 3.1.0
     *
     * @param bool $result     Whether the network can be edited from this page.
     * @param int  $network_id The network ID to check.
     */
    return apply_filters('can_edit_network', $result, $network_id);
}

WordPress Version: 5.9

/**
 * Whether or not we can edit this network from this page.
 *
 * By default editing of network is restricted to the Network Admin for that `$network_id`.
 * This function allows for this to be overridden.
 *
 * @since 3.1.0
 *
 * @param int $network_id The network ID to check.
 * @return bool True if network can be edited, otherwise false.
 */
function can_edit_network($network_id)
{
    if (get_current_network_id() === (int) $network_id) {
        $result = true;
    } else {
        $result = false;
    }
    /**
     * Filters whether this network can be edited from this page.
     *
     * @since 3.1.0
     *
     * @param bool $result     Whether the network can be edited from this page.
     * @param int  $network_id The network ID to check.
     */
    return apply_filters('can_edit_network', $result, $network_id);
}

WordPress Version: 5.4

/**
 * Whether or not we can edit this network from this page.
 *
 * By default editing of network is restricted to the Network Admin for that `$network_id`.
 * This function allows for this to be overridden.
 *
 * @since 3.1.0
 *
 * @param int $network_id The network ID to check.
 * @return bool True if network can be edited, otherwise false.
 */
function can_edit_network($network_id)
{
    if (get_current_network_id() == $network_id) {
        $result = true;
    } else {
        $result = false;
    }
    /**
     * Filters whether this network can be edited from this page.
     *
     * @since 3.1.0
     *
     * @param bool $result     Whether the network can be edited from this page.
     * @param int  $network_id The network ID to check.
     */
    return apply_filters('can_edit_network', $result, $network_id);
}

WordPress Version: 4.9

/**
 * Whether or not we can edit this network from this page.
 *
 * By default editing of network is restricted to the Network Admin for that `$network_id`.
 * This function allows for this to be overridden.
 *
 * @since 3.1.0
 *
 * @param int $network_id The network ID to check.
 * @return bool True if network can be edited, otherwise false.
 */
function can_edit_network($network_id)
{
    if ($network_id == get_current_network_id()) {
        $result = true;
    } else {
        $result = false;
    }
    /**
     * Filters whether this network can be edited from this page.
     *
     * @since 3.1.0
     *
     * @param bool $result     Whether the network can be edited from this page.
     * @param int  $network_id The network ID to check.
     */
    return apply_filters('can_edit_network', $result, $network_id);
}

WordPress Version: 4.6

/**
 * Whether or not we can edit this network from this page.
 *
 * By default editing of network is restricted to the Network Admin for that `$site_id`
 * this allows for this to be overridden.
 *
 * @since 3.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param int $site_id The network/site ID to check.
 * @return bool True if network can be edited, otherwise false.
 */
function can_edit_network($site_id)
{
    global $wpdb;
    if ($site_id == $wpdb->siteid) {
        $result = true;
    } else {
        $result = false;
    }
    /**
     * Filters whether this network can be edited from this page.
     *
     * @since 3.1.0
     *
     * @param bool $result  Whether the network can be edited from this page.
     * @param int  $site_id The network/site ID to check.
     */
    return apply_filters('can_edit_network', $result, $site_id);
}

WordPress Version: 4.4

/**
 * Whether or not we can edit this network from this page.
 *
 * By default editing of network is restricted to the Network Admin for that `$site_id`
 * this allows for this to be overridden.
 *
 * @since 3.1.0
 *
 * @global wpdb $wpdb WordPress database abstraction object.
 *
 * @param int $site_id The network/site ID to check.
 * @return bool True if network can be edited, otherwise false.
 */
function can_edit_network($site_id)
{
    global $wpdb;
    if ($site_id == $wpdb->siteid) {
        $result = true;
    } else {
        $result = false;
    }
    /**
     * Filter whether this network can be edited from this page.
     *
     * @since 3.1.0
     *
     * @param bool $result  Whether the network can be edited from this page.
     * @param int  $site_id The network/site ID to check.
     */
    return apply_filters('can_edit_network', $result, $site_id);
}

WordPress Version: 4.3

/**
 * Whether or not we can edit this network from this page.
 *
 * By default editing of network is restricted to the Network Admin for that `$site_id`
 * this allows for this to be overridden.
 *
 * @since 3.1.0
 *
 * @global wpdb $wpdb
 *
 * @param int $site_id The network/site ID to check.
 * @return bool True if network can be edited, otherwise false.
 */
function can_edit_network($site_id)
{
    global $wpdb;
    if ($site_id == $wpdb->siteid) {
        $result = true;
    } else {
        $result = false;
    }
    /**
     * Filter whether this network can be edited from this page.
     *
     * @since 3.1.0
     *
     * @param bool $result  Whether the network can be edited from this page.
     * @param int  $site_id The network/site ID to check.
     */
    return apply_filters('can_edit_network', $result, $site_id);
}

WordPress Version: 4.1

/**
 * Whether or not we can edit this network from this page.
 *
 * By default editing of network is restricted to the Network Admin for that `$site_id`
 * this allows for this to be overridden.
 *
 * @since 3.1.0
 *
 * @param int $site_id The network/site ID to check.
 * @return bool True if network can be edited, otherwise false.
 */
function can_edit_network($site_id)
{
    global $wpdb;
    if ($site_id == $wpdb->siteid) {
        $result = true;
    } else {
        $result = false;
    }
    /**
     * Filter whether this network can be edited from this page.
     *
     * @since 3.1.0
     *
     * @param bool $result  Whether the network can be edited from this page.
     * @param int  $site_id The network/site ID to check.
     */
    return apply_filters('can_edit_network', $result, $site_id);
}

WordPress Version: 3.7

/**
 * Whether or not we can edit this network from this page
 *
 * By default editing of network is restricted to the Network Admin for that site_id this allows for this to be overridden
 *
 * @since 3.1.0
 * @param integer $site_id The network/site ID to check.
 */
function can_edit_network($site_id)
{
    global $wpdb;
    if ($site_id == $wpdb->siteid) {
        $result = true;
    } else {
        $result = false;
    }
    /**
     * Filter whether this network can be edited from this page.
     *
     * @since 3.1.0
     *
     * @param bool $result  Whether the network can be edited from this page.
     * @param int  $site_id The network/site ID to check.
     */
    return apply_filters('can_edit_network', $result, $site_id);
}