site_by_path_segments_count

过滤钩子
apply_filters( 'site_by_path_segments_count', $segments, $domain, $path )
参数
  • (int|null) $segments The number of path segments to consider. WordPress by default looks at one path segment following the network path. The function default of null only makes sense when you know the requested path should match a site.
    Required:
  • (string) $domain The requested domain.
    Required:
  • (string) $path The requested path, in full.
    Required:
定义位置
相关勾子
network_by_path_segments_countsite_health_tab_contentsite_icon_attachment_metadatasite_allowed_themessite_health_navigation_tabs
相关方法
update_posts_countget_attachment_iconget_site_by_pathget_user_counttranslate_with_gettext_contextget_attachment_icon_src
引入
3.9.0
弃用
-

site_by_path_segments_count过滤器。site_by_path_segments_count过滤器是一个WordPress过滤器,它允许修改用于确定多站点网络中一个站点的URL的段数。这个过滤器可以用来改变URL中使用的段数,例如,在URL中包括子目录。

过滤搜索网站时要考虑的路径段的数量。

$segments = apply_filters( 'site_by_path_segments_count', $segments, $domain, $path );

常见问题

FAQs
查看更多 >