wordpress: wp_delete_post in uninstall.php doesn't delete my custom posts -


Hi :) I am working on my first plugin .. I have registered my custom post types, its meta box And its classification .. Everything works fine except that when I uninstall the plugin, then uninstall my. Function in the EPP does not remove the post.

Here my uninstall.php

  // If the uninstallation is not called from WordPress, then exit (define (' WP_UNINSTALL_PLUGIN ')) {exit; } Global $ wpdb; // Delete all custom post types $ posts = get_posts (array ('numberposts' =>, 'post_type' = & gt; 'my-custom-post', // $ post_type 'post_status' = & Gt; any ')); Foreign Currency ($ post as $ post) {wp_delete_post ($ post-> ID, true); }  

I have seen everywhere - even inside other plugins - and it seems that this is the right way to do it ... someone can tell me why this does not work is? Or even if there is any other way?

from codecs,

register_uninstall_hook uninstallers Hook registers that is said to be the user who clicks on the uninstall link which asks for the plugin to uninstall itself.

  register_uninstall_hook ($ file, $ callback)  


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -