Created
July 13, 2013 00:15
-
-
Save getsource/5988793 to your computer and use it in GitHub Desktop.
Test plugin for https://github.com/wp-cli/wp-cli/pull/592
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Bad Plugin | |
Plugin URI: http://github.com/wp-cli/wp-cli | |
Description: Creates a difficult to search-replace option | |
Author: Mike Schroder | |
Version: 0.1 | |
Author URI: http://www.getsource.net/ | |
*/ | |
add_action( 'init', 'gs_add_bogus_option' ); | |
function gs_add_bogus_option() { | |
update_option( 'gs_bad_option', serialize( GS_WP_Private_Singleton::get_instance() ) ); | |
} | |
class GS_WP_Private_Singleton { | |
protected static $instance; | |
public $stuff = "I am a string"; | |
public $things = "I have the things"; | |
private function __construct() { | |
return 1; | |
} | |
public static function get_instance() { | |
if ( !self::$instance ) { | |
self::$instance = new GS_WP_Private_Singleton(); | |
} | |
return self::$instance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment