Ejemplo n.º 1
0
 function test_version()
 {
     $this->assertEquals('2.5.1', c2c_StealthPublish::version());
 }
Ejemplo n.º 2
0
 /**
  * Register actions/filters and allow for configuration.
  *
  * @since 2.0
  * @uses apply_filters() Calls 'c2c_stealth_publish_meta_key' with default meta key name
  */
 public static function do_init()
 {
     // Load textdomain.
     load_plugin_textdomain('stealth-publish', false, basename(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'lang');
     // Deprecated as of 2.3.
     $meta_key = apply_filters('stealth_publish_meta_key', self::$meta_key);
     // Apply custom filter to obtain meta key name.
     $meta_key = esc_attr(apply_filters('c2c_stealth_publish_meta_key', $meta_key));
     // Only override the meta key name if one was specified. Otherwise the
     // default remains (since a meta key is necessary).
     if (!empty($meta_key)) {
         self::$meta_key = $meta_key;
     }
     // Register hooks
     add_filter('posts_where', array(__CLASS__, 'stealth_publish_where'), 1, 2);
     //add_action( 'pre_get_posts',               array( __CLASS__, 'exclude_stealth_posts' ), 1000 );
     add_action('post_submitbox_misc_actions', array(__CLASS__, 'add_ui'));
     add_filter('wp_insert_post_data', array(__CLASS__, 'save_stealth_publish_status'), 2, 2);
     add_action('publish_post', array(__CLASS__, 'publish_post'), 1, 1);
 }