wordpress 如何取消标题

发布于 2024-08-29 11:37:34 字数 173 浏览 5 评论 0原文

我仍然不明白,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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆光飞翔i 2024-09-05 11:37:34

它处理“漂亮”的 URL 并使用该数据查询数据库。当然,slugs 在创建时会被检查为唯一的。详细信息位于文件 wp-includes/rewrite.php 中的函数 url_to_postid()

如果你想直接从 slug 获取 id,你可以查询数据库:

SELECT ID
FROM wp_posts
WHERE post_name = '$slug'

你可能需要检查 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 file wp-includes/rewrite.php.

If you want to directly obtain the id from the slug you can query the database:

SELECT ID
FROM wp_posts
WHERE post_name = '$slug'

you might need to check wp_posts which is the default name, but it depends on the installation.

执着的年纪 2024-09-05 11:37:34

这只是一个猜测:

我的猜测是他们将标题存储在数据库中,并确保每个标题都是唯一的。这样,他们就可以按标题进行查找,并知道哪个项目与之相关。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文