我创建了如下自定义帖子类型:
add_action( \'init\', function() {
$args = array(
\'description\' => \'\',
\'public\' => false,
\'publicly_queryable\' => false,
\'show_ui\' => true,
\'show_in_rest\' => false,
\'rest_base\' => \'\',
\'has_archive\' => false,
\'show_in_menu\' => true,
\'exclude_from_search\' => false,
\'capability_type\' => \'post\',
\'map_meta_cap\' => true,
\'hierarchical\' => false,
\'rewrite\' => array(
\'slug\' => \'job\',
\'with_front\' => false
),
\'query_var\' => true,
\'supports\' => array(
\'title\'
),
\'label\' => \'Jobs\',
\'labels\' => array(
\'name\' => \'Jobs\',
\'singular_name\' => \'Job\',
\'menu_name\' => \'Jobs\',
\'all_items\' => \'All Jobs\',
\'add_new_item\' => \'Add New Job\',
\'new_item\' => \'New Job\',
\'edit_item\' => \'Edit Job\',
\'view_item\' => \'View Job\',
\'featured_image\' => \'Job Photo\'
),
);
register_post_type( \'job\', $args );
} );
你可以看到我有
public
和
publicly_queryable
设置为
false
.
然而,当我创建或更新一篇新文章时,它会显示“post updated.View post”,其中“View post”是指向该文章的链接。此帖子不是公开的,因此不应该有“查看帖子”链接。如何阻止它将此链接添加到更新的邮件中?