WordPress.org

Ready to get started?Download WordPress

Forums

Add Twitter, Facebook Like, Google plus one Social share
Plugin deactivation deletes optio (3 posts)

  1. robanna
    Member
    Posted 2 years ago #

    I have a request.
    Right now, when the plugin is deactivated you have set delete_option('twitter_facebook_share');

    Could you change that so that the delete_option only happens with the unistall hook? Every time I upgrade or deactivate the plugin for other reasons you have to go back in and change the options again.

    Thanks-
    robanna

    http://wordpress.org/extend/plugins/twitter-facebook-google-plusone-share/

  2. robanna
    Member
    Posted 2 years ago #

    I think this is all that is needed:

    /* Runs when plugin is activated */
    register_activation_hook(__FILE__,'kc_twitter_facebook_install');

    /* Runs on plugin deactivation*/
    register_deactivation_hook( __FILE__, 'kc_twitter_facebook_remove' );

    /* Runs on plugin uninstall*/
    register_uninstall_hook( __FILE__, 'kc_twitter_facebook_uninstall' );

    function kc_twitter_facebook_install() {
    /* Do Nothing */
    }

    function kc_twitter_facebook_remove() {
    /* Do Nothing */
    }

    function kc_twitter_facebook_uninstall() {
    /* Deletes the database field */
    delete_option('twitter_facebook_share');
    }

  3. BeingMaverick
    Member
    Plugin Author

    Posted 2 years ago #

    Point noted. Will add to the next release. Thanks a lot for contributing.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic