【发布时间】:2014-06-09 12:35:17
【问题描述】:
我的 wordpress 实例中有 5 个自定义字段,它们是布尔真/假值。
property_type_investment、property_type_office、property_type_rental、property_type_industrial、property_type_land
是否可以为此自定义帖子类型创建一个永久链接,以检查每个元值是否为真 - 如果是这样,将一个值附加到带连字符的 url?
示例:如果 property_type_investment、property_type_office 和 property_type_land 为真。我希望永久链接是...
/listings/investment-office-land/post-title/
这是我的注册帖子类型。
register_post_type( 'properties',
array(
'labels' => array(
'name' => 'Properties',
'singular_name' => 'Property',
'add_new' => 'Add New',
'add_new_item' => 'Add New Property',
'edit' => 'Edit',
'edit_item' => 'Edit Property',
'new_item' => 'New Property',
'view' => 'View',
'view_item' => 'View Property',
'search_items' => 'Search Properties',
'not_found' => 'No Property found',
'not_found_in_trash' => 'No Properties found in Trash',
'parent' => 'Parent Property'
),
'public' => true,
'rewrite' => array('slug'=>'listings'),
'menu_position' => 15,
'supports' => array( 'title', 'editor', 'comments', 'thumbnail', 'custom-fields' ),
'taxonomies' => array( '' ),
'has_archive' => true
)
);
【问题讨论】:
标签: wordpress custom-post-type permalinks