I already create multiple pages for plugin activation, But I cannot delete multiple pages for Deactivation.
This is my code
function my_plugin_remove()
// the id of our page..
{
$pageid_main = get_option( 'hclpage', $valuemain );
$pageid_budget = get_option ('hclpage', $budgetvalue);
$pageid_viewbudget = get_option ('hclpage', $valueviewbudget);
wp_delete_post( $pageid_main, true ); // this will trash, not delete
wp_delete_post( $pageid_budget, true );
wp_delete_post( $pageid_viewbudget, true );
}
what is 'hclpage' option? Its only return 1 postid (the last pages i create when plugin activation), so my function only delete 1 pages, but cannot multiple pages.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire