Making WordPress.org

Changeset 162


Ignore:
Timestamp:
12/20/2013 04:39:03 PM (11 years ago)
Author:
iandunn
Message:

WordCamp Calendar: Refactor into generic API plugin. Fixes #256.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-api
Files:
2 added
1 deleted
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-api/classes/ics.php

    r161 r162  
    11<?php
    2 /*
    3  * Plugin Name: WordCamp.org Calendar
    4  * PLugin Description: Returns an .ical calendar on the calendar.ical endpoint.
    5  */
    62
    7 class WordCamp_Calendar_Plugin {
     3class WordCamp_API_ICS {
    84    public $ttl = 1; // seconds to live
    95
     
    9894    }
    9995}
    100 
    101 // Go!
    102 new WordCamp_Calendar_Plugin;
    103 
    104 /**
    105  * Activation and deactivation routines.
    106  */
    107 function wcorg_calendar_plugin_activate() {
    108     global $wp_rewrite;
    109     add_rewrite_rule( '^calendar\.ics$', 'index.php?wcorg_wordcamps_ical=1', 'top' );
    110     flush_rewrite_rules();
    111 }
    112 register_activation_hook( __FILE__, 'wcorg_calendar_plugin_activate' );
    113 
    114 function wcorg_calendar_plugin_deactivate() {
    115     flush_rewrite_rules(); // Doesn't really remove the created rule.
    116     delete_option( 'wcorg_wordcamps_ical' );
    117 }
    118 register_deactivation_hook( __FILE__, 'wcorg_calendar_plugin_deactivate' );
Note: See TracChangeset for help on using the changeset viewer.