IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
|
|
|
|
| 374 | 374 | elseif ( $id ) |
| 375 | 375 | return (int) $id; |
| 376 | 376 | |
| 377 | | $id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s and path = %s /* get_blog_id_from_url */", $domain, $path ) ); |
| | 377 | $id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s and path = %s /* get_blog_id_from_url */", $domain, $path ) ); |
| 378 | 378 | |
| 379 | 379 | if ( ! $id ) { |
| 380 | 380 | wp_cache_set( md5( $domain . $path ), -1, 'blog-id-cache' ); |
| … |
… |
|
| 1321 | 1321 | function domain_exists($domain, $path, $site_id = 1) { |
| 1322 | 1322 | global $wpdb; |
| 1323 | 1323 | $path = trailingslashit( $path ); |
| 1324 | | $result = $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s AND site_id = %d", $domain, $path, $site_id) ); |
| | 1324 | $result = (int) $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s AND site_id = %d", $domain, $path, $site_id) ); |
| 1325 | 1325 | |
| 1326 | 1326 | /** |
| 1327 | 1327 | * Filter whether a blogname is taken. |
| … |
… |
|
| 1333 | 1333 | * @param string $path Path to be checked. |
| 1334 | 1334 | * @param int $site_id Site ID. Relevant only on multi-network installs. |
| 1335 | 1335 | */ |
| 1336 | | return apply_filters( 'domain_exists', $result, $domain, $path, $site_id ); |
| | 1336 | return (int) apply_filters( 'domain_exists', $result, $domain, $path, $site_id ); |
| 1337 | 1337 | } |
| 1338 | 1338 | |
| 1339 | 1339 | /** |
| … |
… |
|
| 1863 | 1863 | $term_id = intval( $term_id ); |
| 1864 | 1864 | $c = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms WHERE term_id = %d", $term_id ) ); |
| 1865 | 1865 | |
| 1866 | | $global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE category_nicename = %s", $c->slug ) ); |
| 1867 | | if ( $global_id == null ) { |
| | 1866 | $global_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE category_nicename = %s", $c->slug ) ); |
| | 1867 | if ( $global_id === 0 ) { |
| 1868 | 1868 | $used_global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE cat_ID = %d", $c->term_id ) ); |
| 1869 | 1869 | if ( null == $used_global_id ) { |
| 1870 | 1870 | $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) ); |
| … |
… |
|
| 1878 | 1878 | $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $new_global_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) ); |
| 1879 | 1879 | $global_id = $wpdb->insert_id; |
| 1880 | 1880 | } |
| 1881 | | } elseif ( $global_id != $term_id ) { |
| | 1881 | } elseif ( $global_id !== $term_id ) { |
| 1882 | 1882 | $local_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE term_id = %d", $global_id ) ); |
| 1883 | 1883 | if ( null != $local_id ) { |
| 1884 | 1884 | global_terms( $local_id ); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
|
|
|
|
| 271 | 271 | |
| 272 | 272 | $where = get_posts_by_author_sql( $post_type, true, $userid, $public_only ); |
| 273 | 273 | |
| 274 | | $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" ); |
| | 274 | $count = (int) $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" ); |
| 275 | 275 | |
| 276 | 276 | /** |
| 277 | 277 | * Filter the number of posts a user has written. |
| … |
… |
|
| 285 | 285 | * @param string|array $post_type Single post type or array of post types to count the number of posts for. |
| 286 | 286 | * @param bool $public_only Whether to limit counted posts to public posts. |
| 287 | 287 | */ |
| 288 | | return apply_filters( 'get_usernumposts', $count, $userid, $post_type, $public_only ); |
| | 288 | return (int) apply_filters( 'get_usernumposts', $count, $userid, $post_type, $public_only ); |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
|
|
|
|
| 91 | 91 | $path = $current_site->path . $slug . '/'; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | | $blog_id = $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM {$wpdb->blogs} WHERE domain = %s AND path = %s", $domain, $path) ); |
| | 94 | $blog_id = (int) $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM {$wpdb->blogs} WHERE domain = %s AND path = %s", $domain, $path) ); |
| 95 | 95 | wp_cache_set( 'get_id_from_blogname_' . $slug, $blog_id, 'blog-details' ); |
| 96 | 96 | return $blog_id; |
| 97 | 97 | } |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
|
|
|
|
| 437 | 437 | * @param string $sql The SELECT FOUND_ROWS() query for the current WP_User_Query. |
| 438 | 438 | */ |
| 439 | 439 | if ( isset( $qv['count_total'] ) && $qv['count_total'] ) |
| 440 | | $this->total_users = $wpdb->get_var( apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()' ) ); |
| | 440 | $this->total_users = (int) $wpdb->get_var( apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()' ) ); |
| 441 | 441 | |
| 442 | 442 | if ( !$this->results ) |
| 443 | 443 | return; |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
|
|
|
|
| 3476 | 3476 | "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file' AND meta_value = %s", |
| 3477 | 3477 | $path |
| 3478 | 3478 | ); |
| 3479 | | $post_id = $wpdb->get_var( $sql ); |
| | 3479 | $post_id = (int) $wpdb->get_var( $sql ); |
| 3480 | 3480 | |
| 3481 | 3481 | /** |
| 3482 | 3482 | * Filter an attachment id found by URL. |