WordPress.org

Plugin Directory

Changeset 594318


Ignore:
Timestamp:
09/04/12 08:31:03 (20 months ago)
Author:
nbachiyski
Message:

Sync with github

  • Add metadata
  • Add wp-cli readme convertion
Location:
liveblog/trunk
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • liveblog/trunk/liveblog.php

    r593247 r594318  
    33/** 
    44 * Plugin Name: Liveblog 
     5 * Plugin URI: http://wordpress.org/extend/plugins/liveblog/ 
    56 * Description: Blogging: at the speed of live. 
    67 * Version:     1.0-beta 
    78 * Author:      WordPress.com VIP, Automattic 
     9 * Author URI: http://vip.wordpress.com/ 
     10 * Text Domain: liveblog 
    811 */ 
    912 
     
    2124 * factory but without object inheritance or instantiation. 
    2225 * 
    23  * Things yet to be implimented: 
     26 * Things yet to be implemented: 
    2427 * 
    2528 * -- Change "Read More" to "View Liveblog" 
     
    3235    /** Constants *************************************************************/ 
    3336 
    34     const version          = 0.1; 
     37    const version          = '1.0-beta'; 
     38    const rewrites_version = 1; 
    3539    const key              = 'liveblog'; 
    3640    const url_endpoint     = 'liveblog'; 
     
    7377        if ( ! is_admin() && is_multisite() ) { 
    7478            require_once( ABSPATH . 'wp-admin/includes/ms.php' ); 
     79        } 
     80 
     81        if ( defined( 'WP_CLI' ) && WP_CLI ) { 
     82            require( dirname( __FILE__ ) . '/classes/class-wpcom-liveblog-wp-cli.php' ); 
    7583        } 
    7684    } 
     
    126134    public static function init() { 
    127135 
    128         /** 
    129          * Add a WordPress rewrite-rule enpoint. 
    130          * 
    131          * Looks like: /2012/01/01/post-name/liveblog/123456/ 
    132          * 
    133          * where 123456 is a timestamp 
    134          */ 
    135         add_rewrite_endpoint( self::url_endpoint, EP_PERMALINK ); 
     136        self::add_rewite_rules(); 
    136137 
    137138        /** 
     
    140141         */ 
    141142        add_post_type_support( 'post', self::key ); 
     143    } 
     144 
     145    public static function add_rewite_rules() { 
     146        add_rewrite_endpoint( self::url_endpoint, EP_PERMALINK ); 
     147 
     148        if ( get_option( 'liveblog_rewrites_version' ) != self::rewrites_version ) { 
     149            flush_rewrite_rules(); 
     150            update_option( 'liveblog_rewrites_version', self::rewrites_version ); 
     151        } 
     152 
    142153    } 
    143154 
Note: See TracChangeset for help on using the changeset viewer.