【发布时间】:2014-11-05 18:33:46
【问题描述】:
我是 wordpress 插件开发的新手。
我想创建一个插件。插件的功能是
# 它会捕获像 www.example.com/custom_post_type/param1/parm2/parm3 这样的 url
param1,param2,param3 是传递给 custom_post_type 的参数。
# 我需要捕获这些参数并想与数据库进行相应的通信我想显示页面内容。
我不知道我是否应该使用custom_post_type。(因为我会使用自制的表格来检查参数)
请给我建议。
【问题讨论】:
-
您能否添加代码来说明您拥有的东西、您想去的地方的示例以及您在实现该目标时遇到的问题的任何详细信息?
-
我创建了自定义帖子类型函数 create_post_type() { register_post_type( 'rent', array( 'labels' => array( 'name' => __( 'rent' ), 'singular_name' => __( 'rent' ) ), 'public' => true, 'menu_position' => 2, 'rewrite' => true, //'supports' => array('title', 'editor', 'thumbnail') ));我创建了一篇名为 car 的帖子,它将给出永久链接:localhost.wordpress.com/rent/car 我希望 /car/ 参数是动态的,
-
如果我使用自定义帖子类型,我可以使用自定义表查询数据库吗?
标签: wordpress custom-url