最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

site url - URL parsing - what is it?

programmeradmin0浏览0评论

I am reading the conversation about WP_USE_THEMES and I don't understand the term 'URL parsing'.

Can someone please explain that to me in the context of Wordpress ?

Google didn't produce significant results.

I am reading the conversation about WP_USE_THEMES and I don't understand the term 'URL parsing'.

Can someone please explain that to me in the context of Wordpress ?

Google didn't produce significant results.

Share Improve this question asked Sep 12, 2019 at 14:13 Rebecca JohnsonRebecca Johnson 111 bronze badge 1
  • Welcome to WordPress Development. I hope you find the answer(s) you are looking for. Our site is different from most - if you have not done so yet, consider checking out the tour and help center to find out how things work. – Matthew Brown aka Lord Matt Commented Sep 12, 2019 at 18:20
Add a comment  | 

1 Answer 1

Reset to default 4

Parsing means to analyze (a string or text) into logical syntactic components.

Taking WordPress URLs into the question is something like this:

// Get array of URL 'scheme', 'host', and 'path'.
$url_parse = wp_parse_url( 'https://developer.wordpress/reference/functions/wp_parse_url/' );

// Output URL's path.
echo $url_parse['path'];

/*
Array
(
    [scheme] => https
    [host] => developer.wordpress
    [path] => /reference/functions/wp_parse_url/
)
*/

Another way to consider is in your WP settings. It breaks it down too:

https://www.example.coom/2019/09/12/sample-post/ is the same as

%scheme%//:%host%/%year%/%monthnum%/%day%/%postname%/

There are other uses for this too. In using the Wordpress API you'll need to know parts of the url (endpoint, version, etc).

Parsing is breaking the url down so you know what the parts are when you're working with it.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论