run:R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:52
R W Run
DIR
2026-03-11 16:18:51
R W Run
DIR
2026-03-11 16:18:51
R W Run
23.8 KB
2026-03-11 16:18:51
R W Run
7.8 KB
2026-03-11 16:18:52
R W Run
36.1 KB
2026-03-11 16:18:51
R W Run
11.9 KB
2026-03-11 16:18:52
R W Run
18.94 KB
2026-03-11 16:18:52
R W Run
7.35 KB
2026-03-11 16:18:52
R W Run
28.6 KB
2026-03-11 16:18:51
R W Run
316 By
2026-03-11 16:18:51
R W Run
12.9 KB
2026-03-11 16:18:51
R W Run
61.02 KB
2026-03-11 16:18:52
R W Run
15 KB
2026-03-11 16:18:51
R W Run
112.05 KB
2026-03-11 16:18:51
R W Run
12.47 KB
2026-03-11 16:18:51
R W Run
15.07 KB
2026-03-11 16:18:52
R W Run
9.84 KB
2026-03-11 16:18:52
R W Run
13.17 KB
2026-03-11 16:18:52
R W Run
33.83 KB
2026-03-11 16:18:51
R W Run
42.63 KB
2026-03-11 16:18:51
R W Run
55.71 KB
2026-03-11 16:18:52
R W Run
12.53 KB
2026-03-11 16:18:51
R W Run
2.55 KB
2026-03-11 16:18:52
R W Run
28.92 KB
2026-03-11 16:18:52
R W Run
539 By
2026-03-11 16:18:51
R W Run
367 By
2026-03-11 16:18:52
R W Run
42.65 KB
2026-03-11 16:18:51
R W Run
401 By
2026-03-11 16:18:51
R W Run
6.61 KB
2026-03-11 16:18:51
R W Run
664 By
2026-03-11 16:18:52
R W Run
20.63 KB
2026-03-11 16:18:51
R W Run
2.18 KB
2026-03-11 16:18:52
R W Run
453 By
2026-03-11 16:18:52
R W Run
457 By
2026-03-11 16:18:51
R W Run
36.83 KB
2026-03-11 16:18:52
R W Run
2.41 KB
2026-03-11 16:18:52
R W Run
8.28 KB
2026-03-11 16:18:51
R W Run
13.89 KB
2026-03-11 16:18:51
R W Run
11.76 KB
2026-03-11 16:18:51
R W Run
2.65 KB
2026-03-11 16:18:51
R W Run
7.43 KB
2026-03-11 16:18:51
R W Run
17.46 KB
2026-03-11 16:18:51
R W Run
5.14 KB
2026-03-11 16:18:52
R W Run
16.7 KB
2026-03-11 16:18:51
R W Run
8.28 KB
2026-03-11 16:18:52
R W Run
2.92 KB
2026-03-11 16:18:52
R W Run
1.32 KB
2026-03-11 16:18:51
R W Run
4.6 KB
2026-03-11 16:18:52
R W Run
11.62 KB
2026-03-11 16:18:52
R W Run
2.5 KB
2026-03-11 16:18:51
R W Run
1.97 KB
2026-03-11 16:18:51
R W Run
11.25 KB
2026-03-11 16:18:52
R W Run
5.32 KB
2026-03-11 16:18:51
R W Run
10.99 KB
2026-03-11 16:18:52
R W Run
68.32 KB
2026-03-11 16:18:51
R W Run
6.34 KB
2026-03-11 16:18:51
R W Run
5.49 KB
2026-03-11 16:18:51
R W Run
1.99 KB
2026-03-11 16:18:52
R W Run
7.02 KB
2026-03-11 16:18:51
R W Run
4.91 KB
2026-03-11 16:18:52
R W Run
16.86 KB
2026-03-11 16:18:51
R W Run
24.23 KB
2026-03-11 16:18:51
R W Run
3.97 KB
2026-03-11 16:18:51
R W Run
47.66 KB
2026-03-11 16:18:51
R W Run
9.22 KB
2026-03-11 16:18:51
R W Run
25.51 KB
2026-03-11 16:18:51
R W Run
198.38 KB
2026-03-11 16:18:52
R W Run
56.65 KB
2026-03-11 16:18:51
R W Run
10.46 KB
2026-03-11 16:18:51
R W Run
10.95 KB
2026-03-11 16:18:52
R W Run
29.26 KB
2026-03-11 16:18:51
R W Run
70.91 KB
2026-03-11 16:18:52
R W Run
35.3 KB
2026-03-11 16:18:52
R W Run
16.61 KB
2026-03-11 16:18:52
R W Run
2.57 KB
2026-03-11 16:18:52
R W Run
39.83 KB
2026-03-11 16:18:51
R W Run
70.64 KB
2026-03-11 16:18:51
R W Run
15.56 KB
2026-03-11 16:18:52
R W Run
7.33 KB
2026-03-11 16:18:52
R W Run
253 By
2026-03-11 16:18:51
R W Run
7.96 KB
2026-03-11 16:18:52
R W Run
3.23 KB
2026-03-11 16:18:52
R W Run
969 By
2026-03-11 16:18:52
R W Run
16.28 KB
2026-03-11 16:18:51
R W Run
7.22 KB
2026-03-11 16:18:51
R W Run
12.95 KB
2026-03-11 16:18:51
R W Run
6.53 KB
2026-03-11 16:18:51
R W Run
3.42 KB
2026-03-11 16:18:52
R W Run
5.84 KB
2026-03-11 16:18:51
R W Run
1.97 KB
2026-03-11 16:18:51
R W Run
4.3 KB
2026-03-11 16:18:52
R W Run
2.91 KB
2026-03-11 16:18:51
R W Run
16.46 KB
2026-03-11 16:18:52
R W Run
40.6 KB
2026-03-11 16:18:51
R W Run
20.22 KB
2026-03-11 16:18:51
R W Run
36.11 KB
2026-03-11 16:18:52
R W Run
17.01 KB
2026-03-11 16:18:51
R W Run
7.27 KB
2026-03-11 16:18:52
R W Run
6.62 KB
2026-03-11 16:18:52
R W Run
16.49 KB
2026-03-11 16:18:52
R W Run
1.79 KB
2026-03-11 16:18:52
R W Run
29.82 KB
2026-03-11 16:18:51
R W Run
6.67 KB
2026-03-11 16:18:52
R W Run
8.98 KB
2026-03-11 16:18:52
R W Run
19.42 KB
2026-03-11 16:18:51
R W Run
12.01 KB
2026-03-11 16:18:51
R W Run
17.11 KB
2026-03-11 16:18:51
R W Run
6.74 KB
2026-03-11 16:18:52
R W Run
30.93 KB
2026-03-11 16:18:51
R W Run
4.99 KB
2026-03-11 16:18:51
R W Run
4.25 KB
2026-03-11 16:18:51
R W Run
24.72 KB
2026-03-11 16:18:51
R W Run
29.96 KB
2026-03-11 16:18:52
R W Run
6.41 KB
2026-03-11 16:18:51
R W Run
160 KB
2026-03-11 16:18:51
R W Run
6.72 KB
2026-03-11 16:18:52
R W Run
10.92 KB
2026-03-11 16:18:51
R W Run
4.77 KB
2026-03-11 16:18:51
R W Run
3.38 KB
2026-03-11 16:18:51
R W Run
11.18 KB
2026-03-11 16:18:51
R W Run
62.19 KB
2026-03-11 16:18:51
R W Run
2.46 KB
2026-03-11 16:18:51
R W Run
9.17 KB
2026-03-11 16:18:51
R W Run
32.15 KB
2026-03-11 16:18:51
R W Run
34.05 KB
2026-03-11 16:18:52
R W Run
7.15 KB
2026-03-11 16:18:51
R W Run
3.47 KB
2026-03-11 16:18:52
R W Run
1.87 KB
2026-03-11 16:18:52
R W Run
30.91 KB
2026-03-11 16:18:51
R W Run
7.29 KB
2026-03-11 16:18:52
R W Run
7.35 KB
2026-03-11 16:18:51
R W Run
12.54 KB
2026-03-11 16:18:51
R W Run
19.12 KB
2026-03-11 16:18:51
R W Run
18.12 KB
2026-03-11 16:18:52
R W Run
39.99 KB
2026-03-11 16:18:52
R W Run
5.17 KB
2026-03-11 16:18:52
R W Run
979 By
2026-03-11 16:18:51
R W Run
18.44 KB
2026-03-11 16:18:52
R W Run
10.24 KB
2026-03-11 16:18:51
R W Run
1.77 KB
2026-03-11 16:18:52
R W Run
34.9 KB
2026-03-11 16:18:51
R W Run
7.19 KB
2026-03-11 16:18:52
R W Run
160.5 KB
2026-03-11 16:18:51
R W Run
64.27 KB
2026-03-11 16:18:51
R W Run
27.95 KB
2026-03-11 16:18:51
R W Run
4.69 KB
2026-03-11 16:18:51
R W Run
2.94 KB
2026-03-11 16:18:51
R W Run
43.13 KB
2026-03-11 16:18:52
R W Run
2.25 KB
2026-03-11 16:18:52
R W Run
22.5 KB
2026-03-11 16:18:51
R W Run
13.01 KB
2026-03-11 16:18:52
R W Run
3.27 KB
2026-03-11 16:18:51
R W Run
18 KB
2026-03-11 16:18:51
R W Run
210.4 KB
2026-03-11 16:18:52
R W Run
25.86 KB
2026-03-11 16:18:52
R W Run
115.85 KB
2026-03-11 16:18:51
R W Run
373 By
2026-03-11 16:18:52
R W Run
343 By
2026-03-11 16:18:52
R W Run
338 By
2026-03-11 16:18:51
R W Run
100.73 KB
2026-03-11 16:18:52
R W Run
130.93 KB
2026-03-11 16:18:51
R W Run
19.1 KB
2026-03-11 16:18:51
R W Run
17.41 KB
2026-03-11 16:18:52
R W Run
41.98 KB
2026-03-11 16:18:52
R W Run
400 By
2026-03-11 16:18:52
R W Run
11.1 KB
2026-03-11 16:18:52
R W Run
37.02 KB
2026-03-11 16:18:51
R W Run
2.24 KB
2026-03-11 16:18:51
R W Run
188.13 KB
2026-03-11 16:18:51
R W Run
338 By
2026-03-11 16:18:51
R W Run
38 KB
2026-03-11 16:18:51
R W Run
4.02 KB
2026-03-11 16:18:52
R W Run
5.38 KB
2026-03-11 16:18:51
R W Run
3.05 KB
2026-03-11 16:18:52
R W Run
2.61 KB
2026-03-11 16:18:51
R W Run
1.16 KB
2026-03-11 16:18:52
R W Run
4.04 KB
2026-03-11 16:18:51
R W Run
3.71 KB
2026-03-11 16:18:51
R W Run
24.6 KB
2026-03-11 16:18:51
R W Run
9.56 KB
2026-03-11 16:18:51
R W Run
346.43 KB
2026-03-11 16:18:52
R W Run
281.84 KB
2026-03-11 16:18:52
R W Run
14.95 KB
2026-03-11 16:18:51
R W Run
8.44 KB
2026-03-11 16:18:52
R W Run
168.95 KB
2026-03-11 16:18:52
R W Run
20.71 KB
2026-03-11 16:18:52
R W Run
25.27 KB
2026-03-11 16:18:51
R W Run
5.72 KB
2026-03-11 16:18:51
R W Run
4.63 KB
2026-03-11 16:18:52
R W Run
81.73 KB
2026-03-11 16:18:51
R W Run
67.18 KB
2026-03-11 16:18:51
R W Run
156.36 KB
2026-03-11 16:18:52
R W Run
55.19 KB
2026-03-11 16:18:51
R W Run
162 By
2026-03-11 16:18:51
R W Run
61.72 KB
2026-03-11 16:18:51
R W Run
216.06 KB
2026-03-11 16:18:52
R W Run
65.09 KB
2026-03-11 16:18:51
R W Run
25.24 KB
2026-03-11 16:18:52
R W Run
4.81 KB
2026-03-11 16:18:51
R W Run
6.48 KB
2026-03-11 16:18:52
R W Run
21.25 KB
2026-03-11 16:18:51
R W Run
2.79 KB
2026-03-11 16:18:52
R W Run
89.69 KB
2026-03-11 16:18:52
R W Run
19.42 KB
2026-03-11 16:18:52
R W Run
3.69 KB
2026-03-11 16:18:52
R W Run
4.11 KB
2026-03-11 16:18:51
R W Run
40.74 KB
2026-03-11 16:18:51
R W Run
25.38 KB
2026-03-11 16:18:51
R W Run
43.31 KB
2026-03-11 16:18:52
R W Run
102.57 KB
2026-03-11 16:18:52
R W Run
6.18 KB
2026-03-11 16:18:51
R W Run
124.47 KB
2026-03-11 16:18:52
R W Run
35.65 KB
2026-03-11 16:18:52
R W Run
6.94 KB
2026-03-11 16:18:52
R W Run
67.04 KB
2026-03-11 16:18:52
R W Run
10.62 KB
2026-03-11 16:18:51
R W Run
289.35 KB
2026-03-11 16:18:52
R W Run
36.23 KB
2026-03-11 16:18:51
R W Run
200 By
2026-03-11 16:18:52
R W Run
200 By
2026-03-11 16:18:52
R W Run
98.29 KB
2026-03-11 16:18:52
R W Run
30.02 KB
2026-03-11 16:18:52
R W Run
19.03 KB
2026-03-11 16:18:52
R W Run
5.06 KB
2026-03-11 16:18:52
R W Run
255 By
2026-03-11 16:18:51
R W Run
22.66 KB
2026-03-11 16:18:52
R W Run
154.63 KB
2026-03-11 16:18:51
R W Run
9.68 KB
2026-03-11 16:18:51
R W Run
258 By
2026-03-11 16:18:51
R W Run
23.49 KB
2026-03-11 16:18:51
R W Run
3.16 KB
2026-03-11 16:18:51
R W Run
8.4 KB
2026-03-11 16:18:52
R W Run
441 By
2026-03-11 16:18:51
R W Run
7.39 KB
2026-03-11 16:18:51
R W Run
173 KB
2026-03-11 16:18:52
R W Run
544 By
2026-03-11 16:18:52
R W Run
4.17 KB
2026-03-11 16:18:51
R W Run
35.97 KB
2026-03-11 16:18:52
R W Run
1.69 KB
2026-03-11 16:18:51
R W Run
2.84 KB
2026-03-11 16:18:52
R W Run
6.09 KB
2026-03-11 16:18:51
R W Run
8.71 KB
2026-03-11 16:18:51
R W Run
131.84 KB
2026-03-11 16:18:51
R W Run
37.45 KB
2026-03-11 16:18:51
R W Run
173.89 KB
2026-03-11 16:18:51
R W Run
7.09 KB
2026-03-11 16:18:51
R W Run
6.41 KB
2026-03-11 16:18:51
R W Run
1.08 KB
2026-03-11 16:18:51
R W Run
69.46 KB
2026-03-11 16:18:52
R W Run
445 By
2026-03-11 16:18:51
R W Run
799 By
2026-03-11 16:18:52
R W Run
error_log
📄ms-blogs.php
1<?php
2
3/**
4 * Site/blog functions that work with the blogs table and related data.
5 *
6 * @package WordPress
7 * @subpackage Multisite
8 * @since MU (3.0.0)
9 */
10
11// Don't load directly.
12if ( ! defined( 'ABSPATH' ) ) {
13 die( '-1' );
14}
15
16require_once ABSPATH . WPINC . '/ms-site.php';
17require_once ABSPATH . WPINC . '/ms-network.php';
18
19/**
20 * Updates the last_updated field for the current site.
21 *
22 * @since MU (3.0.0)
23 */
24function wpmu_update_blogs_date() {
25 $site_id = get_current_blog_id();
26
27 update_blog_details( $site_id, array( 'last_updated' => current_time( 'mysql', true ) ) );
28 /**
29 * Fires after the blog details are updated.
30 *
31 * @since MU (3.0.0)
32 *
33 * @param int $blog_id Site ID.
34 */
35 do_action( 'wpmu_blog_updated', $site_id );
36}
37
38/**
39 * Gets a full site URL, given a site ID.
40 *
41 * @since MU (3.0.0)
42 *
43 * @param int $blog_id Site ID.
44 * @return string Full site URL if found. Empty string if not.
45 */
46function get_blogaddress_by_id( $blog_id ) {
47 $bloginfo = get_site( (int) $blog_id );
48
49 if ( empty( $bloginfo ) ) {
50 return '';
51 }
52
53 $scheme = parse_url( $bloginfo->home, PHP_URL_SCHEME );
54 $scheme = empty( $scheme ) ? 'http' : $scheme;
55
56 return esc_url( $scheme . '://' . $bloginfo->domain . $bloginfo->path );
57}
58
59/**
60 * Gets a full site URL, given a site name.
61 *
62 * @since MU (3.0.0)
63 *
64 * @param string $blogname Name of the subdomain or directory.
65 * @return string
66 */
67function get_blogaddress_by_name( $blogname ) {
68 if ( is_subdomain_install() ) {
69 if ( 'main' === $blogname ) {
70 $blogname = 'www';
71 }
72 $url = rtrim( network_home_url(), '/' );
73 if ( ! empty( $blogname ) ) {
74 $url = preg_replace( '|^([^\.]+://)|', '${1}' . $blogname . '.', $url );
75 }
76 } else {
77 $url = network_home_url( $blogname );
78 }
79 return esc_url( $url . '/' );
80}
81
82/**
83 * Retrieves a site's ID given its (subdomain or directory) slug.
84 *
85 * @since MU (3.0.0)
86 * @since 4.7.0 Converted to use `get_sites()`.
87 *
88 * @param string $slug A site's slug.
89 * @return int|null The site ID, or null if no site is found for the given slug.
90 */
91function get_id_from_blogname( $slug ) {
92 $current_network = get_network();
93 $slug = trim( $slug, '/' );
94
95 if ( is_subdomain_install() ) {
96 $domain = $slug . '.' . preg_replace( '|^www\.|', '', $current_network->domain );
97 $path = $current_network->path;
98 } else {
99 $domain = $current_network->domain;
100 $path = $current_network->path . $slug . '/';
101 }
102
103 $site_ids = get_sites(
104 array(
105 'number' => 1,
106 'fields' => 'ids',
107 'domain' => $domain,
108 'path' => $path,
109 'update_site_meta_cache' => false,
110 )
111 );
112
113 if ( empty( $site_ids ) ) {
114 return null;
115 }
116
117 return array_shift( $site_ids );
118}
119
120/**
121 * Retrieves the details for a blog from the blogs table and blog options.
122 *
123 * @since MU (3.0.0)
124 *
125 * @global wpdb $wpdb WordPress database abstraction object.
126 *
127 * @param int|string|array $fields Optional. A blog ID, a blog slug, or an array of fields to query against.
128 * Defaults to the current blog ID.
129 * @param bool $get_all Whether to retrieve all details or only the details in the blogs table.
130 * Default is true.
131 * @return WP_Site|false Blog details on success. False on failure.
132 */
133function get_blog_details( $fields = null, $get_all = true ) {
134 global $wpdb;
135
136 if ( is_array( $fields ) ) {
137 if ( isset( $fields['blog_id'] ) ) {
138 $blog_id = $fields['blog_id'];
139 } elseif ( isset( $fields['domain'] ) && isset( $fields['path'] ) ) {
140 $key = md5( $fields['domain'] . $fields['path'] );
141 $blog = wp_cache_get( $key, 'blog-lookup' );
142 if ( false !== $blog ) {
143 return $blog;
144 }
145 if ( str_starts_with( $fields['domain'], 'www.' ) ) {
146 $nowww = substr( $fields['domain'], 4 );
147 $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'] ) );
148 } else {
149 $blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $fields['domain'], $fields['path'] ) );
150 }
151 if ( $blog ) {
152 wp_cache_set( $blog->blog_id . 'short', $blog, 'blog-details' );
153 $blog_id = $blog->blog_id;
154 } else {
155 return false;
156 }
157 } elseif ( isset( $fields['domain'] ) && is_subdomain_install() ) {
158 $key = md5( $fields['domain'] );
159 $blog = wp_cache_get( $key, 'blog-lookup' );
160 if ( false !== $blog ) {
161 return $blog;
162 }
163 if ( str_starts_with( $fields['domain'], 'www.' ) ) {
164 $nowww = substr( $fields['domain'], 4 );
165 $blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) ORDER BY CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'] ) );
166 } else {
167 $blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s", $fields['domain'] ) );
168 }
169 if ( $blog ) {
170 wp_cache_set( $blog->blog_id . 'short', $blog, 'blog-details' );
171 $blog_id = $blog->blog_id;
172 } else {
173 return false;
174 }
175 } else {
176 return false;
177 }
178 } else {
179 if ( ! $fields ) {
180 $blog_id = get_current_blog_id();
181 } elseif ( ! is_numeric( $fields ) ) {
182 $blog_id = get_id_from_blogname( $fields );
183 } else {
184 $blog_id = $fields;
185 }
186 }
187
188 $blog_id = (int) $blog_id;
189
190 $all = $get_all ? '' : 'short';
191 $details = wp_cache_get( $blog_id . $all, 'blog-details' );
192
193 if ( $details ) {
194 if ( ! is_object( $details ) ) {
195 if ( -1 === $details ) {
196 return false;
197 } else {
198 // Clear old pre-serialized objects. Cache clients do better with that.
199 wp_cache_delete( $blog_id . $all, 'blog-details' );
200 unset( $details );
201 }
202 } else {
203 return $details;
204 }
205 }
206
207 // Try the other cache.
208 if ( $get_all ) {
209 $details = wp_cache_get( $blog_id . 'short', 'blog-details' );
210 } else {
211 $details = wp_cache_get( $blog_id, 'blog-details' );
212 // If short was requested and full cache is set, we can return.
213 if ( $details ) {
214 if ( ! is_object( $details ) ) {
215 if ( -1 === $details ) {
216 return false;
217 } else {
218 // Clear old pre-serialized objects. Cache clients do better with that.
219 wp_cache_delete( $blog_id, 'blog-details' );
220 unset( $details );
221 }
222 } else {
223 return $details;
224 }
225 }
226 }
227
228 if ( empty( $details ) ) {
229 $details = WP_Site::get_instance( $blog_id );
230 if ( ! $details ) {
231 // Set the full cache.
232 wp_cache_set( $blog_id, -1, 'blog-details' );
233 return false;
234 }
235 }
236
237 if ( ! $details instanceof WP_Site ) {
238 $details = new WP_Site( $details );
239 }
240
241 if ( ! $get_all ) {
242 wp_cache_set( $blog_id . $all, $details, 'blog-details' );
243 return $details;
244 }
245
246 $switched_blog = false;
247
248 if ( get_current_blog_id() !== $blog_id ) {
249 switch_to_blog( $blog_id );
250 $switched_blog = true;
251 }
252
253 $details->blogname = get_option( 'blogname' );
254 $details->siteurl = get_option( 'siteurl' );
255 $details->post_count = get_option( 'post_count' );
256 $details->home = get_option( 'home' );
257
258 if ( $switched_blog ) {
259 restore_current_blog();
260 }
261
262 /**
263 * Filters a blog's details.
264 *
265 * @since MU (3.0.0)
266 * @deprecated 4.7.0 Use {@see 'site_details'} instead.
267 *
268 * @param WP_Site $details The blog details.
269 */
270 $details = apply_filters_deprecated( 'blog_details', array( $details ), '4.7.0', 'site_details' );
271
272 wp_cache_set( $blog_id . $all, $details, 'blog-details' );
273
274 $key = md5( $details->domain . $details->path );
275 wp_cache_set( $key, $details, 'blog-lookup' );
276
277 return $details;
278}
279
280/**
281 * Clears the blog details cache.
282 *
283 * @since MU (3.0.0)
284 *
285 * @param int $blog_id Optional. Blog ID. Defaults to current blog.
286 */
287function refresh_blog_details( $blog_id = 0 ) {
288 $blog_id = (int) $blog_id;
289 if ( ! $blog_id ) {
290 $blog_id = get_current_blog_id();
291 }
292
293 clean_blog_cache( $blog_id );
294}
295
296/**
297 * Updates the details for a blog and the blogs table for a given blog ID.
298 *
299 * @since MU (3.0.0)
300 *
301 * @param int $blog_id Blog ID.
302 * @param array $details Array of details keyed by blogs table field names.
303 * @return bool True if update succeeds, false otherwise.
304 */
305function update_blog_details( $blog_id, $details = array() ) {
306 if ( empty( $details ) ) {
307 return false;
308 }
309
310 if ( is_object( $details ) ) {
311 $details = get_object_vars( $details );
312 }
313
314 $site = wp_update_site( $blog_id, $details );
315
316 if ( is_wp_error( $site ) ) {
317 return false;
318 }
319
320 return true;
321}
322
323/**
324 * Cleans the site details cache for a site.
325 *
326 * @since 4.7.4
327 *
328 * @param int $site_id Optional. Site ID. Default is the current site ID.
329 */
330function clean_site_details_cache( $site_id = 0 ) {
331 $site_id = (int) $site_id;
332 if ( ! $site_id ) {
333 $site_id = get_current_blog_id();
334 }
335
336 wp_cache_delete( $site_id, 'site-details' );
337 wp_cache_delete( $site_id, 'blog-details' );
338}
339
340/**
341 * Retrieves option value for a given blog id based on name of option.
342 *
343 * If the option does not exist or does not have a value, then the return value
344 * will be false. This is useful to check whether you need to install an option
345 * and is commonly used during installation of plugin options and to test
346 * whether upgrading is required.
347 *
348 * If the option was serialized then it will be unserialized when it is returned.
349 *
350 * @since MU (3.0.0)
351 *
352 * @param int $id A blog ID. Can be null to refer to the current blog.
353 * @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
354 * @param mixed $default_value Optional. Default value to return if the option does not exist.
355 * @return mixed Value set for the option.
356 */
357function get_blog_option( $id, $option, $default_value = false ) {
358 $id = (int) $id;
359
360 if ( empty( $id ) ) {
361 $id = get_current_blog_id();
362 }
363
364 if ( get_current_blog_id() === $id ) {
365 return get_option( $option, $default_value );
366 }
367
368 switch_to_blog( $id );
369 $value = get_option( $option, $default_value );
370 restore_current_blog();
371
372 /**
373 * Filters a blog option value.
374 *
375 * The dynamic portion of the hook name, `$option`, refers to the blog option name.
376 *
377 * @since 3.5.0
378 *
379 * @param string $value The option value.
380 * @param int $id Blog ID.
381 */
382 return apply_filters( "blog_option_{$option}", $value, $id );
383}
384
385/**
386 * Adds a new option for a given blog ID.
387 *
388 * You do not need to serialize values. If the value needs to be serialized, then
389 * it will be serialized before it is inserted into the database. Remember,
390 * resources can not be serialized or added as an option.
391 *
392 * You can create options without values and then update the values later.
393 * Existing options will not be updated and checks are performed to ensure that you
394 * aren't adding a protected WordPress option. Care should be taken to not name
395 * options the same as the ones which are protected.
396 *
397 * @since MU (3.0.0)
398 *
399 * @param int $id A blog ID. Can be null to refer to the current blog.
400 * @param string $option Name of option to add. Expected to not be SQL-escaped.
401 * @param mixed $value Option value, can be anything. Expected to not be SQL-escaped.
402 * @return bool True if the option was added, false otherwise.
403 */
404function add_blog_option( $id, $option, $value ) {
405 $id = (int) $id;
406
407 if ( empty( $id ) ) {
408 $id = get_current_blog_id();
409 }
410
411 if ( get_current_blog_id() === $id ) {
412 return add_option( $option, $value );
413 }
414
415 switch_to_blog( $id );
416 $return = add_option( $option, $value );
417 restore_current_blog();
418
419 return $return;
420}
421
422/**
423 * Removes an option by name for a given blog ID. Prevents removal of protected WordPress options.
424 *
425 * @since MU (3.0.0)
426 *
427 * @param int $id A blog ID. Can be null to refer to the current blog.
428 * @param string $option Name of option to remove. Expected to not be SQL-escaped.
429 * @return bool True if the option was deleted, false otherwise.
430 */
431function delete_blog_option( $id, $option ) {
432 $id = (int) $id;
433
434 if ( empty( $id ) ) {
435 $id = get_current_blog_id();
436 }
437
438 if ( get_current_blog_id() === $id ) {
439 return delete_option( $option );
440 }
441
442 switch_to_blog( $id );
443 $return = delete_option( $option );
444 restore_current_blog();
445
446 return $return;
447}
448
449/**
450 * Updates an option for a particular blog.
451 *
452 * @since MU (3.0.0)
453 *
454 * @param int $id The blog ID.
455 * @param string $option The option key.
456 * @param mixed $value The option value.
457 * @param mixed $deprecated Not used.
458 * @return bool True if the value was updated, false otherwise.
459 */
460function update_blog_option( $id, $option, $value, $deprecated = null ) {
461 $id = (int) $id;
462
463 if ( null !== $deprecated ) {
464 _deprecated_argument( __FUNCTION__, '3.1.0' );
465 }
466
467 if ( get_current_blog_id() === $id ) {
468 return update_option( $option, $value );
469 }
470
471 switch_to_blog( $id );
472 $return = update_option( $option, $value );
473 restore_current_blog();
474
475 return $return;
476}
477
478/**
479 * Switches the current blog.
480 *
481 * This function is useful if you need to pull posts, or other information,
482 * from other blogs. You can switch back afterwards using restore_current_blog().
483 *
484 * PHP code loaded with the originally requested site, such as code from a plugin or theme, does not switch. See #14941.
485 *
486 * @see restore_current_blog()
487 * @since MU (3.0.0)
488 *
489 * @global wpdb $wpdb WordPress database abstraction object.
490 * @global int $blog_id
491 * @global array $_wp_switched_stack
492 * @global bool $switched
493 * @global string $table_prefix The database table prefix.
494 * @global WP_Object_Cache $wp_object_cache
495 *
496 * @param int $new_blog_id The ID of the blog to switch to. Default: current blog.
497 * @param bool $deprecated Not used.
498 * @return true Always returns true.
499 */
500function switch_to_blog( $new_blog_id, $deprecated = null ) {
501 global $wpdb;
502
503 $prev_blog_id = get_current_blog_id();
504 if ( empty( $new_blog_id ) ) {
505 $new_blog_id = $prev_blog_id;
506 }
507
508 $GLOBALS['_wp_switched_stack'][] = $prev_blog_id;
509
510 /*
511 * If we're switching to the same blog id that we're on,
512 * set the right vars, do the associated actions, but skip
513 * the extra unnecessary work
514 */
515 if ( $new_blog_id === $prev_blog_id ) {
516 /**
517 * Fires when the blog is switched.
518 *
519 * @since MU (3.0.0)
520 * @since 5.4.0 The `$context` parameter was added.
521 *
522 * @param int $new_blog_id New blog ID.
523 * @param int $prev_blog_id Previous blog ID.
524 * @param string $context Additional context. Accepts 'switch' when called from switch_to_blog()
525 * or 'restore' when called from restore_current_blog().
526 */
527 do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );
528
529 $GLOBALS['switched'] = true;
530
531 return true;
532 }
533
534 $wpdb->set_blog_id( $new_blog_id );
535 $GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
536 $GLOBALS['blog_id'] = $new_blog_id;
537
538 if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
539 wp_cache_switch_to_blog( $new_blog_id );
540 } else {
541 global $wp_object_cache;
542
543 if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) {
544 $global_groups = $wp_object_cache->global_groups;
545 } else {
546 $global_groups = false;
547 }
548
549 wp_cache_init();
550
551 if ( function_exists( 'wp_cache_add_global_groups' ) ) {
552 if ( is_array( $global_groups ) ) {
553 wp_cache_add_global_groups( $global_groups );
554 } else {
555 wp_cache_add_global_groups(
556 array(
557 'blog-details',
558 'blog-id-cache',
559 'blog-lookup',
560 'blog_meta',
561 'global-posts',
562 'image_editor',
563 'networks',
564 'network-queries',
565 'sites',
566 'site-details',
567 'site-options',
568 'site-queries',
569 'site-transient',
570 'theme_files',
571 'rss',
572 'users',
573 'user-queries',
574 'user_meta',
575 'useremail',
576 'userlogins',
577 'userslugs',
578 )
579 );
580 }
581
582 wp_cache_add_non_persistent_groups( array( 'counts', 'plugins', 'theme_json' ) );
583 }
584 }
585
586 /** This filter is documented in wp-includes/ms-blogs.php */
587 do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );
588
589 $GLOBALS['switched'] = true;
590
591 return true;
592}
593
594/**
595 * Restores the current blog, after calling switch_to_blog().
596 *
597 * @see switch_to_blog()
598 * @since MU (3.0.0)
599 *
600 * @global wpdb $wpdb WordPress database abstraction object.
601 * @global array $_wp_switched_stack
602 * @global int $blog_id
603 * @global bool $switched
604 * @global string $table_prefix The database table prefix.
605 * @global WP_Object_Cache $wp_object_cache
606 *
607 * @return bool True on success, false if we're already on the current blog.
608 */
609function restore_current_blog() {
610 global $wpdb;
611
612 if ( empty( $GLOBALS['_wp_switched_stack'] ) ) {
613 return false;
614 }
615
616 $new_blog_id = array_pop( $GLOBALS['_wp_switched_stack'] );
617 $prev_blog_id = get_current_blog_id();
618
619 if ( $new_blog_id === $prev_blog_id ) {
620 /** This filter is documented in wp-includes/ms-blogs.php */
621 do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' );
622
623 // If we still have items in the switched stack, consider ourselves still 'switched'.
624 $GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );
625
626 return true;
627 }
628
629 $wpdb->set_blog_id( $new_blog_id );
630 $GLOBALS['blog_id'] = $new_blog_id;
631 $GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
632
633 if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
634 wp_cache_switch_to_blog( $new_blog_id );
635 } else {
636 global $wp_object_cache;
637
638 if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) {
639 $global_groups = $wp_object_cache->global_groups;
640 } else {
641 $global_groups = false;
642 }
643
644 wp_cache_init();
645
646 if ( function_exists( 'wp_cache_add_global_groups' ) ) {
647 if ( is_array( $global_groups ) ) {
648 wp_cache_add_global_groups( $global_groups );
649 } else {
650 wp_cache_add_global_groups(
651 array(
652 'blog-details',
653 'blog-id-cache',
654 'blog-lookup',
655 'blog_meta',
656 'global-posts',
657 'image_editor',
658 'networks',
659 'network-queries',
660 'sites',
661 'site-details',
662 'site-options',
663 'site-queries',
664 'site-transient',
665 'theme_files',
666 'rss',
667 'users',
668 'user-queries',
669 'user_meta',
670 'useremail',
671 'userlogins',
672 'userslugs',
673 )
674 );
675 }
676
677 wp_cache_add_non_persistent_groups( array( 'counts', 'plugins', 'theme_json' ) );
678 }
679 }
680
681 /** This filter is documented in wp-includes/ms-blogs.php */
682 do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' );
683
684 // If we still have items in the switched stack, consider ourselves still 'switched'.
685 $GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );
686
687 return true;
688}
689
690/**
691 * Switches the initialized roles and current user capabilities to another site.
692 *
693 * @since 4.9.0
694 *
695 * @param int $new_site_id New site ID.
696 * @param int $old_site_id Old site ID.
697 */
698function wp_switch_roles_and_user( $new_site_id, $old_site_id ) {
699 if ( $new_site_id === $old_site_id ) {
700 return;
701 }
702
703 if ( ! did_action( 'init' ) ) {
704 return;
705 }
706
707 wp_roles()->for_site( $new_site_id );
708 wp_get_current_user()->for_site( $new_site_id );
709}
710
711/**
712 * Determines if switch_to_blog() is in effect.
713 *
714 * @since 3.5.0
715 *
716 * @global array $_wp_switched_stack
717 *
718 * @return bool True if switched, false otherwise.
719 */
720function ms_is_switched() {
721 return ! empty( $GLOBALS['_wp_switched_stack'] );
722}
723
724/**
725 * Checks if a particular blog is archived.
726 *
727 * @since MU (3.0.0)
728 *
729 * @param int $id Blog ID.
730 * @return string Whether the blog is archived or not.
731 */
732function is_archived( $id ) {
733 return get_blog_status( $id, 'archived' );
734}
735
736/**
737 * Updates the 'archived' status of a particular blog.
738 *
739 * @since MU (3.0.0)
740 *
741 * @param int $id Blog ID.
742 * @param string $archived The new status.
743 * @return string $archived
744 */
745function update_archived( $id, $archived ) {
746 update_blog_status( $id, 'archived', $archived );
747 return $archived;
748}
749
750/**
751 * Updates a blog details field.
752 *
753 * @since MU (3.0.0)
754 * @since 5.1.0 Use wp_update_site() internally.
755 *
756 * @global wpdb $wpdb WordPress database abstraction object.
757 *
758 * @param int $blog_id Blog ID.
759 * @param string $pref Field name.
760 * @param string $value Field value.
761 * @param null $deprecated Not used.
762 * @return string|false $value
763 */
764function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
765 global $wpdb;
766
767 if ( null !== $deprecated ) {
768 _deprecated_argument( __FUNCTION__, '3.1.0' );
769 }
770
771 $allowed_field_names = array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );
772
773 if ( ! in_array( $pref, $allowed_field_names, true ) ) {
774 return $value;
775 }
776
777 $result = wp_update_site(
778 $blog_id,
779 array(
780 $pref => $value,
781 )
782 );
783
784 if ( is_wp_error( $result ) ) {
785 return false;
786 }
787
788 return $value;
789}
790
791/**
792 * Gets a blog details field.
793 *
794 * @since MU (3.0.0)
795 *
796 * @global wpdb $wpdb WordPress database abstraction object.
797 *
798 * @param int $id Blog ID.
799 * @param string $pref Field name.
800 * @return bool|string|null $value
801 */
802function get_blog_status( $id, $pref ) {
803 global $wpdb;
804
805 $details = get_site( $id );
806 if ( $details ) {
807 return $details->$pref;
808 }
809
810 return $wpdb->get_var( $wpdb->prepare( "SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d", $pref, $id ) );
811}
812
813/**
814 * Gets a list of most recently updated blogs.
815 *
816 * @since MU (3.0.0)
817 *
818 * @global wpdb $wpdb WordPress database abstraction object.
819 *
820 * @param mixed $deprecated Not used.
821 * @param int $start Optional. Number of blogs to offset the query. Used to build LIMIT clause.
822 * Can be used for pagination. Default 0.
823 * @param int $quantity Optional. The maximum number of blogs to retrieve. Default 40.
824 * @return array The list of blogs.
825 */
826function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) {
827 global $wpdb;
828
829 if ( ! empty( $deprecated ) ) {
830 _deprecated_argument( __FUNCTION__, 'MU' ); // Never used.
831 }
832
833 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 );
834}
835
836/**
837 * Handler for updating the site's last updated date when a post is published or
838 * an already published post is changed.
839 *
840 * @since 3.3.0
841 *
842 * @param string $new_status The new post status.
843 * @param string $old_status The old post status.
844 * @param WP_Post $post Post object.
845 */
846function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {
847 $post_type_obj = get_post_type_object( $post->post_type );
848 if ( ! $post_type_obj || ! $post_type_obj->public ) {
849 return;
850 }
851
852 if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
853 return;
854 }
855
856 // Post was freshly published, published post was saved, or published post was unpublished.
857
858 wpmu_update_blogs_date();
859}
860
861/**
862 * Handler for updating the current site's last updated date when a published
863 * post is deleted.
864 *
865 * @since 3.4.0
866 *
867 * @param int $post_id Post ID
868 */
869function _update_blog_date_on_post_delete( $post_id ) {
870 $post = get_post( $post_id );
871
872 $post_type_obj = get_post_type_object( $post->post_type );
873 if ( ! $post_type_obj || ! $post_type_obj->public ) {
874 return;
875 }
876
877 if ( 'publish' !== $post->post_status ) {
878 return;
879 }
880
881 wpmu_update_blogs_date();
882}
883
884/**
885 * Handler for updating the current site's posts count when a post is deleted.
886 *
887 * @since 4.0.0
888 * @since 6.2.0 Added the `$post` parameter.
889 *
890 * @param int $post_id Post ID.
891 * @param WP_Post $post Post object.
892 */
893function _update_posts_count_on_delete( $post_id, $post ) {
894 if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
895 return;
896 }
897
898 update_posts_count();
899}
900
901/**
902 * Handler for updating the current site's posts count when a post status changes.
903 *
904 * @since 4.0.0
905 * @since 4.9.0 Added the `$post` parameter.
906 *
907 * @param string $new_status The status the post is changing to.
908 * @param string $old_status The status the post is changing from.
909 * @param WP_Post $post Post object
910 */
911function _update_posts_count_on_transition_post_status( $new_status, $old_status, $post = null ) {
912 if ( $new_status === $old_status ) {
913 return;
914 }
915
916 if ( 'post' !== get_post_type( $post ) ) {
917 return;
918 }
919
920 if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
921 return;
922 }
923
924 update_posts_count();
925}
926
927/**
928 * Counts number of sites grouped by site status.
929 *
930 * @since 5.3.0
931 *
932 * @param int $network_id Optional. The network to get counts for. Default is the current network ID.
933 * @return int[] {
934 * Numbers of sites grouped by site status.
935 *
936 * @type int $all The total number of sites.
937 * @type int $public The number of public sites.
938 * @type int $archived The number of archived sites.
939 * @type int $mature The number of mature sites.
940 * @type int $spam The number of spam sites.
941 * @type int $deleted The number of deleted sites.
942 * }
943 */
944function wp_count_sites( $network_id = null ) {
945 if ( empty( $network_id ) ) {
946 $network_id = get_current_network_id();
947 }
948
949 $counts = array();
950 $args = array(
951 'network_id' => $network_id,
952 'number' => 1,
953 'fields' => 'ids',
954 'no_found_rows' => false,
955 );
956
957 $q = new WP_Site_Query( $args );
958 $counts['all'] = $q->found_sites;
959
960 $_args = $args;
961 $statuses = array( 'public', 'archived', 'mature', 'spam', 'deleted' );
962
963 foreach ( $statuses as $status ) {
964 $_args = $args;
965 $_args[ $status ] = 1;
966
967 $q = new WP_Site_Query( $_args );
968 $counts[ $status ] = $q->found_sites;
969 }
970
971 return $counts;
972}
973
Ui Ux Design – Teachers Night Out https://cardgames4educators.com Wed, 16 Oct 2024 22:24:18 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://cardgames4educators.com/wp-content/uploads/2024/06/cropped-Card-4-Educators-logo-32x32.png Ui Ux Design – Teachers Night Out https://cardgames4educators.com 32 32 Masters In English How English Speaker https://cardgames4educators.com/masters-in-english-how-english-speaker/ https://cardgames4educators.com/masters-in-english-how-english-speaker/#comments Mon, 27 May 2024 08:54:45 +0000 https://themexriver.com/wp/kadu/?p=1

