WordPress.org

Plugin Directory

Changeset 608991


Ignore:
Timestamp:
10/06/12 23:40:30 (19 months ago)
Author:
ericlewis
Message:

add activation hook for flushing rewrites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chat-room/trunk/chat-room.php

    r608989 r608991  
    33Plugin Name: Chat Room 
    44Plugin URI: http://webdevstudios.com/support/wordpress-plugins/ 
    5 Description: Create chat rooms within your site for logged-in users to interact in. 
     5Description: Chat Room for WordPress 
    66Author: WebDevStudios.com 
    7 Version: 0.1.1 
     7Version: 0.1 
    88Author URI: http://webdevstudios.com/ 
    99License: GPLv2 or later 
     
    1212Class Chatroom { 
    1313    function __construct() { 
     14        register_activation_hook( __FILE__, array( $this, 'activation_hook' ) ); 
     15        register_deactivation_hook( __FILE__, array( $this, 'deactivation_hook' ) ); 
    1416        add_action( 'init', array( $this, 'register_post_types' ) ); 
    1517        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 
     
    1921        add_action( 'wp_ajax_send_message', array( $this, 'ajax_send_message_handler' ) ); 
    2022        add_filter( 'the_content', array( $this, 'the_content_filter' ) ); 
     23    } 
     24 
     25    function activation_hook() { 
     26        $this->register_post_types(); 
     27        flush_rewrite_rules(); 
     28    } 
     29 
     30    function deactivation_hook() { 
     31        flush_rewrite_rules(); 
    2132    } 
    2233 
     
    209220 
    210221$chatroom = new Chatroom(); 
    211  
    212  
    213  
Note: See TracChangeset for help on using the changeset viewer.