WordPress development tutorial video, uninstall wp plugin, how to delete plugin - wordpress plugin development video tutorial 11

The software on our computer is
no longer used, and
the software will be uninstalled.

Similarly, when
we develop wordpress plugins , we
must also consider this,
that is, when users delete or uninstall our plugins, we
need to delete the relevant information of the plugins.

1. Uninstall the contents of the wordpress plugin
If you want to uninstall the plugin,
there are mainly two aspects:
1-1) Delete the wordpress plugin file
1-2) Delete the data written by the wordpress plugin to the database

The first point,
wordpress will do it for us by itself.

uninstall wordpress plugin

Let's focus on the second point...

2. Delete the plugin data in the database If you want to delete the data in the database
when uninstalling WordPress, you need to create a new unistall.php file in your plugin directory, and all the cleaning tools are done here.



1-1) Delete the data table newly created by
the plug-in If your plug-in is installed,
a data table is created in the database, which
can be deleted according to the situation.

1-2) Delete the plug-in data in the system table
If your plug-in is in use, the plug
-in data in the wp system table
should also be deleted.

This needs to be handled according to your own plugin situation.
For example, if you have plugin settings in the options table,
use delete_option($option_nae) to delete the corresponding option.

If you have relevant data in the comment table and article table, you
usually write some sql statements to delete the content of the plugin.

Snipe here ,
try watching the video " Uninstall the wordpress plugin "

The difference and connection between wordpress plugin development and wp template development - wordpress plugin development example tutorial 1
wordpress plugin development process - wordpress plugin development example tutorial 2
Add wordpress plugin menu - wordpress plugin development example tutorial 3
WordPress plugin loads other pages - WordPress plugin development example tutorial 4
Wordpress development uses the system UI that comes with wp - wordpress plug-in development example tutorial 5
Using jquery in wordpress plugins - wordpress plugin development example tutorial 6
Using wp system functions and class libraries in wordpress development - wordpress plugin development example tutorial 7
Wordpress saves custom data to wp_options table - wordpress plugin development example tutorial 8
WordPress uses get_option to get options setting options - wordpress plugin development example tutorial 9
Putting data into templates in wordpress development - wordpress plugin development example tutorial 10

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324539761&siteId=291194637