Erat himenaeos neque id sagittis massa. Hac suscipit pulvinar dignissim platea magnis eu. Don tellus a pharetra inceptos efficitur dui pulvinar. Feugiat facilisis penatibus pulvinar nunc dictumst donec odio platea habitasse. Lacus porta dolor purus elit ante bibendum tortor netus taciti nullam cubilia. Erat per suspendisse placerat morbi egestas pulvinar bibendum sollicitudin nec. Euismod cubilia eleifend velit himenaeos sodales lectus. Leo maximus cras ac porttitor aliquam torquent pulvinar odio volutpat parturient. Quisque risus finibus suspendisse mus purus magnis facilisi condimentum consectetur dui. Curae elit suspendisse cursus vehicula.

Turpis taciti class non vel pretium quis pulvinar tempor lobortis nunc. Libero phasellus parturient sapien volutpat malesuada ornare. Cubilia dignissim sollicitudin rhoncus lacinia maximus. Cras lorem fermentum bibendum pellentesque nisl etiam ligula enim cubilia. Vulputate pede sapien torquent montes tempus malesuada in mattis dis turpis vitae. Porta est tempor ex eget feugiat vulputate ipsum. Justo nec iaculis habitant diam arcu fermentum.

We offer comprehen sive emplo ment services such as assistance wit employer compliance.Our company is your strategic HR partner as instead of HR. john smithson

Cubilia dignissim sollicitudin rhoncus lacinia maximus. Cras lorem fermentum bibendum pellentesque nisl etiam ligula enim cubilia. Vulputate pede sapien torquent montes tempus malesuada in mattis dis turpis vitae.

Exploring Learning Landscapes in Academic

Feugiat facilisis penatibus pulvinar nunc dictumst donec odio platea habitasse. Lacus porta dolor purus elit ante bibendum tortor netus taciti nullam cubilia. Erat per suspendisse placerat morbi egestas pulvinar bibendum sollicitudin nec. Euismod cubilia eleifend velit himenaeos sodales lectus. Leo maximus cras ac porttitor aliquam torquent.

]]>
https://cardgames4educators.com/masters-in-english-how-english-speaker/feed/ 1