我在wordpress admin中为自定义帖子类型创建了一个新的子菜单,我想根据我数据库中的新变量在其中添加修改后的帖子列表;wordpress 中是否有显示帖子列表的功能?还是我必须手动完成?
add_action('admin_menu', 'my_plugin_menu');
function my_plugin_menu() {
add_submenu_page( 'edit.php?post_type=product', __( 'My product list', 'zeeneo-tenders' ), __( 'My product list', 'woo-tenders' ), 'manage_options', 'my-products', 'my_plugin_options');
}
function my_plugin_options() {
if (!current_user_can('manage_options')) {
wp_die( __('You do not have sufficient permissions to access this page.') );
}
echo "<h2>" . __( 'My products list', 'zeeneo-tenders' ) . "</h2>";
// Here is the code to display the list of posts in this new panel
}