Exemplo n.º 1
0
 function test_plugin_uninstalls()
 {
     Draft_Post_Revisions::uninstall();
     $options = get_option(Draft_Post_Revisions::options_key());
     $this->assertFalse($options);
 }
Exemplo n.º 2
0
<?php

// this seems to be the preferred way to handle an uninstall
if (!defined('WP_UNINSTALL_PLUGIN')) {
    exit;
}
require_once 'core.php';
Draft_Post_Revisions::uninstall();
<?php

/*
Plugin Name: Drafts of Post Revisions
Description: Create drafts of WordPress posts/pages/CPTs even after they've been published
Version: 0.8.1
Author: daxitude
Author URI: http://github.com/daxitude/
Plugin URI: http://github.com/daxitude/wp-draft-revisions
*/
require_once 'core.php';
// register an autoloader. automatically requires files matching a class
// when the class is first used. files must start from the plugin's admin base path
// underscores in class names correspond to folder changes.
// eg DPR_Admin_Diff = draft-revisions/Admin/Diff (case sensitive)
spl_autoload_register(array('Draft_Post_Revisions', 'autoloader'));
if (is_admin()) {
    new Draft_Post_Revisions();
} else {
    // do we need to add post status on a public page?
    // probably, just in case there's a query in use with something like post_status => 'any'
    Draft_Post_Revisions::add_post_status();
}