Added uninstall.php file#4
Conversation
|
|
||
| /* If uninstall not called from WordPress, then exit. */ | ||
| if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { | ||
| wp_die( sprintf( __( '%s should only be called when uninstalling the plugin.', 'wdp-plugin' ), '<code>' . __FILE__ . '</code>' ) ); |
There was a problem hiding this comment.
@coder-karen I am not sure the text domain is correct here?
There was a problem hiding this comment.
You’re right it isn’t. I’ll submit a new commit to this pull request with an updated file.
|
|
||
|
|
||
| /* Deleting FFPW widget option row in database */ | ||
| delete_option('widget_FFPW_Flexible_Featured_Post'); |
There was a problem hiding this comment.
This (delete_option) removes the row in the wp_options table of the database with the name of ‘widget_ffpw_flexible_featured_post’. This option was remaining in the database after deactivation and deletion of the plugin.
| /* Deleting post meta data added by plugin */ | ||
| function delete_ffpw_meta() { | ||
|
|
||
| global $wpdb; |
There was a problem hiding this comment.
@coder-karen is there a need to globalise this variable as it doesn't look as though it is used?
There was a problem hiding this comment.
Good question - since it isn’t actually needed to delete the post meta, there doesn’t seem to be a point in keeping it. In the wp-includes/post.php file delete_post_meta calls delete_metadata, which uses the global $wpdb variable, but it is defined in that file. So I will remove it here.
Added uninstall.php to make sure database is cleaned up after deactivating and deleting plugin.