wordpress 如何取消标题
我仍然不明白,wordpress 如何理解这个网址指的是什么: www.mysite.com/about-me/
如果他们使用 slug 函数,那么他们就不会使用任何标识符,
因此他们如何保留故事信息,或者换句话说,他们如何更改回 slug 标题以从数据库中进行选择
i still , don't understand , how wordpress can understand what is this url refer to :
www.mysite.com/about-me/
they are using no identifier
if they using slug functions so how they can retain story information or in other word , how they change back the slugged title to select from database
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它处理“漂亮”的 URL 并使用该数据查询数据库。当然,slugs 在创建时会被检查为唯一的。详细信息位于文件
wp-includes/rewrite.php
中的函数url_to_postid()
。如果你想直接从 slug 获取 id,你可以查询数据库:
你可能需要检查
wp_posts
这是默认名称,但这取决于安装。It processes the "pretty" URL and queries the database with that data. Of course slugs are checked to be unique on creation. Details are in the function
url_to_postid()
in the filewp-includes/rewrite.php
.If you want to directly obtain the id from the slug you can query the database:
you might need to check
wp_posts
which is the default name, but it depends on the installation.这只是一个猜测:
我的猜测是他们将标题存储在数据库中,并确保每个标题都是唯一的。这样,他们就可以按标题进行查找,并知道哪个项目与之相关。
This is just a guess:
My guess is that they store the titles in a database, and make sure every title is unique. That way, they can do a look-up by title and know which item is coupled to that.