首页 WordPress函数大全 get_blog_id_from_url()

get_blog_id_from_url()

2020-05-01 / 4902阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_blog_id_from_url( string $domain, string $path = '/' )

Get a blog’s numeric ID from its URL.

描述

On a subdirectory installation like example.com/blog1/, $domain will be the root ‘example.com’ and $path the subdirectory ‘/blog1/’. With subdomains like blog1.example.com, $domain is ‘blog1.example.com’ and $path is ‘/’.

参数

$domain

(string)
(Required)

$path

(string)
(Optional)
Not required for subdomain installations.

Default value: '/'

返回

(int) 0 if no blog found, otherwise the ID of the matching blog

大家谈论
    我的见解