Making WordPress.org

Changeset 2898


Ignore:
Timestamp:
04/05/2016 04:05:02 PM (10 years ago)
Author:
kovshenin
Message:

WordCamp.org: Reintegrate application-tracking branch into trunk.

Location:
sites/trunk/wordcamp.org
Files:
21 edited
4 copied

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org

    • Property svn:mergeinfo set to
      /sites/branches/application-tracking/wordcamp.org2783-2897
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-json-api.php

    r2358 r2898  
    11<?php
    2 
    32/*
    43 * Customizations to the JSON REST API
     
    2322// Allow some routes to skip the JSON REST API v1 plugin.
    2423add_action( 'parse_request', 'wcorg_json_v2_compat', 9 );
     24
     25// Allow users to read new post statuses.
     26add_filter( 'json_check_post_read_permission', 'wcorg_json_check_post_read_permission', 10, 2 );
    2527
    2628/**
     
    372374        return;
    373375}
     376
     377function wcorg_json_check_post_read_permission( $permission, $post ) {
     378        if ( $permission || ! defined( 'WCPT_POST_TYPE_ID' ) ) {
     379                return $permission;
     380        }
     381
     382        if ( $post['post_type'] != WCPT_POST_TYPE_ID ) {
     383                return $permission;
     384        }
     385
     386        return in_array( $post['post_status'], WordCamp_Loader::get_public_post_statuses() );
     387}
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-admin.php

    r171 r2898  
    8585         */
    8686        function admin_head () {
    87 ?>
     87                ?>
     88
    8889                <style type="text/css" media="screen">
    89                 /*<![CDATA[*/
    90 <?php
    91                         // Add extra actions to WordCamp Post Type admin header area
    92                         do_action( 'wcpt_admin_head' );
    93 ?>
     90                        /*<![CDATA[*/
     91                        <?php
     92                                // Add extra actions to WordCamp Post Type admin header area
     93                                do_action( 'wcpt_admin_head' );
     94                        ?>
     95                        /*]]>*/
     96                </style>
    9497
    95                 /*]]>*/
    96                 </style>
    97 <?php
     98                <?php
    9899        }
    99100
     
    125126                        return false;
    126127
    127 ?>
    128                 <h3><?php _e( 'WordCamps', 'wcpt' ); ?></h3>
    129                 <table class="form-table">
    130                         <tr valign="top">
    131                                 <th scope="row"><?php _e( 'WordCamps', 'wcpt' ); ?></th>
    132                                 <td>
     128                ?>
     129                        <h3><?php _e( 'WordCamps', 'wcpt' ); ?></h3>
    133130
    134                                 </td>
    135                         </tr>
    136                 </table>
    137 <?php
     131                        <table class="form-table">
     132                                <tr valign="top">
     133                                        <th scope="row"><?php _e( 'WordCamps', 'wcpt' ); ?></th>
     134                                        <td>
     135
     136                                        </td>
     137                                </tr>
     138                        </table>
     139                <?php
    138140
    139141                // Add extra actions to WordCamp Post Type profile update
     
    171173                // Loop through menu order and do some rearranging
    172174                foreach ( $menu_order as $index => $item ) {
    173 
    174175                        // Current item is our forum CPT, so set our separator here
    175176                        if ( ( ( 'edit.php?post_type=' . WCPT_POST_TYPE_ID ) == $item ) ) {
     
    181182                        if ( !in_array( $item, array( 'separator-wcpt' ) ) )
    182183                                $wcpt_menu_order[] = $item;
    183 
    184184                }
    185185
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-functions.php

    r171 r2898  
    4444 */
    4545function wcpt_has_access () {
    46 
    4746        if ( is_super_admin () )
    4847                $has_access = true;
     
    8685}
    8786
    88 ?>
     87/**
     88 * Render the Log metabox
     89 *
     90 * @param WP_Post $post
     91 */
     92function wcpt_log_metabox( $post ) {
     93        $entries = wcpt_get_log_entries( $post->ID );
     94
     95        require_once( __DIR__ . '/views/common/metabox-log.php' );
     96}
     97
     98/**
     99 * Get all the the entries
     100 *
     101 * @param int $wordcamp_id
     102 *
     103 * @return array
     104 */
     105function wcpt_get_log_entries( $wordcamp_id ) {
     106        $entries        = array();
     107        $notes          = get_post_meta( $wordcamp_id, '_note'          );
     108        $status_changes = get_post_meta( $wordcamp_id, '_status_change' );
     109
     110        foreach ( array( 'note' => $notes, 'status_change' => $status_changes ) as $entry_type => $raw_entries ) {
     111                foreach ( $raw_entries as $entry ) {
     112                        $user = get_user_by( 'id', $entry['user_id'] );
     113
     114                        $entry['type']              = $entry_type;
     115                        $entry['user_display_name'] = $user->display_name;
     116
     117                        $entries[] = $entry;
     118                }
     119        }
     120
     121        usort( $entries, 'wcpt_sort_log_entries' );
     122
     123        return $entries;
     124}
     125
     126/**
     127 * Sort the log entries in reverse-chronological order
     128 *
     129 * @param array $a
     130 * @param array $b
     131 *
     132 * @return int
     133 */
     134function wcpt_sort_log_entries( $a, $b ) {
     135        // If a status change and a note occur at the same time, show the change before the note
     136        if ( $a['timestamp'] == $b['timestamp'] ) {
     137                return ( 'status_change' == $a['type'] ) ? 1 : -1;
     138        }
     139
     140        return ( $a['timestamp'] > $b['timestamp'] ) ? -1 : 1;
     141}
     142
     143/**
     144 * Render the Notes metabox
     145 *
     146 * @param WP_Post $post
     147 */
     148function wcpt_add_note_metabox( $post ) {
     149        wp_nonce_field( 'wcpt_notes', 'wcpt_notes_nonce' );
     150
     151        require_once( __DIR__ . '/views/common/metabox-notes.php' );
     152}
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-loader.php

    r171 r2898  
    1515 */
    1616define( 'WCPT_VERSION', '0.1' );
     17define( 'WCPT_DIR', plugin_dir_path( __FILE__ ) );
     18define( 'WCPT_URL', plugins_url( '/', __FILE__ ) );
    1719
    1820if ( !class_exists( 'WCPT_Loader' ) ) :
     
    3032         * The main WordCamp Post Type loader
    3133         */
    32         function wcpt_loader () {
    33                 /** COMPONENT HOOKS ***************************************************/
     34        function __construct() {
     35                add_action( 'plugins_loaded', array( $this, 'core_admin' ) );
     36                add_action( 'init', array( $this, 'core_text_domain' ) );
    3437
    35                 // Attach the wcpt_loaded action to the WordPress plugins_loaded action.
    36                 add_action( 'plugins_loaded',   array ( $this, 'component_loaded' ) );
    37 
    38                 // Attach the wcpt_init to the WordPress init action.
    39                 add_action( 'init',             array ( $this, 'component_init' ) );
    40 
    41                 // Attach constants to wcpt_loaded.
    42                 add_action( 'wcpt_loaded',      array ( $this, 'component_constants' ) );
    43 
    44                 // Attach includes to wcpt_loaded.
    45                 add_action( 'wcpt_loaded',      array ( $this, 'component_includes' ) );
    46 
    47                 // Attach post type registration to wcpt_init.
    48                 add_action( 'wcpt_init',        array ( $this, 'component_post_types' ) );
    49 
    50                 // Attach tag registration wcpt_init.
    51                 add_action( 'wcpt_init',        array ( $this, 'component_taxonomies' ) );
    52 
    53                 /** CORE HOOKS ********************************************************/
    54 
    55                 // Core Constants
    56                 add_action( 'wcpt_started',     array ( $this, 'core_constants' ) );
    57 
    58                 // Core Includes
    59                 add_action( 'wcpt_started',     array ( $this, 'core_includes' ) );
    60 
    61                 // Core Admin
    62                 add_action( 'wcpt_loaded',      array ( $this, 'core_admin' ) );
    63 
    64                 // Attach theme directory wcpt_loaded.
    65                 add_action( 'wcpt_loaded',      array ( $this, 'core_theme_directory' ) );
    66 
    67                 // Attach textdomain to wcpt_init.
    68                 add_action( 'wcpt_init',        array ( $this, 'core_text_domain' ) );
    69 
    70                 // Register WordCamp Post Type activation sequence
    71                 register_activation_hook( __FILE__,   array( $this, 'activation' ) );
    72 
    73                 // Register WordCamp Post Type deactivation sequence
    74                 register_deactivation_hook( __FILE__, array( $this, 'deactivation' ) );
    75 
    76                 // Get this party started
    77                 do_action( 'wcpt_started' );           
     38                $this->includes();
    7839        }
    7940
    8041        /**
    81          * core_constants ()
    82          *
    83          * WordCamp Core Constants
    84          */
    85         function core_constants () {
    86                 // Turn debugging on/off
    87                 if ( !defined( 'WCPT_DEBUG' ) )
    88                         define( 'WCPT_DEBUG', WP_DEBUG );
    89 
    90                 // Default slug for post type
    91                 if ( !defined( 'WCPT_THEMES_DIR' ) )
    92                         define( 'WCPT_THEMES_DIR', apply_filters( 'wcpt_themes_dir', WP_PLUGIN_DIR . '/wcpt-themes' ) );
    93 
    94                 // WordCamp Post Type root directory
    95                 define( 'WCPT_DIR', WP_PLUGIN_DIR . '/wcpt' );
    96                 define( 'WCPT_URL', plugins_url( $path = '/wcpt' ) );
    97 
    98                 // Images URL
    99                 define( 'WCPT_IMAGES_URL', WCPT_URL . '/wcpt-images' );
    100         }
    101 
    102         /**
    103          * core_includes ()
    104          *
    10542         * WordCamp Core File Includes
    10643         */
    107         function core_includes () {
     44        function includes() {
    10845                // Load the files
    109                 require_once ( WCPT_DIR . '/wcpt-functions.php' );
    110                 require_once ( WCPT_DIR . '/wcpt-wordcamp/wordcamp-loader.php' );
     46                require_once ( WCPT_DIR . 'wcpt-functions.php' );
     47                require_once ( WCPT_DIR . 'wcpt-wordcamp/wordcamp-loader.php' );
     48                require_once ( WCPT_DIR . 'applications/common.php' );
     49                require_once ( WCPT_DIR . 'applications/tracker.php' );
     50                require_once ( WCPT_DIR . 'applications/wordcamp.php' );
     51
    11152                // Require admin files.
    11253                if ( is_admin() ) {
    113                         require_once ( WCPT_DIR . '/wcpt-admin.php' );
    114                         require_once ( WCPT_DIR . '/wcpt-wordcamp/wordcamp-admin.php' );
     54                        require_once ( WCPT_DIR . 'wcpt-admin.php' );
     55                        require_once ( WCPT_DIR . 'wcpt-wordcamp/wordcamp-admin.php' );
    11556                }
    11657        }
    11758
    118         function core_admin () {
     59        function core_admin() {
    11960                // Quick admin check
    12061                if ( !is_admin() )
     
    12263
    12364                // Create admin
    124                 $GLOBALS['wcpt_admin']      = new WCPT_Admin();
    125                 $GLOBALS['wordcamp_admin']  = new WordCamp_Admin();
     65                $GLOBALS['wcpt_admin'] = new WCPT_Admin;
     66                $GLOBALS['wordcamp_admin'] = new WordCamp_Admin;
    12667        }
    12768
     
    13172         * Load the translation file for current language
    13273         */
    133         function core_text_domain () {
     74        function core_text_domain() {
    13475                $locale = apply_filters( 'wcpt_textdomain', get_locale() );
    135 
    136                 $mofile = WCPT_DIR . "/wcpt-languages/wcpt-$locale.mo";
     76                $mofile = WCPT_DIR . "wcpt-languages/wcpt-$locale.mo";
    13777
    13878                load_textdomain( 'wcpt', $mofile );
    139 
    140                 /**
    141                  * Text domain has been loaded
    142                  */
    143                 do_action( 'wcpt_load_textdomain' );
    144         }
    145 
    146         /**
    147          * core_theme_directory ()
    148          *
    149          * Sets up the WordCamp Post Type theme directory to use in WordPress
    150          *
    151          * @since WordCamp Post Type (0.1)
    152          * @uses register_theme_directory
    153          */
    154         function core_theme_directory () {
    155                 register_theme_directory( WCPT_THEMES_DIR );
    156 
    157                 /**
    158                  * Theme directory has been registered
    159                  */
    160                 do_action( 'wcpt_register_theme_directory' );
    161         }
    162 
    163         /**
    164          * activation ()
    165          *
    166          * Runs on WordCamp Post Type activation
    167          *
    168          * @since WordCamp Post Type (0.1)
    169          */
    170         function activation () {
    171                 register_uninstall_hook( __FILE__, array( $this, 'uninstall' ) );
    172 
    173                 /**
    174                  * WordCamp Post Type has been activated
    175                  */
    176                 do_action( 'wcpt_activation' );
    177         }
    178 
    179         /**
    180          * deactivation ()
    181          *
    182          * Runs on WordCamp Post Type deactivation
    183          *
    184          * @since WordCamp Post Type (0.1)
    185          */
    186         function deactivation () {
    187                 do_action( 'wcpt_deactivation' );
    188         }
    189 
    190         /**
    191          * uninstall ()
    192          *
    193          * Runs when uninstalling WordCamp Post Type
    194          *
    195          * @since WordCamp Post Type (0.1)
    196          */
    197         function uninstall () {
    198                 do_action( 'wcpt_uninstall' );
    199         }
    200 
    201         /**
    202          * component_constants ()
    203          *
    204          * Default component constants that can be overridden or filtered
    205          */
    206         function component_constants () {
    207                 do_action( 'wcpt_constants' );
    208         }
    209 
    210         /**
    211          * component_includes ()
    212          *
    213          * Include required files
    214          *
    215          */
    216         function component_includes () {
    217                 do_action( 'wcpt_includes' );
    218         }
    219 
    220         /**
    221          * component_loaded ()
    222          *
    223          * A WordCamp Post Type specific action to say that it has started its
    224          * boot strapping sequence. It's attached to the existing WordPress
    225          * action 'plugins_loaded' because that's when all plugins have loaded.
    226          *
    227          * @uses is_admin If in WordPress admin, load additional file
    228          * @uses do_action()
    229          */
    230         function component_loaded () {
    231                 do_action( 'wcpt_loaded' );
    232         }
    233 
    234         /**
    235          * component_init ()
    236          *
    237          * Initialize WordCamp Post Type as part of the WordPress initilization process
    238          *
    239          * @uses do_action Calls custom action to allow external enhancement
    240          */
    241         function component_init () {
    242                 do_action ( 'wcpt_init' );
    243         }
    244 
    245         /**
    246          * component_post_type ()
    247          *
    248          * Setup the post types and taxonomies
    249          */
    250         function component_post_types () {
    251                 do_action ( 'wcpt_register_post_types' );
    252         }
    253 
    254         /**
    255          * component_taxonomies ()
    256          *
    257          * Register the built in WordCamp Post Type taxonomies
    258          *
    259          * @since WordCamp Post Type (0.1)
    260          *
    261          * @uses register_taxonomy()
    262          * @uses apply_filters()
    263          */
    264         function component_taxonomies () {
    265                 do_action ( 'wcpt_register_taxonomies' );
    26679        }
    26780}
     
    27083
    27184// Load everything up
    272 $wcpt_loader      = new WCPT_Loader();
    273 $wordcamp_loader  = new WordCamp_Loader();
    274 ?>
     85$wcpt_loader     = new WCPT_Loader;
     86$wordcamp_loader = new WordCamp_Loader;
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

    r2517 r2898  
    1515
    1616        /**
    17          * wcpt_admin ()
    18          *
    1917         * Initialize WCPT Admin
    2018         */
    21         function WordCamp_Admin () {
     19        function __construct() {
    2220                $this->active_admin_notices = array();
    2321
     
    2725                // Forum column headers.
    2826                add_filter( 'manage_' . WCPT_POST_TYPE_ID . '_posts_columns', array( $this, 'column_headers' ) );
     27                add_filter( 'display_post_states',                            array( $this, 'display_post_states' ) );
    2928
    3029                // Forum columns (in page row)
     
    3332
    3433                // Topic metabox actions
    35                 add_action( 'admin_menu',                                     array( $this, 'metabox' ) );
    36                 add_action( 'save_post',                                      array( $this, 'metabox_save' ) );
     34                add_action( 'add_meta_boxes',                                 array( $this, 'metabox' ) );
     35                add_action( 'save_post',                                      array( $this, 'metabox_save' ), 10, 2 );
    3736
    3837                // Scripts and CSS
     
    4342                // Post status transitions
    4443                add_action( 'transition_post_status',                         array( $this, 'trigger_schedule_actions' ), 10, 3 );
     44                add_action( 'transition_post_status',                         array( $this, 'log_status_changes'       ), 10, 3 );
    4545                add_action( 'wcpt_added_to_planning_schedule',                array( $this, 'add_organizer_to_central' ), 10 );
    4646                add_action( 'wcpt_added_to_planning_schedule',                array( $this, 'mark_date_added_to_planning_schedule' ), 10 );
    47                 add_filter( 'wp_insert_post_data',                            array( $this, 'enforce_post_status_progression' ), 10, 2 );
    48                 add_filter( 'wp_insert_post_data',                            array( $this, 'require_complete_meta_to_publish_wordcamp' ), 10, 2 );
     47                add_filter( 'wp_insert_post_data',                            array( $this, 'enforce_post_status' ), 10, 2 );
     48                add_filter( 'wp_insert_post_data',                            array( $this, 'require_complete_meta_to_publish_wordcamp' ), 11, 2 ); // after enforce_post_status
    4949
    5050                // Admin notices
     
    8787                        'high'
    8888                );
     89
     90                add_meta_box(
     91                        'wcpt_original_application',
     92                        'Original Application',
     93                        array( $this, 'original_application_metabox' ),
     94                        WCPT_POST_TYPE_ID,
     95                        'advanced',
     96                        'low'
     97                );
     98
     99                // Notes are private, so only show them to network admins
     100                if ( current_user_can( 'manage_network' ) ) {
     101                        add_meta_box(
     102                                'wcpt_notes',
     103                                __( 'Add a Note', 'wordcamporg' ),
     104                                'wcpt_add_note_metabox',
     105                                WCPT_POST_TYPE_ID,
     106                                'side',
     107                                'low'
     108                        );
     109
     110                        add_meta_box(
     111                                'wcpt_log',
     112                                'Log',
     113                                'wcpt_log_metabox',
     114                                WCPT_POST_TYPE_ID,
     115                                'advanced',
     116                                'low'
     117                        );
     118                }
     119
     120                // Remove core's submitdiv.
     121                remove_meta_box( 'submitdiv', WCPT_POST_TYPE_ID, 'side' );
     122
     123                $statuses = WordCamp_Loader::get_post_statuses();
     124
     125                add_meta_box(
     126                        'submitdiv',
     127                        __( 'Status', 'wordcamporg' ),
     128                        array( $this, 'metabox_status' ),
     129                        WCPT_POST_TYPE_ID,
     130                        'side',
     131                        'high'
     132                );
    89133        }
    90134
     
    97141         * @return int
    98142         */
    99         function metabox_save( $post_id ) {
    100 
     143        function metabox_save( $post_id, $post ) {
    101144                // Don't add/remove meta on revisions and auto-saves
    102145                if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) )
     
    110153                // WordCamp post type only
    111154                if ( WCPT_POST_TYPE_ID != get_post_type() ) {
     155                        return;
     156                }
     157
     158                // Make sure the requset came from the edit post screen.
     159                if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'update-post_' . $post_id ) ) {
    112160                        return;
    113161                }
     
    128176                // Loop through meta keys and update
    129177                foreach ( $wcpt_meta_keys as $key => $value ) {
    130 
    131178                        // Get post value
    132179                        $post_value   = wcpt_key_to_str( $key, 'wcpt_' );
     
    159206                        }
    160207                }
     208
     209                $this->validate_and_add_note( $post_id );
     210        }
     211
     212        /**
     213         * Validate and add a new note
     214         *
     215         * @param int $post_id
     216         */
     217        protected function validate_and_add_note( $post_id ) {
     218                check_admin_referer( 'wcpt_notes', 'wcpt_notes_nonce' );
     219
     220                $new_note_message = sanitize_text_field( wp_unslash( $_POST['wcpt_new_note'] ) );
     221
     222                if ( empty( $new_note_message ) ) {
     223                        return;
     224                }
     225
     226                add_post_meta( $post_id, '_note', array(
     227                        'timestamp' => time(),
     228                        'user_id'   => get_current_user_id(),
     229                        'message'   => $new_note_message,
     230                ) );
    161231        }
    162232
     
    197267         */
    198268        function meta_keys( $meta_group = '' ) {
    199 
    200269                /*
    201270                 * Warning: These keys are used for both the input field label and the postmeta key, so if you want to
     
    212281                        case 'organizer':
    213282                                $retval = array (
    214                                         'Organizer Name'                  => 'text',
    215                                         'WordPress.org Username'          => 'text',
    216                                         'Email Address'                   => 'text',    // Note: This is the lead organizer's e-mail address, which is different than the "E-mail Address" field
    217                                         'Telephone'                       => 'text',
    218                                         'Mailing Address'                 => 'textarea',
    219                                         'Sponsor Wrangler Name'           => 'text',
    220                                         'Sponsor Wrangler E-mail Address' => 'text',
    221                                         'Budget Wrangler Name'            => 'text',
    222                                         'Budget Wrangler E-mail Address'  => 'text',
    223                                         'Venue Wrangler Name'                   => 'text',
    224                                         'Venue Wrangler E-mail Address'         => 'text',
    225                                         'Speaker Wrangler Name'                 => 'text',
    226                                         'Speaker Wrangler E-mail Address'       => 'text',
    227                                         'Food/Beverage Wrangler Name'           => 'text',
    228                                         'Food/Beverage Wrangler E-mail Address' => 'text',
    229                                         'Swag Wrangler Name'                    => 'text',
    230                                         'Swag Wrangler E-mail Address'          => 'text',
    231                                         'Volunteer Wrangler Name'               => 'text',
    232                                         'Volunteer Wrangler E-mail Address'     => 'text',
    233                                         'Printing Wrangler Name'                => 'text',
    234                                         'Printing Wrangler E-mail Address'      => 'text',
    235                                         'Design Wrangler Name'                  => 'text',
    236                                         'Design Wrangler E-mail Address'        => 'text',
    237                                         'Website Wrangler Name'                 => 'text',
    238                                         'Website Wrangler E-mail Address'       => 'text',
    239                                         'Social Media/Publicity Wrangler Name'            => 'text',
    240                                         'Social Media/Publicity Wrangler E-mail Address'  => 'text',
    241                                         'A/V Wrangler Name'                     => 'text',
    242                                         'A/V Wrangler E-mail Address'           => 'text',
    243                                         'Party Wrangler Name'                   => 'text',
    244                                         'Party Wrangler E-mail Address'         => 'text',
    245                                         'Travel Wrangler Name'                  => 'text',
    246                                         'Travel Wrangler E-mail Address'        => 'text',
    247                                         'Safety Wrangler Name'                  => 'text',
    248                                         'Safety Wrangler E-mail Address'        => 'text',
    249                                         'Mentor Name'                     => 'text',
    250                                         'Mentor E-mail Address'           => 'text',
     283                                        'Organizer Name'                                 => 'text',
     284                                        'WordPress.org Username'                         => 'text',
     285                                        'Email Address'                                  => 'text', // Note: This is the lead organizer's e-mail address, which is different than the "E-mail Address" field
     286                                        'Telephone'                                      => 'text',
     287                                        'Mailing Address'                                => 'textarea',
     288                                        'Sponsor Wrangler Name'                          => 'text',
     289                                        'Sponsor Wrangler E-mail Address'                => 'text',
     290                                        'Budget Wrangler Name'                           => 'text',
     291                                        'Budget Wrangler E-mail Address'                 => 'text',
     292                                        'Venue Wrangler Name'                            => 'text',
     293                                        'Venue Wrangler E-mail Address'                  => 'text',
     294                                        'Speaker Wrangler Name'                          => 'text',
     295                                        'Speaker Wrangler E-mail Address'                => 'text',
     296                                        'Food/Beverage Wrangler Name'                    => 'text',
     297                                        'Food/Beverage Wrangler E-mail Address'          => 'text',
     298                                        'Swag Wrangler Name'                             => 'text',
     299                                        'Swag Wrangler E-mail Address'                   => 'text',
     300                                        'Volunteer Wrangler Name'                        => 'text',
     301                                        'Volunteer Wrangler E-mail Address'              => 'text',
     302                                        'Printing Wrangler Name'                         => 'text',
     303                                        'Printing Wrangler E-mail Address'               => 'text',
     304                                        'Design Wrangler Name'                           => 'text',
     305                                        'Design Wrangler E-mail Address'                 => 'text',
     306                                        'Website Wrangler Name'                          => 'text',
     307                                        'Website Wrangler E-mail Address'                => 'text',
     308                                        'Social Media/Publicity Wrangler Name'           => 'text',
     309                                        'Social Media/Publicity Wrangler E-mail Address' => 'text',
     310                                        'A/V Wrangler Name'                              => 'text',
     311                                        'A/V Wrangler E-mail Address'                    => 'text',
     312                                        'Party Wrangler Name'                            => 'text',
     313                                        'Party Wrangler E-mail Address'                  => 'text',
     314                                        'Travel Wrangler Name'                           => 'text',
     315                                        'Travel Wrangler E-mail Address'                 => 'text',
     316                                        'Safety Wrangler Name'                           => 'text',
     317                                        'Safety Wrangler E-mail Address'                 => 'text',
     318                                        'Mentor Name'                                    => 'text',
     319                                        'Mentor E-mail Address'                          => 'text',
    251320                                );
    252321
     
    292361                                        'Multi-Event Sponsor Region'      => 'mes-dropdown',
    293362
    294                                         'Organizer Name'                  => 'text',
    295                                         'WordPress.org Username'          => 'text',
    296                                         'Email Address'                   => 'text',
    297                                         'Telephone'                       => 'text',
    298                                         'Mailing Address'                 => 'textarea',
    299                                         'Sponsor Wrangler Name'           => 'text',
    300                                         'Sponsor Wrangler E-mail Address' => 'text',
    301                                         'Budget Wrangler Name'            => 'text',
    302                                         'Budget Wrangler E-mail Address'  => 'text',
    303                                         'Venue Wrangler Name'                   => 'text',
    304                                         'Venue Wrangler E-mail Address'         => 'text',
    305                                         'Speaker Wrangler Name'                 => 'text',
    306                                         'Speaker Wrangler E-mail Address'       => 'text',
    307                                         'Food/Beverage Wrangler Name'           => 'text',
    308                                         'Food/Beverage Wrangler E-mail Address' => 'text',
    309                                         'Swag Wrangler Name'                    => 'text',
    310                                         'Swag Wrangler E-mail Address'          => 'text',
    311                                         'Volunteer Wrangler Name'               => 'text',
    312                                         'Volunteer Wrangler E-mail Address'     => 'text',
    313                                         'Printing Wrangler Name'                => 'text',
    314                                         'Printing Wrangler E-mail Address'      => 'text',
    315                                         'Design Wrangler Name'                  => 'text',
    316                                         'Design Wrangler E-mail Address'        => 'text',
    317                                         'Website Wrangler Name'                 => 'text',
    318                                         'Website Wrangler E-mail Address'       => 'text',
    319                                         'Social Media/Publicity Wrangler Name'            => 'text',
    320                                         'Social Media/Publicity Wrangler E-mail Address'  => 'text',
    321                                         'A/V Wrangler Name'                     => 'text',
    322                                         'A/V Wrangler E-mail Address'           => 'text',
    323                                         'Party Wrangler Name'                   => 'text',
    324                                         'Party Wrangler E-mail Address'         => 'text',
    325                                         'Travel Wrangler Name'                  => 'text',
    326                                         'Travel Wrangler E-mail Address'        => 'text',
    327                                         'Safety Wrangler Name'                  => 'text',
    328                                         'Safety Wrangler E-mail Address'        => 'text',
    329                                         'Mentor Name'                     => 'text',
    330                                         'Mentor E-mail Address'           => 'text',
     363                                        'Organizer Name'                                 => 'text',
     364                                        'WordPress.org Username'                         => 'text',
     365                                        'Email Address'                                  => 'text',
     366                                        'Telephone'                                      => 'text',
     367                                        'Mailing Address'                                => 'textarea',
     368                                        'Sponsor Wrangler Name'                          => 'text',
     369                                        'Sponsor Wrangler E-mail Address'                => 'text',
     370                                        'Budget Wrangler Name'                           => 'text',
     371                                        'Budget Wrangler E-mail Address'                 => 'text',
     372                                        'Venue Wrangler Name'                            => 'text',
     373                                        'Venue Wrangler E-mail Address'                  => 'text',
     374                                        'Speaker Wrangler Name'                          => 'text',
     375                                        'Speaker Wrangler E-mail Address'                => 'text',
     376                                        'Food/Beverage Wrangler Name'                    => 'text',
     377                                        'Food/Beverage Wrangler E-mail Address'          => 'text',
     378                                        'Swag Wrangler Name'                             => 'text',
     379                                        'Swag Wrangler E-mail Address'                   => 'text',
     380                                        'Volunteer Wrangler Name'                        => 'text',
     381                                        'Volunteer Wrangler E-mail Address'              => 'text',
     382                                        'Printing Wrangler Name'                         => 'text',
     383                                        'Printing Wrangler E-mail Address'               => 'text',
     384                                        'Design Wrangler Name'                           => 'text',
     385                                        'Design Wrangler E-mail Address'                 => 'text',
     386                                        'Website Wrangler Name'                          => 'text',
     387                                        'Website Wrangler E-mail Address'                => 'text',
     388                                        'Social Media/Publicity Wrangler Name'           => 'text',
     389                                        'Social Media/Publicity Wrangler E-mail Address' => 'text',
     390                                        'A/V Wrangler Name'                              => 'text',
     391                                        'A/V Wrangler E-mail Address'                    => 'text',
     392                                        'Party Wrangler Name'                            => 'text',
     393                                        'Party Wrangler E-mail Address'                  => 'text',
     394                                        'Travel Wrangler Name'                           => 'text',
     395                                        'Travel Wrangler E-mail Address'                 => 'text',
     396                                        'Safety Wrangler Name'                           => 'text',
     397                                        'Safety Wrangler E-mail Address'                 => 'text',
     398                                        'Mentor Name'                                    => 'text',
     399                                        'Mentor E-mail Address'                          => 'text',
    331400
    332401                                        'Venue Name'                      => 'text',
     
    356425        function admin_print_scripts() {
    357426                if ( get_post_type() == WCPT_POST_TYPE_ID ) :
     427
    358428                ?>
    359429
     
    403473                if ( !wcpt_has_access() )
    404474                        return false;
    405 
    406475        }
    407476
     
    414483         */
    415484        function user_profile_wordcamp( $profileuser ) {
    416 
    417485                if ( !wcpt_has_access() )
    418486                        return false;
    419 
    420487                ?>
    421488
    422489                <h3><?php _e( 'WordCamps', 'wcpt' ); ?></h3>
     490
    423491                <table class="form-table">
    424492                        <tr valign="top">
    425493                                <th scope="row"><?php _e( 'WordCamps', 'wcpt' ); ?></th>
     494
    426495                                <td>
    427 
    428496                                </td>
    429497                        </tr>
     
    455523
    456524        /**
     525         * Display the status of a WordCamp post
     526         *
     527         * @param array $states
     528         *
     529         * @return array
     530         */
     531        public function display_post_states( $states ) {
     532                global $post;
     533
     534                if ( $post->post_type != WCPT_POST_TYPE_ID ) {
     535                        return $states;
     536                }
     537
     538                $status = get_post_status_object( $post->post_status );
     539                if ( get_query_var( 'post_status' ) != $post->post_status ) {
     540                        $states[ $status->name ] = $status->label;
     541                }
     542
     543                return $states;
     544        }
     545
     546        /**
    457547         * column_data ( $column, $post_id )
    458548         *
     
    472562
    473563                        case 'wcpt_date' :
    474 
    475564                                // Has a start date
    476565                                if ( $start = wcpt_get_wordcamp_start_date() ) {
     
    526615                        echo implode( ' - ', (array) $wc );
    527616                }
     617
    528618                return $actions;
    529619        }
     
    531621        /**
    532622         * Trigger actions related to WordCamps being scheduled.
    533          *
    534          * When an application is submitted, a `wordcamp` post is created with a `draft` status. When it's accepted
    535          * to the planning schedule the status changes to `pending`, and when it's accepted for the final schedule
    536          * the status changes to 'publish'.
    537623         *
    538624         * @param string $new_status
     
    545631                }
    546632
     633                if ( $new_status == $old_status ) {
     634                        return;
     635                }
     636
     637                if ( $old_status == 'wcpt-pre-planning' && $new_status == 'wcpt-pre-planning' ) {
     638                        do_action( 'wcpt_added_to_planning_schedule', $post );
     639                } elseif ( $old_status == 'wcpt-needs-schedule' && $new_status == 'wcpt-scheduled' ) {
     640                        do_action( 'wcpt_added_to_final_schedule', $post );
     641                }
     642
     643                // back-compat for old statuses
    547644                if ( 'draft' == $old_status && 'pending' == $new_status ) {
    548645                        do_action( 'wcpt_added_to_planning_schedule', $post );
     
    550647                        do_action( 'wcpt_added_to_final_schedule', $post );
    551648                }
     649
     650                // todo add new triggers - which ones?
     651        }
     652
     653        /**
     654         * Log when the post status changes
     655         *
     656         * @param string  $new_status
     657         * @param string  $old_status
     658         * @param WP_Post $post
     659         */
     660        public function log_status_changes( $new_status, $old_status, $post ) {
     661                if ( $new_status === $old_status || $new_status == 'auto-draft' ) {
     662                        return;
     663                }
     664
     665                if ( empty( $post->post_type ) || WCPT_POST_TYPE_ID != $post->post_type ) {
     666                        return;
     667                }
     668
     669                $old_status = get_post_status_object( $old_status );
     670                $new_status = get_post_status_object( $new_status );
     671
     672                add_post_meta( $post->ID, '_status_change', array(
     673                        'timestamp' => time(),
     674                        'user_id'   => get_current_user_id(),
     675                        'message'   => sprintf( '%s &rarr; %s', $old_status->label, $new_status->label ),
     676                ) );
    552677        }
    553678
     
    581706
    582707        /**
    583          * Force WordCamp posts to go through the expected status progression.
    584          *
    585          * They should start as drafts, then move to pending, and then be published. This is necessary because
    586          * many automated processes (e.g., Organizer Reminder emails) are triggered when the post moves from
    587          * one status to another, and deviations from the expected progression can cause bugs.
    588          *
    589          * Posts should still be allowed to move backwards in the progression, though.
     708         * Enforce a valid post status for WordCamps.
    590709         *
    591710         * @param array $post_data
     
    593712         * @return array
    594713         */
    595         public function enforce_post_status_progression( $post_data, $post_data_raw ) {
    596                 if ( WCPT_POST_TYPE_ID == $post_data['post_type'] && ! empty( $_POST ) ) {
    597                         $previous_post_status = get_post( absint( $_POST['post_ID'] ) );
    598                         $previous_post_status = $previous_post_status->post_status;
    599 
    600                         if ( 'pending' == $post_data['post_status'] && ! in_array( $previous_post_status, array( 'draft', 'pending', 'publish' ) ) ) {
    601                                 $this->active_admin_notices[] = 2;
    602                                 $post_data['post_status'] = $previous_post_status;
     714        public function enforce_post_status( $post_data, $post_data_raw ) {
     715                if ( $post_data['post_type'] != WCPT_POST_TYPE_ID || empty( $_POST['post_ID'] ) ) {
     716                        return $post_data;
     717                }
     718
     719                $post = get_post( $_POST['post_ID'] );
     720                if ( ! $post ) {
     721                        return $post_data;
     722                }
     723
     724                if ( ! empty( $post_data['post_status'] ) ) {
     725                        // Only network admins can change WordCamp statuses.
     726                        if ( ! current_user_can( 'network_admin' ) ) {
     727                                $post_data['post_status'] = $post->post_status;
    603728                        }
    604729
    605                         if ( 'publish' == $post_data['post_status'] && ! in_array( $previous_post_status, array( 'pending', 'publish' ) ) ) {
    606                                 $this->active_admin_notices[] = 2;
    607                                 $post_data['post_status'] = $previous_post_status;
     730                        // Enforce a valid status.
     731                        $statuses = array_keys( WordCamp_Loader::get_post_statuses() );
     732                        $statuses = array_merge( $statuses, array( 'trash' ) );
     733
     734                        if ( ! in_array( $post_data['post_status'], $statuses ) ) {
     735                                $post_data['post_status'] = $statuses[0];
    608736                        }
    609737                }
     
    627755                $min_site_id = apply_filters( 'wcpt_require_complete_meta_min_site_id', '2416297' );
    628756
    629                 $required_pending_fields = $this->get_required_fields( 'pending' );
    630                 $required_publish_fields = $this->get_required_fields( 'publish' );
     757                $required_pre_planning_fields = $this->get_required_fields( 'pre-planning' );
     758                $required_scheduled_fields    = $this->get_required_fields( 'scheduled' );
    631759
    632760                // Check pending posts
    633                 if ( 'pending' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
    634                         foreach( $required_pending_fields as $field ) {
     761                if ( 'wcpt-approved-pre-pl' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
     762                        foreach( $required_pre_planning_fields as $field ) {
    635763                                $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
    636764
    637765                                if ( empty( $value ) || 'null' == $value ) {
    638                                         $post_data['post_status']     = 'draft';
     766                                        $post_data['post_status']     = 'wcpt-interview-sched';
     767                                        $this->active_admin_notices[] = 1;
     768                                        break;
     769                                }
     770                        }
     771                }
     772
     773                // Check published posts
     774                if ( 'wcpt-scheduled' == $post_data['post_status'] && isset( $_POST['post_ID'] ) && absint( $_POST['post_ID'] ) > $min_site_id ) {
     775                        foreach( $required_scheduled_fields as $field ) {
     776                                $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
     777
     778                                if ( empty( $value ) || 'null' == $value ) {
     779                                        $post_data['post_status']     = 'wcpt-needs-schedule';
    639780                                        $this->active_admin_notices[] = 3;
    640781                                        break;
     
    643784                }
    644785
    645                 // Check published posts
    646                 if ( 'publish' == $post_data['post_status'] && isset( $_POST['post_ID'] ) && absint( $_POST['post_ID'] ) > $min_site_id ) {
    647                         foreach( $required_publish_fields as $field ) {
    648                                 $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
    649 
    650                                 if ( empty( $value ) || 'null' == $value ) {
    651                                         $post_data['post_status']     = 'pending';
    652                                         $this->active_admin_notices[] = 1;
    653                                         break;
    654                                 }
    655                         }
    656                 }
    657 
    658786                return $post_data;
    659787        }
     
    662790         * Get a list of fields required to move to a certain post status
    663791         *
    664          * @param string $status 'pending' | 'publish' | 'any'
     792         * @param string $status 'pre-planning' | 'scheduled' | 'any'
    665793         *
    666794         * @return array
    667795         */
    668796        public static function get_required_fields( $status ) {
    669                 $pending = array( 'E-mail Address' );
    670 
    671                 $publish = array(
     797                $pre_planning = array( 'E-mail Address' );
     798
     799                $scheduled = array(
    672800                        // WordCamp
    673801                        'Start Date (YYYY-mm-dd)',
     
    691819
    692820                switch ( $status ) {
    693                         case 'pending':
    694                                 $required_fields = $pending;
     821                        case 'pre-planning':
     822                                $required_fields = $pre_planning;
    695823                                break;
    696824
    697                         case 'publish':
    698                                 $required_fields = $publish;
     825                        case 'scheduled':
     826                                $required_fields = $scheduled;
    699827                                break;
    700828
    701829                        case 'any':
    702830                        default:
    703                                 $required_fields = array_merge( $pending, $publish );
     831                                $required_fields = array_merge( $pre_planning, $scheduled );
    704832                                break;
    705833                }
     
    751879                        1 => array(
    752880                                'type'   => 'error',
    753                                 'notice' => __( 'This WordCamp cannot be published until all of its required metadata is filled in.', 'wordcamporg' ),
    754                         ),
    755 
    756                         2 => array(
    757                                 'type'   => 'error',
    758                                 'notice' => sprintf(
    759                                         __(
    760                                                 'WordCamps must start as drafts, then be set as pending, and then be published. The post status has been reset to <strong>%s</strong>.',    // todo improve language
    761                                                 'wordcamporg'
    762                                         ),
    763                                         $post->post_status
    764                                 )
     881                                'notice' => __( 'This WordCamp cannot be approved for pre-planning until all of its required metadata is filled in.', 'wordcamporg' ),
    765882                        ),
    766883
    767884                        3 => array(
    768885                                'type'   => 'error',
    769                                 'notice' => __( 'This WordCamp cannot be set to pending until all of its required metadata is filled in.', 'wordcamporg' ),
     886                                'notice' => __( 'This WordCamp cannot be added to the schedule until all of its required metadata is filled in.', 'wordcamporg' ),
    770887                        ),
    771888                );
     
    786903                        }
    787904                }
     905        }
     906
     907        /**
     908         * Render the WordCamp status meta box.
     909         */
     910        public function metabox_status( $post ) {
     911                require_once( WCPT_DIR . 'views/wordcamp/metabox-status.php' );
     912        }
     913
     914        /**
     915         * Render the WordCamp status meta box.
     916         */
     917        public function original_application_metabox( $post ) {
     918                $application_data = get_post_meta( $post->ID, '_application_data', true );
     919                require_once( WCPT_DIR . 'views/wordcamp/metabox-original-application.php' );
    788920        }
    789921}
     
    8851017                                        <?php if ( ! empty( $messages[ $key ] ) ) : ?>
    8861018                                                <?php if ( 'textarea' == $value ) { echo '<br />'; } ?>
    887                                                
     1019
    8881020                                                <span class="description"><?php echo esc_html( $messages[ $key ] ); ?></span>
    8891021                                        <?php endif; ?>
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-loader.php

    r1230 r2898  
    11<?php
    22
    3 if ( !class_exists( 'WordCamp_Loader' ) ) :
     3define( 'WCPT_POST_TYPE_ID',   'wordcamp'           );
     4define( 'WCPT_YEAR_ID',        'wordcamp_year'      );
     5define( 'WCPT_SLUG',           'wordcamps'          );
     6define( 'WCPT_DEFAULT_STATUS', 'wcpt-needs-vetting' );
     7define( 'WCPT_FINAL_STATUS',   'wcpt-closed'        );
     8
     9if ( ! class_exists( 'WordCamp_Loader' ) ) :
    410/**
    511 * WordCamp_Loader
     
    1521         * The main WordCamp Post Type loader
    1622         */
    17         function wordcamp_loader () {
    18 
    19                 // Attach constants to wcpt_loaded.
    20                 add_action( 'wcpt_constants',           array ( $this, 'constants' ) );
    21 
    22                 // Attach includes to wcpt_includes.
    23                 add_action( 'wcpt_includes',            array ( $this, 'includes' ) );
    24 
    25                 // Attach post type registration to wcpt_register_post_types.
    26                 add_action( 'wcpt_register_post_types', array ( $this, 'register_post_types' ) );
    27 
    28                 // Attach tag registration wcpt_register_taxonomies.
    29                 //add_action( 'wcpt_register_taxonomies', array ( $this, 'register_taxonomies' ) );
    30         }
    31 
    32         /**
    33          * constants ()
    34          *
    35          * Default component constants that can be overridden or filtered
    36          */
    37         function constants () {
    38 
    39                 // The default post type ID
    40                 if ( !defined( 'WCPT_POST_TYPE_ID' ) )
    41                         define( 'WCPT_POST_TYPE_ID', apply_filters( 'wcpt_post_type_id', 'wordcamp' ) );
    42 
    43                 // The default year ID
    44                 if ( !defined( 'WCPT_YEAR_ID' ) )
    45                         define( 'WCPT_YEAR_ID', apply_filters( 'wcpt_tag_id', 'wordcamp_year' ) );
    46 
    47                 // Default slug for post type
    48                 if ( !defined( 'WCPT_SLUG' ) )
    49                         define( 'WCPT_SLUG', apply_filters( 'wcpt_slug', 'wordcamps' ) );
     23        function __construct() {
     24                add_action( 'plugins_loaded', array( $this, 'includes'               ) );
     25                add_action( 'init',           array( $this, 'register_post_types'    ) );
     26                add_action( 'init',           array( $this, 'register_post_statuses' ) );
    5027        }
    5128
     
    5835         */
    5936        function includes () {
    60 
    6137                // Load the files
    62                 require_once ( WCPT_DIR . '/wcpt-wordcamp/wordcamp-template.php' );
     38                require_once ( WCPT_DIR . 'wcpt-wordcamp/wordcamp-template.php' );
    6339
    6440                // Quick admin check and load if needed
    6541                if ( is_admin() )
    66                         require_once ( WCPT_DIR . '/wcpt-wordcamp/wordcamp-admin.php' );
    67 
    68                 require_once( WCPT_DIR . '/wcpt-wordcamp/wordcamp-new-site.php' );
    69                 $GLOBALS['wordcamp_new_site'] = new WordCamp_New_Site();
     42                        require_once ( WCPT_DIR . 'wcpt-wordcamp/wordcamp-admin.php' );
     43
     44                require_once( WCPT_DIR . 'wcpt-wordcamp/wordcamp-new-site.php' );
     45
     46                $GLOBALS['wordcamp_new_site'] = new WordCamp_New_Site;
    7047        }
    7148
     
    7754         * @todo Finish up the post type admin area with messages, columns, etc...*
    7855         */
    79         function register_post_types () {
    80 
     56        function register_post_types() {
    8157                // WordCamp post type labels
    8258                $wcpt_labels = array (
    83                         'name'                  => __( 'WordCamps', 'wcpt' ),
    84                         'singular_name'         => __( 'WordCamp', 'wcpt' ),
    85                         'add_new'               => __( 'Add New', 'wcpt' ),
    86                         'add_new_item'          => __( 'Create New WordCamp', 'wcpt' ),
    87                         'edit'                  => __( 'Edit', 'wcpt' ),
    88                         'edit_item'             => __( 'Edit WordCamp', 'wcpt' ),
    89                         'new_item'              => __( 'New WordCamp', 'wcpt' ),
    90                         'view'                  => __( 'View WordCamp', 'wcpt' ),
    91                         'view_item'             => __( 'View WordCamp', 'wcpt' ),
    92                         'search_items'          => __( 'Search WordCamps', 'wcpt' ),
    93                         'not_found'             => __( 'No WordCamps found', 'wcpt' ),
     59                        'name'                  => __( 'WordCamps',                   'wcpt' ),
     60                        'singular_name'         => __( 'WordCamp',                    'wcpt' ),
     61                        'add_new'               => __( 'Add New',                     'wcpt' ),
     62                        'add_new_item'          => __( 'Create New WordCamp',         'wcpt' ),
     63                        'edit'                  => __( 'Edit',                        'wcpt' ),
     64                        'edit_item'             => __( 'Edit WordCamp',               'wcpt' ),
     65                        'new_item'              => __( 'New WordCamp',                'wcpt' ),
     66                        'view'                  => __( 'View WordCamp',               'wcpt' ),
     67                        'view_item'             => __( 'View WordCamp',               'wcpt' ),
     68                        'search_items'          => __( 'Search WordCamps',            'wcpt' ),
     69                        'not_found'             => __( 'No WordCamps found',          'wcpt' ),
    9470                        'not_found_in_trash'    => __( 'No WordCamps found in Trash', 'wcpt' ),
    95                         'parent_item_colon'     => __( 'Parent WordCamp:', 'wcpt' )
     71                        'parent_item_colon'     => __( 'Parent WordCamp:',            'wcpt' )
    9672                );
    9773
     
    11288
    11389                // Register WordCamp post type
    114                 register_post_type (
    115                         WCPT_POST_TYPE_ID,
    116                         apply_filters( 'wcpt_register_post_type',
    117                                 array (
    118                                         'labels'            => $wcpt_labels,
    119                                         'rewrite'           => $wcpt_rewrite,
    120                                         'supports'          => $wcpt_supports,
    121                                         'menu_position'     => '100',
    122                                         'public'            => true,
    123                                         'show_ui'           => true,
    124                                         'can_export'        => true,
    125                                         'capability_type'   => 'post',
    126                                         'hierarchical'      => false,
    127                                         'has_archive'       => true,
    128                                         'query_var'         => true,
    129                                         'menu_icon'         => 'dashicons-wordpress',
    130                                 )
    131                         )
    132                 );
    133         }
    134 
    135         /**
    136          * register_taxonomies ()
    137          *
    138          * Register the built in WordCamp Post Type taxonomies
    139          *
    140          * @since WordCamp Post Type (0.1)
    141          *
    142          * @uses register_taxonomy()
    143          * @uses apply_filters()
    144          */
    145         function register_taxonomies () {
    146 
    147                 // Tag labels
    148                 $tag_labels = array (
    149                         'name'              => __( 'Years', 'wcpt' ),
    150                         'singular_name'     => __( 'Year', 'wcpt' ),
    151                         'search_items'      => __( 'Search Years', 'wcpt' ),
    152                         'popular_items'     => __( 'Popular Years', 'wcpt' ),
    153                         'all_items'         => __( 'All Years', 'wcpt' ),
    154                         'edit_item'         => __( 'Edit Year', 'wcpt' ),
    155                         'update_item'       => __( 'Update Year', 'wcpt' ),
    156                         'add_new_item'      => __( 'Add Year', 'wcpt' ),
    157                         'new_item_name'     => __( 'New Year', 'wcpt' ),
    158                 );
    159 
    160                 // Tag rewrite
    161                 $tag_rewrite = array (
    162                         'slug' => 'year'
    163                 );
    164 
    165                 // Register the  tag taxonomy
    166                 register_taxonomy (
    167                         WCPT_TAG_ID,               // The  tag ID
    168                         WCPT_POST_TYPE_ID,         // The  post type ID
    169                         apply_filters( 'wcpt_register_year',
    170                                 array (
    171                                         'labels'                => $tag_labels,
    172                                         'rewrite'               => $tag_rewrite,
    173                                         //'update_count_callback' => '_update_post_term_count',
    174                                         'query_var'             => 'wc-year',
    175                                         'hierarchical'          => false,
    176                                         'public'                => true,
    177                                         'show_ui'               => true,
    178                                 )
    179                         )
    180                 );
     90                register_post_type( WCPT_POST_TYPE_ID, array(
     91                        'labels'            => $wcpt_labels,
     92                        'rewrite'           => $wcpt_rewrite,
     93                        'supports'          => $wcpt_supports,
     94                        'menu_position'     => '100',
     95                        'public'            => true,
     96                        'show_ui'           => true,
     97                        'can_export'        => true,
     98                        'capability_type'   => 'post',
     99                        'hierarchical'      => false,
     100                        'has_archive'       => true,
     101                        'query_var'         => true,
     102                        'menu_icon'         => 'dashicons-wordpress',
     103                ) );
     104        }
     105
     106        public function register_post_statuses() {
     107                foreach ( self::get_post_statuses() as $key => $label ) {
     108                        register_post_status( $key, array(
     109                                'label' => $label,
     110                                'public' => true,
     111                                'label_count' => _nx_noop(
     112                                        sprintf( '%s <span class="count">(%s)</span>', $label, '%s' ),
     113                                        sprintf( '%s <span class="count">(%s)</span>', $label, '%s' ),
     114                                        'wordcamporg'
     115                                ),
     116                        ) );
     117                }
     118        }
     119
     120        /**
     121         * Get WordCamp post statuses.
     122         *
     123         * @return array
     124         */
     125        public static function get_post_statuses() {
     126                return array(
     127                        'wcpt-needs-vetting'   => _x( 'Needs Vetting',                               'wordcamp status', 'wordcamporg' ),
     128                        'wcpt-needs-orientati' => _x( 'Needs Orientation/Interview',                 'wordcamp status', 'wordcamporg' ),
     129                        'wcpt-more-info-reque' => _x( 'More Info Requested',                         'wordcamp status', 'wordcamporg' ),
     130                        'wcpt-needs-rejection' => _x( 'Needs Rejection E-mail',                      'wordcamp status', 'wordcamporg' ),
     131                        'wcpt-interview-sched' => _x( 'Interview/Orientation Scheduled',             'wordcamp status', 'wordcamporg' ),
     132                        'wcpt-rejected'        => _x( 'Rejected',                                    'wordcamp status', 'wordcamporg' ),
     133                        'wcpt-cancelled'       => _x( 'Cancelled',                                   'wordcamp status', 'wordcamporg' ),
     134                        'wcpt-approved-pre-pl' => _x( 'Approved for Pre-Planning Pending Agreement', 'wordcamp status', 'wordcamporg' ),
     135                        'wcpt-needs-email'     => _x( 'Needs E-mail Address',                        'wordcamp status', 'wordcamporg' ),
     136                        'wcpt-needs-site'      => _x( 'Needs Site',                                  'wordcamp status', 'wordcamporg' ),
     137                        'wcpt-needs-polldaddy' => _x( 'Needs Polldaddy Account',                     'wordcamp status', 'wordcamporg' ),
     138                        'wcpt-needs-mentor'    => _x( 'Needs Mentor',                                'wordcamp status', 'wordcamporg' ),
     139                        'wcpt-needs-pre-plann' => _x( 'Needs to be Added to Pre-Planning Schedule',  'wordcamp status', 'wordcamporg' ),
     140                        'wcpt-pre-planning'    => _x( 'In Pre-Planning',                             'wordcamp status', 'wordcamporg' ),
     141                        'wcpt-needs-budget-re' => _x( 'Needs Budget Review',                         'wordcamp status', 'wordcamporg' ),
     142                        'wcpt-budget-rev-sche' => _x( 'Budget Review Scheduled',                     'wordcamp status', 'wordcamporg' ),
     143                        'wcpt-needs-contract'  => _x( 'Needs Contract to be Signed',                 'wordcamp status', 'wordcamporg' ),
     144                        'wcpt-needs-fill-list' => _x( 'Needs to Fill Out WordCamp Listing',          'wordcamp status', 'wordcamporg' ),
     145                        'wcpt-needs-schedule'  => _x( 'Needs to be Added to Official Schedule',      'wordcamp status', 'wordcamporg' ),
     146                        'wcpt-scheduled'       => _x( 'WordCamp Scheduled',                          'wordcamp status', 'wordcamporg' ),
     147                        'wcpt-needs-debrief'   => _x( 'Needs Debrief',                               'wordcamp status', 'wordcamporg' ),
     148                        'wcpt-debrief-schedul' => _x( 'Debrief Scheduled',                           'wordcamp status', 'wordcamporg' ),
     149                        'wcpt-closed'          => _x( 'WordCamp Closed',                             'wordcamp status', 'wordcamporg' ),
     150                );
     151        }
     152
     153        /**
     154         * Get post statuses for WordCamps on schedule.
     155         *
     156         * @return array Post status names.
     157         */
     158        public static function get_public_post_statuses() {
     159                return array(
     160                        'wcpt-scheduled',
     161                        'wcpt-needs-debrief',
     162                        'wcpt-debrief-schedul',
     163                        'wcpt-closed',
     164
     165                        // back-compat
     166                        'public',
     167                );
     168        }
     169
     170        /**
     171         * Get post statuses for WordCamps on pre-planning schedule.
     172         *
     173         * @return array Post status names.
     174         */
     175        public static function get_pre_planning_post_statuses() {
     176                return array(
     177                        'wcpt-pre-planning',
     178                        'wcpt-needs-budget-re',
     179                        'wcpt-budget-rev-sche',
     180                        'wcpt-needs-contract',
     181                        'wcpt-needs-fill-list',
     182                        'wcpt-needs-schedule',
     183
     184                        // back-compat
     185                        'pending',
     186                );
     187        }
     188
     189        /**
     190         * Get the milestones that correspond to each status
     191         *
     192         * @return array
     193         */
     194        public static function map_statuses_to_milestones() {
     195                $milestones = array(
     196                        'wcpt-needs-vetting'   => 'Application received',
     197                        'wcpt-needs-orientati' => 'Application vetted',
     198                        'wcpt-more-info-reque' => 'Application vetted',
     199                        'wcpt-needs-rejection' => 'Application vetted',
     200                        'wcpt-interview-sched' => 'Interview scheduled',
     201                        'wcpt-rejected'        => 'Sent rejection email',
     202                        'wcpt-cancelled'       => 'WordCamp cancelled',
     203                        'wcpt-approved-pre-pl' => 'Orientation/interview held',
     204                        'wcpt-needs-email'     => 'Organizer agreement signed',
     205                        'wcpt-needs-site'      => 'Email address/fwd set up',
     206                        'wcpt-needs-polldaddy' => 'Site created',
     207                        'wcpt-needs-mentor'    => 'Polldaddy account created',
     208                        'wcpt-needs-pre-plann' => 'Mentor assigned',
     209                        'wcpt-pre-planning'    => 'Added to pre-planning schedule',
     210                        'wcpt-needs-budget-re' => 'Budget review requested',
     211                        'wcpt-budget-rev-sche' => 'Budget review scheduled',
     212                        'wcpt-needs-contract'  => 'Budget approved',
     213                        'wcpt-needs-fill-list' => 'Contract signed',
     214                        'wcpt-needs-schedule'  => 'WordCamp listing filled out',
     215                        'wcpt-scheduled'       => 'WordCamp added to official schedule',
     216                        'wcpt-needs-debrief'   => 'WordCamp held',
     217                        'wcpt-debrief-schedul' => 'Debrief scheduled',
     218                        'wcpt-closed'          => 'Debrief held',
     219                );
     220
     221                return $milestones;
     222        }
     223
     224        /**
     225         * Return valid transitions given a post status.
     226         *
     227         * @param string $status Current status.
     228         *
     229         * @return array Valid transitions.
     230         */
     231        public static function get_valid_status_transitions( $status ) {
     232                $transitions = array(
     233                        'wcpt-needs-vetting'   => array( 'wcpt-needs-orientati', 'wcpt-more-info-reque', 'wcpt-needs-rejection' ),
     234                        'wcpt-needs-orientati' => array( 'wcpt-needs-vetting', 'wcpt-interview-sched' ),
     235                        'wcpt-more-info-reque' => array(),  // Allowed from any status, see below
     236                        'wcpt-needs-rejection' => array( 'wcpt-needs-vetting', 'wcpt-rejected' ),
     237                        'wcpt-interview-sched' => array( 'wcpt-needs-orientati', 'wcpt-approved-pre-pl' ),
     238                        'wcpt-rejected'        => array( 'wcpt-needs-rejection' ),
     239                        'wcpt-cancelled'       => array(),  // Allowed from any status, see below
     240                        'wcpt-approved-pre-pl' => array( 'wcpt-interview-sched', 'wcpt-needs-email' ),
     241                        'wcpt-needs-email'     => array( 'wcpt-approved-pre-pl', 'wcpt-needs-site' ),
     242                        'wcpt-needs-site'      => array( 'wcpt-needs-email', 'wcpt-needs-polldaddy' ),
     243                        'wcpt-needs-polldaddy' => array( 'wcpt-needs-site', 'wcpt-needs-mentor' ),
     244                        'wcpt-needs-mentor'    => array( 'wcpt-needs-polldaddy', 'wcpt-needs-pre-plann' ),
     245                        'wcpt-needs-pre-plann' => array( 'wcpt-needs-mentor', 'wcpt-pre-planning' ),
     246                        'wcpt-pre-planning'    => array( 'wcpt-needs-pre-plann', 'wcpt-needs-budget-re' ),
     247                        'wcpt-needs-budget-re' => array( 'wcpt-pre-planning', 'wcpt-budget-rev-sche' ),
     248                        'wcpt-budget-rev-sche' => array( 'wcpt-needs-budget-re', 'wcpt-needs-contract' ),
     249                        'wcpt-needs-contract'  => array( 'wcpt-budget-rev-sche', 'wcpt-needs-fill-list' ),
     250                        'wcpt-needs-fill-list' => array( 'wcpt-needs-contract', 'wcpt-needs-schedule' ),
     251                        'wcpt-needs-schedule'  => array( 'wcpt-needs-fill-list', 'wcpt-scheduled' ),
     252                        'wcpt-scheduled'       => array( 'wcpt-needs-schedule', 'wcpt-needs-debrief' ),
     253                        'wcpt-needs-debrief'   => array( 'wcpt-scheduled', 'wcpt-debrief-schedul' ),
     254                        'wcpt-debrief-schedul' => array( 'wcpt-needs-debrief', 'wcpt-closed' ),
     255                        'wcpt-closed'          => array( 'wcpt-debrief-schedul' ),
     256                );
     257
     258                // Cancelled and More Info Requested can be switched to from any status.
     259                foreach ( array_keys( $transitions ) as $key ) {
     260                        $transitions[ $key ][] = 'wcpt-more-info-reque';
     261                        $transitions[ $key ][] = 'wcpt-cancelled';
     262                }
     263
     264                // Any status can be switched to from More Info Requested and Cancelled.
     265                foreach ( array( 'wcpt-more-info-reque', 'wcpt-cancelled' ) as $key ) {
     266                        $transitions[ $key ] = array_keys( $transitions );
     267                }
     268
     269                if ( empty( $transitions[ $status ] ) )
     270                        return array( 'wcpt-needs-vetting' );
     271
     272                return $transitions[ $status ];
    181273        }
    182274}
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php

    r2859 r2898  
    100100                }
    101101
    102                 $url = parse_url( $url );
    103                 if ( ! $url || empty( $url['scheme'] ) || empty( $url['host'] ) ) {
     102                $url_components = parse_url( $url );
     103                if ( ! $url_components || empty( $url_components['scheme'] ) || empty( $url_components['host'] ) ) {
    104104                        return;
    105105                }
    106                 $path = isset( $url['path'] ) ? $url['path'] : '';
     106                $path = isset( $url_components['path'] ) ? $url_components['path'] : '';
    107107
    108108                $wordcamp_meta     = get_post_custom( $wordcamp_id );
    109109                $lead_organizer    = $this->get_user_or_current_user( $wordcamp_meta['WordPress.org Username'][0]  );
    110110                $site_meta         = array( 'public' => 1 );
    111                 $this->new_site_id = wpmu_create_blog( $url['host'], $path, 'WordCamp Event', $lead_organizer->ID, $site_meta );
     111                $this->new_site_id = wpmu_create_blog( $url_components['host'], $path, 'WordCamp Event', $lead_organizer->ID, $site_meta );
    112112
    113113                if ( is_int( $this->new_site_id ) ) {
     
    117117                        // Configure the new site at priority 11, after all the custom fields on the `wordcamp` post have been saved, so that we don't use outdated values
    118118                        add_action( 'save_post', array( $this, 'configure_new_site' ), 11, 2 );
     119
     120                        add_post_meta( $wordcamp_id, '_note', array(
     121                                'timestamp' => time(),
     122                                'user_id'   => get_current_user_id(),
     123                                'message'   => sprintf( 'Created site at <a href="%s">%s</a>', $url, $url ),
     124                        ) );
    119125                }
    120126        }
     
    199205                // Make sure the new blog is https.
    200206                update_option( 'siteurl', set_url_scheme( get_option( 'siteurl' ), 'https' ) );
    201                 update_option( 'home', set_url_scheme( get_option( 'home' ), 'https' ) );
     207                update_option( 'home',    set_url_scheme( get_option( 'home' ),    'https' ) );
    202208        }
    203209
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-template.php

    r1652 r2898  
    1414 * @return object Multidimensional array of WordCamp information
    1515 */
    16 function wcpt_has_wordcamps ( $args = '' ) {
     16function wcpt_has_wordcamps( $args = '' ) {
    1717        global $wcpt_template;
    1818
    19         $default = array (
     19        $default = array(
    2020                // Narrow query down to WordCamp Post Type
    2121                'post_type'        => WCPT_POST_TYPE_ID,
     
    8484 * @return object WordCamp information
    8585 */
    86 function wcpt_wordcamps () {
     86function wcpt_wordcamps() {
    8787        global $wcpt_template;
    8888        return $wcpt_template->have_posts();
     
    101101 * @return object WordCamp information
    102102 */
    103 function wcpt_the_wordcamp () {
     103function wcpt_the_wordcamp() {
    104104        global $wcpt_template;
    105105        return $wcpt_template->the_post();
     
    117117 * @uses wcpt_get_wordcamp_id()
    118118 */
    119 function wcpt_wordcamp_id () {
     119function wcpt_wordcamp_id() {
    120120        echo wcpt_get_wordcamp_id();
    121121}
     
    131131         * @return string WordCamp id
    132132         */
    133         function wcpt_get_wordcamp_id () {
     133        function wcpt_get_wordcamp_id() {
    134134                global $wcpt_template;
    135135
     
    154154 * @uses wcpt_get_wordcamp_permalink()
    155155 */
    156 function wcpt_wordcamp_permalink ( $wordcamp_id = 0 ) {
     156function wcpt_wordcamp_permalink( $wordcamp_id = 0 ) {
    157157        echo wcpt_get_wordcamp_permalink( $wordcamp_id );
    158158}
     
    171171         * @return string Permanent link to WordCamp
    172172         */
    173         function wcpt_get_wordcamp_permalink ( $wordcamp_id = 0 ) {
     173        function wcpt_get_wordcamp_permalink( $wordcamp_id = 0 ) {
    174174                if ( empty( $wordcamp_id ) )
    175175                        $wordcamp_id = wcpt_get_wordcamp_id();
     
    190190 * @uses wcpt_get_wordcamp_title()
    191191 */
    192 function wcpt_wordcamp_title ( $wordcamp_id = 0 ) {
     192function wcpt_wordcamp_title( $wordcamp_id = 0 ) {
    193193        echo wcpt_get_wordcamp_title( $wordcamp_id );
    194194}
     
    208208         *
    209209         */
    210         function wcpt_get_wordcamp_title ( $wordcamp_id = 0 ) {
     210        function wcpt_get_wordcamp_title( $wordcamp_id = 0 ) {
    211211                return apply_filters( 'wcpt_get_wordcamp_title', get_the_title( $wordcamp_id ) );
    212212        }
     
    224224 * @uses wcpt_get_wordcamp_link()
    225225 */
    226 function wcpt_wordcamp_link ( $wordcamp_id = 0 ) {
     226function wcpt_wordcamp_link( $wordcamp_id = 0 ) {
    227227        echo wcpt_get_wordcamp_link( $wordcamp_id );
    228228}
     
    242242         *
    243243         */
    244         function wcpt_get_wordcamp_link ( $wordcamp_id = 0 ) {
     244        function wcpt_get_wordcamp_link( $wordcamp_id = 0 ) {
    245245
    246246                $title = get_the_title( $wordcamp_id );
     
    269269 * @param int $wordcamp_id optional
    270270 */
    271 function wcpt_wordcamp_start_date ( $wordcamp_id = 0, $format = 'F j, Y' ) {
     271function wcpt_wordcamp_start_date( $wordcamp_id = 0, $format = 'F j, Y' ) {
    272272        echo wcpt_get_wordcamp_start_date( $wordcamp_id, $format );
    273273}
     
    284284         * @param int $wordcamp_id optional
    285285         */
    286         function wcpt_get_wordcamp_start_date ( $wordcamp_id = 0, $format = 'F j, Y' ) {
     286        function wcpt_get_wordcamp_start_date( $wordcamp_id = 0, $format = 'F j, Y' ) {
    287287                if ( empty( $wordcamp_id ) )
    288288                        $wordcamp_id = wcpt_get_wordcamp_id();
     
    306306 * @param int $wordcamp_id optional
    307307 */
    308 function wcpt_wordcamp_end_date ( $wordcamp_id = 0, $format = 'F j, Y' ) {
     308function wcpt_wordcamp_end_date( $wordcamp_id = 0, $format = 'F j, Y' ) {
    309309        echo wcpt_get_wordcamp_end_date( $wordcamp_id, $format );
    310310}
     
    321321         * @param int $wordcamp_id optional
    322322         */
    323         function wcpt_get_wordcamp_end_date ( $wordcamp_id = 0, $format = 'F j, Y' ) {
     323        function wcpt_get_wordcamp_end_date( $wordcamp_id = 0, $format = 'F j, Y' ) {
    324324                if ( empty( $wordcamp_id ) )
    325325                        $wordcamp_id = wcpt_get_wordcamp_id();
     
    343343 * @param int $wordcamp_id optional
    344344 */
    345 function wcpt_wordcamp_location ( $wordcamp_id = 0 ) {
     345function wcpt_wordcamp_location( $wordcamp_id = 0 ) {
    346346        echo wcpt_get_wordcamp_location( $wordcamp_id );
    347347}
     
    358358         * @param int $wordcamp_id optional
    359359         */
    360         function wcpt_get_wordcamp_location ( $wordcamp_id = 0 ) {
     360        function wcpt_get_wordcamp_location( $wordcamp_id = 0 ) {
    361361                if ( empty( $wordcamp_id ) )
    362362                        $wordcamp_id = wcpt_get_wordcamp_id();
     
    377377 * @param int $wordcamp_id optional
    378378 */
    379 function wcpt_wordcamp_organizer_name ( $wordcamp_id = 0 ) {
     379function wcpt_wordcamp_organizer_name( $wordcamp_id = 0 ) {
    380380        echo wcpt_get_wordcamp_organizer_name( $wordcamp_id );
    381381}
     
    392392         * @param int $wordcamp_id optional
    393393         */
    394         function wcpt_get_wordcamp_organizer_name ( $wordcamp_id = 0 ) {
     394        function wcpt_get_wordcamp_organizer_name( $wordcamp_id = 0 ) {
    395395                if ( empty( $wordcamp_id ) )
    396396                        $wordcamp_id = wcpt_get_wordcamp_id();
     
    411411 * @param int $wordcamp_id optional
    412412 */
    413 function wcpt_wordcamp_venue_name ( $wordcamp_id = 0 ) {
     413function wcpt_wordcamp_venue_name( $wordcamp_id = 0 ) {
    414414        echo wcpt_get_wordcamp_venue_name( $wordcamp_id );
    415415}
     
    426426         * @param int $wordcamp_id optional
    427427         */
    428         function wcpt_get_wordcamp_venue_name ( $wordcamp_id = 0 ) {
     428        function wcpt_get_wordcamp_venue_name( $wordcamp_id = 0 ) {
    429429                if ( empty( $wordcamp_id ) )
    430430                        $wordcamp_id = wcpt_get_wordcamp_id();
     
    445445 * @param int $wordcamp_id optional
    446446 */
    447 function wcpt_wordcamp_url ( $wordcamp_id = 0 ) {
     447function wcpt_wordcamp_url( $wordcamp_id = 0 ) {
    448448        echo wcpt_get_wordcamp_url( $wordcamp_id );
    449449}
     
    460460         * @param int $wordcamp_id optional
    461461         */
    462         function wcpt_get_wordcamp_url ( $wordcamp_id = 0 ) {
     462        function wcpt_get_wordcamp_url( $wordcamp_id = 0 ) {
    463463                if ( empty( $wordcamp_id ) )
    464464                        $wordcamp_id = wcpt_get_wordcamp_id();
     
    478478 * @global WP_Query $wcpt_template
    479479 */
    480 function wcpt_wordcamp_pagination_count () {
     480function wcpt_wordcamp_pagination_count() {
    481481        echo wcpt_get_wordcamp_pagination_count();
    482482}
     
    493493         * @return string
    494494         */
    495         function wcpt_get_wordcamp_pagination_count () {
     495        function wcpt_get_wordcamp_pagination_count() {
    496496                global $wcpt_template;
    497497
     
    521521 * @since WordCamp Post Type (0.1)
    522522 */
    523 function wcpt_wordcamp_pagination_links () {
     523function wcpt_wordcamp_pagination_links() {
    524524        echo wcpt_get_wordcamp_pagination_links();
    525525}
     
    536536         * @return string
    537537         */
    538         function wcpt_get_wordcamp_pagination_links () {
     538        function wcpt_get_wordcamp_pagination_links() {
    539539                global $wcpt_template;
    540540
     
    547547 */
    548548if ( ! function_exists( 'wcpt_wordcamp_physical_address' ) ) :
    549 function wcpt_wordcamp_physical_address( $wordcamp_id = 0 ) {
    550         echo wp_filter_kses( nl2br( wcpt_get_wordcamp_physical_address( $wordcamp_id ) ) );
    551 }
     549        function wcpt_wordcamp_physical_address( $wordcamp_id = 0 ) {
     550                echo wp_filter_kses( nl2br( wcpt_get_wordcamp_physical_address( $wordcamp_id ) ) );
     551        }
    552552endif;
    553553
    554         if ( ! function_exists( 'wcpt_get_wordcamp_physical_address' ) ) :
     554if ( ! function_exists( 'wcpt_get_wordcamp_physical_address' ) ) :
    555555        function wcpt_get_wordcamp_physical_address( $wordcamp_id = 0 ) {
    556556                if ( empty( $wordcamp_id ) )
     
    560560                return apply_filters( 'wcpt_get_wordcamp_physical_address', $address );
    561561        }
    562         endif;
     562endif;
    563563
    564564if ( ! function_exists( 'wcpt_wordcamp_venue_url' ) ) :
    565 function wcpt_wordcamp_venue_url( $wordcamp_id = 0 ) {
    566         echo esc_url( wcpt_get_wordcamp_venue_url( $wordcamp_id ) );
    567 }
     565        function wcpt_wordcamp_venue_url( $wordcamp_id = 0 ) {
     566                echo esc_url( wcpt_get_wordcamp_venue_url( $wordcamp_id ) );
     567        }
    568568endif;
    569569
    570         if ( ! function_exists( 'wcpt_get_wordcamp_venue_url' ) ) :
     570if ( ! function_exists( 'wcpt_get_wordcamp_venue_url' ) ) :
    571571        function wcpt_get_wordcamp_venue_url( $wordcamp_id = 0 ) {
    572572                if ( empty( $wordcamp_id ) )
     
    576576                return apply_filters( 'wcpt_get_wordcamp_venue_url', $venue_url );
    577577        }
    578         endif;
     578endif;
    579579
    580580if ( ! function_exists( 'wcpt_get_wordcamp_twitter_screen_name' ) ) :
    581 function wcpt_get_wordcamp_twitter_screen_name( $wordcamp_id = 0 ) {
    582         if ( empty( $wordcamp_id ) )
    583                 $wordcamp_id = wcpt_get_wordcamp_id();
    584                
    585         $screen_name = get_post_meta( $wordcamp_id, 'Twitter', true );
    586         return apply_filters( 'wcpt_get_wordcamp_twitter_screen_name', $screen_name );
    587 }
     581        function wcpt_get_wordcamp_twitter_screen_name( $wordcamp_id = 0 ) {
     582                if ( empty( $wordcamp_id ) )
     583                        $wordcamp_id = wcpt_get_wordcamp_id();
     584
     585                $screen_name = get_post_meta( $wordcamp_id, 'Twitter', true );
     586                return apply_filters( 'wcpt_get_wordcamp_twitter_screen_name', $screen_name );
     587        }
    588588endif;
    589589
     
    648648 */
    649649function add_wordcamp_feed_link_to_head() {
    650         if ( ! is_post_type_archive( 'wordcamp' ) ) {
     650        if ( ! is_post_type_archive( WCPT_POST_TYPE_ID ) ) {
    651651                ?>
    652652               
    653                 <link rel="alternate" type="<?php echo esc_attr( feed_content_type() ); ?>" title="New WordCamp Announcements" href="<?php echo esc_url( get_post_type_archive_feed_link( 'wordcamp' ) ); ?>" />
     653                <link rel="alternate" type="<?php echo esc_attr( feed_content_type() ); ?>" title="New WordCamp Announcements" href="<?php echo esc_url( get_post_type_archive_feed_link( WCPT_POST_TYPE_ID ) ); ?>" />
    654654       
    655655                <?php
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-api/classes/ics.php

    r481 r2898  
    5353
    5454                $query = new WP_Query( array(
    55                         'post_type'              => WCPT_POST_TYPE_ID,
     55                        'post_type'      => WCPT_POST_TYPE_ID,
     56                        'post_status'    => array(
     57                                'wcpt-scheduled',
     58                                'wcpt-needs-debrief',
     59                                'wcpt-debrief-schedul',
     60                                'wcpt-closed',
     61
     62                                // back-compat
     63                                'publish',
     64                        ),
    5665                        'posts_per_page' => 50,
    5766                        'meta_key'       => 'Start Date (YYYY-mm-dd)',
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-organizer-reminders/wcor-mailer.php

    r2156 r2898  
    77class WCOR_Mailer {
    88        public $triggers;
    9        
     9
    1010        /**
    1111         * Constructor
     
    6161                        ),
    6262                );
    63                
     63
    6464                add_action( 'wcor_send_timed_emails', array( $this, 'send_timed_emails' ) );
    65                
     65
    6666                foreach ( $this->triggers as $trigger_id => $trigger ) {
    6767                        foreach( $trigger['actions'] as $action ) {
     
    7272
    7373        /**
    74          * Schedule cron job when plugin is activated 
     74         * Schedule cron job when plugin is activated
    7575         */
    7676        public function activate() {
     
    8383                }
    8484        }
    85        
     85
    8686        /**
    8787         * Clear cron job when plugin is deactivated
     
    9494         * Wrapper for wp_mail() that customizes the subject, body and headers
    9595         *
    96          * We want to make sure that replies go to support@wordcamp.org, rather than the fake address that WordPress sends from, but 
     96         * We want to make sure that replies go to support@wordcamp.org, rather than the fake address that WordPress sends from, but
    9797         * we don't want to be flagged as spam for forging the From header, so we set the Sender header.
    9898         * @see http://stackoverflow.com/q/4728393/450127
     
    213213                        '[safety_wrangler_name]',
    214214                        '[safety_wrangler_email]',
    215                        
     215
    216216                        // Venue
    217217                        '[venue_name]',
     
    287287                        $this->get_mes_info( $wordcamp->ID ),
    288288                );
    289                
     289
    290290                return str_replace( $search, $replace, $content );
    291291        }
     
    454454                return $this->mail( $recipient, $email->post_title, $email->post_content, array(), $email, $wordcamp );
    455455        }
    456        
     456
    457457        /**
    458458         * Send e-mails that are scheduled to go out at a specific time (e.g., 3 days before the camp)
     
    462462                        'posts_per_page'  => -1,
    463463                        'post_type'       => 'wordcamp',
     464                        'post_status'     => WordCamp_Loader::get_public_post_statuses(),
    464465                        'meta_query'      => array(
    465466                                array(
     
    474475                        'posts_per_page'  => -1,
    475476                        'post_type'       => WCPT_POST_TYPE_ID,
    476                         'post_status'     => 'pending',
     477                        'post_status'     => WordCamp_Loader::get_pre_planning_post_statuses(),
    477478                ) );
    478479
     
    490491                        ),
    491492                ) );
    492                
     493
    493494                foreach ( $wordcamps as $wordcamp ) {
    494495                        $sent_email_ids = (array) get_post_meta( $wordcamp->ID, 'wcor_sent_email_ids', true );
     
    496497                        foreach ( $reminder_emails as $email ) {
    497498                                $recipient = $this->get_recipients( $wordcamp->ID, $email->ID );
    498                                
     499
    499500                                if ( $this->timed_email_is_ready_to_send( $wordcamp, $email, $sent_email_ids ) ) {
    500501                                        if ( $this->mail( $recipient, $email->post_title, $email->post_content, array(), $email, $wordcamp ) ) {
     
    520521         * @todo It'd be nice to have some unit tests for this function, since there are a lot of different cases, but it seems like that might be
    521522         * hard to do because of having to mock get_post_meta(), current_time(), etc. We could pass that info in, but that doesn't seem very elegant.
    522          *       
     523         *
    523524         * @param WP_Post $wordcamp
    524525         * @param WP_Post $email
     
    544545                        if ( 'wcor_send_before' == $send_when ) {
    545546                                $days_before = absint( get_post_meta( $email->ID, 'wcor_send_days_before', true ) );
    546                                
     547
    547548                                if ( $start_date && $days_before ) {
    548549                                        $send_date = $start_date - ( $days_before * DAY_IN_SECONDS );
    549                                        
     550
    550551                                        if ( $send_date <= current_time( 'timestamp' ) ) {
    551552                                                $ready = true;
     
    557558                                if ( $end_date && $days_after ) {
    558559                                        $send_date = $end_date + ( $days_after * DAY_IN_SECONDS );
    559                                        
     560
    560561                                        if ( $send_date <= current_time( 'timestamp' ) ) {
    561562                                                $ready = true;
     
    575576                        }
    576577                }
    577                
     578
    578579                return $ready;
    579580        }
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-organizer-reminders/wcor-reminder.php

    r2152 r2898  
    5353                        'supports'            => array( 'title', 'editor', 'author', 'revisions' ),
    5454                );
    55                
     55
    5656                register_post_type( self::POST_TYPE_SLUG, $params );
    5757        }
     
    108108                                        <td colspan="2"><label for="wcor_send_sponsor_wrangler">The Sponsor Wrangler</label></td>
    109109                                </tr>
    110                                
     110
    111111                                <tr>
    112112                                        <th><input id="wcor_send_budget_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_budget_wrangler" <?php checked( in_array( 'wcor_send_budget_wrangler', $send_where ) ); ?>></th>
    113113                                        <td colspan="2"><label for="wcor_send_budget_wrangler">The Budget Wrangler</label></td>
    114114                                </tr>
    115                                
     115
    116116                                <tr>
    117117                                        <th><input id="wcor_send_venue_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_venue_wrangler" <?php checked( in_array( 'wcor_send_venue_wrangler', $send_where ) ); ?>></th>
    118118                                        <td colspan="2"><label for="wcor_send_venue_wrangler">The Venue Wrangler</label></td>
    119119                                </tr>
    120                                
     120
    121121                                <tr>
    122122                                        <th><input id="wcor_send_speaker_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_speaker_wrangler" <?php checked( in_array( 'wcor_send_speaker_wrangler', $send_where ) ); ?>></th>
    123123                                        <td colspan="2"><label for="wcor_send_speaker_wrangler">The Speaker Wrangler</label></td>
    124124                                </tr>
    125                                
     125
    126126                                <tr>
    127127                                        <th><input id="wcor_send_food_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_food_wrangler" <?php checked( in_array( 'wcor_send_food_wrangler', $send_where ) ); ?>></th>
    128128                                        <td colspan="2"><label for="wcor_send_food_wrangler">The Food/Beverage Wrangler</label></td>
    129129                                </tr>
    130                                
     130
    131131                                <tr>
    132132                                        <th><input id="wcor_send_swag_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_swag_wrangler" <?php checked( in_array( 'wcor_send_swag_wrangler', $send_where ) ); ?>></th>
    133133                                        <td colspan="2"><label for="wcor_send_swag_wrangler">The Swag Wrangler</label></td>
    134134                                </tr>
    135                                
     135
    136136                                <tr>
    137137                                        <th><input id="wcor_send_volunteer_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_volunteer_wrangler" <?php checked( in_array( 'wcor_send_volunteer_wrangler', $send_where ) ); ?>></th>
    138138                                        <td colspan="2"><label for="wcor_send_volunteer_wrangler">The Volunteer Wrangler</label></td>
    139139                                </tr>
    140                                
     140
    141141                                <tr>
    142142                                        <th><input id="wcor_send_printing_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_printing_wrangler" <?php checked( in_array( 'wcor_send_printing_wrangler', $send_where ) ); ?>></th>
    143143                                        <td colspan="2"><label for="wcor_send_printing_wrangler">The Printing Wrangler</label></td>
    144144                                </tr>
    145                                
     145
    146146                                <tr>
    147147                                        <th><input id="wcor_send_design_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_design_wrangler" <?php checked( in_array( 'wcor_send_design_wrangler', $send_where ) ); ?>></th>
    148148                                        <td colspan="2"><label for="wcor_send_design_wrangler">The Design Wrangler</label></td>
    149149                                </tr>
    150                                
     150
    151151                                <tr>
    152152                                        <th><input id="wcor_send_website_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_website_wrangler" <?php checked( in_array( 'wcor_send_website_wrangler', $send_where ) ); ?>></th>
    153153                                        <td colspan="2"><label for="wcor_send_website_wrangler">The Website Wrangler</label></td>
    154154                                </tr>
    155                                
     155
    156156                                <tr>
    157157                                        <th><input id="wcor_send_social_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_social_wrangler" <?php checked( in_array( 'wcor_send_social_wrangler', $send_where ) ); ?>></th>
    158158                                        <td colspan="2"><label for="wcor_send_social_wrangler">The Social Media/Publicity Wrangler</label></td>
    159159                                </tr>
    160                                
     160
    161161                                <tr>
    162162                                        <th><input id="wcor_send_a_v_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_a_v_wrangler" <?php checked( in_array( 'wcor_send_a_v_wrangler', $send_where ) ); ?>></th>
    163163                                        <td colspan="2"><label for="wcor_send_a_v_wrangler">The A/V Wrangler</label></td>
    164164                                </tr>
    165                                
     165
    166166                                <tr>
    167167                                        <th><input id="wcor_send_party_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_party_wrangler" <?php checked( in_array( 'wcor_send_party_wrangler', $send_where ) ); ?>></th>
    168168                                        <td colspan="2"><label for="wcor_send_party_wrangler">The Party Wrangler</label></td>
    169169                                </tr>
    170                                
     170
    171171                                <tr>
    172172                                        <th><input id="wcor_send_travel_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_travel_wrangler" <?php checked( in_array( 'wcor_send_travel_wrangler', $send_where ) ); ?>></th>
    173173                                        <td colspan="2"><label for="wcor_send_travel_wrangler">The Travel Wrangler</label></td>
    174174                                </tr>
    175                                
     175
    176176                                <tr>
    177177                                        <th><input id="wcor_send_safety_wrangler" name="wcor_send_where[]" type="checkbox" value="wcor_send_safety_wrangler" <?php checked( in_array( 'wcor_send_safety_wrangler', $send_where ) ); ?>></th>
     
    196196                        </tbody>
    197197                </table>
    198                
    199                
     198
     199
    200200                <h4>When should this e-mail be sent?</h4>
    201201
     
    235235                                                <select name="wcor_which_trigger">
    236236                                                        <option value="null" <?php selected( $which_trigger, false ); ?>></option>
    237                                                        
     237
    238238                                                        <?php foreach ( $GLOBALS['WCOR_Mailer']->triggers as $trigger_id => $trigger ) : ?>
    239239                                                                <option value="<?php echo esc_attr( $trigger_id ); ?>" <?php selected( $which_trigger, $trigger_id ); ?>><?php echo esc_html( $trigger['name'] ); ?></option>
     
    365365                }
    366366
     367                $statuses = WordCamp_Loader::get_post_statuses();
     368                $statuses = array_merge( array_keys( $statuses ), array( 'draft', 'pending', 'publish' ) );
     369
    367370                $wordcamps = get_posts( array(
    368371                        'post_type'   => WCPT_POST_TYPE_ID,
    369                         'post_status' => array( 'draft', 'pending', 'publish' ),
     372                        'post_status' => $statuses,
    370373                        'numberposts' => -1,
    371374                ) );
     
    438441        /**
    439442         * Checks to make sure the conditions for saving post meta are met
    440          * 
     443         *
    441444         * @param int $post_id
    442445         * @param object $post
     
    456459                        return;
    457460                }
    458                
     461
    459462                $this->save_post_meta( $post, $_POST );
    460463                $this->send_manual_email( $post, $_POST );
     
    463466        /**
    464467         * Saves the meta data for the reminder post
    465          * 
     468         *
    466469         * @param WP_Post $post
    467470         * @param array $new_meta
     
    481484                if ( isset( $new_meta['wcor_send_custom_address'] ) && is_email( $new_meta['wcor_send_custom_address'] ) ) {
    482485                        update_post_meta( $post->ID, 'wcor_send_custom_address', sanitize_email( $new_meta['wcor_send_custom_address'] ) );
    483                 }               
    484                
     486                }
     487
    485488                if ( isset( $new_meta['wcor_send_when'] ) ) {
    486489                        if ( in_array( $new_meta['wcor_send_when'], array( 'wcor_send_before', 'wcor_send_after', 'wcor_send_after_pending', 'wcor_send_trigger' ) ) ) {
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments

  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network

  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-site-cloner/wordcamp-site-cloner.php

    r2745 r2898  
    120120        $wordcamps = get_posts( array(
    121121                'post_type'      => 'wordcamp',
    122                 'post_status'    => 'publish',
     122                'post_status'    => WordCamp_Loader::get_public_post_statuses(),
    123123                'posts_per_page' => 125, // todo temporary workaround until able to add filters to make hundreds of sites manageable
    124124                'meta_key'       => 'Start Date (YYYY-mm-dd)',
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php

    r2402 r2898  
    4040
    4141                add_filter( 'excerpt_more', array( __CLASS__, 'excerpt_more' ), 11 );
    42                 // add_filter( 'wcpt_register_post_type', array( __CLASS__, 'wcpt_register_post_type' ) ); // set to public in wcpt plugin
    4342                add_filter( 'nav_menu_css_class', array( __CLASS__, 'nav_menu_css_class' ), 10, 3 );
    4443                add_filter( 'wp_nav_menu_items', array( __CLASS__, 'add_links_to_footer_menu' ), 10, 2 );
     
    277276                        'post_type'      => 'wordcamp',
    278277                        'posts_per_page' => -1,
     278                        'post_status'    => array_merge(
     279                                WordCamp_Loader::get_public_post_statuses(),
     280                                WordCamp_Loader::get_pre_planning_post_statuses()
     281                        ),
    279282                );
    280283
    281284                switch( $map_id ) {
    282285                        case 'schedule':
    283                                 $parameters['post_status'][] = array( 'publish', 'pending' );
    284286                                $parameters['meta_query'][] = array(
    285287                                        'key'     => 'Start Date (YYYY-mm-dd)',
     
    329331        static function excerpt_more( $more ) {
    330332                return '&nbsp;&hellip;';
    331         }
    332 
    333         /**
    334          * Filters wcpt_register_post_type, sets post type to public.
    335          * @todo move to wcpt_register_post_types when ready.
    336          */
    337         static function wcpt_register_post_type( $args ) {
    338                 $args['public'] = true;
    339                 return $args;
    340333        }
    341334
     
    704697                $query = new WP_Query( array(
    705698                        'post_type'              => WCPT_POST_TYPE_ID,
     699                        'post_status'    => WordCamp_Loader::get_public_post_statuses(),
    706700                        'posts_per_page' => $count,
    707701                        'meta_key'       => 'Start Date (YYYY-mm-dd)',
     
    816810                        $wordcamps = new WP_Query( array(
    817811                                'post_type'      => 'wordcamp',
     812                                'post_status'    => WordCamp_Loader::get_public_post_statuses(),
    818813                                'posts_per_page' => -1,
    819814                        ) );
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/sidebar-schedule.php

    r842 r2898  
    1111                        ?>
    1212
    13                         <?php 
     13                        <?php
    1414                                // Get the upcoming approved (published) WordCamps *with dates*
    1515                                $args = array(
    1616                                        'posts_per_page' => -1,
    17                                         'post_status'    => 'pending',
     17                                        'post_status' => WordCamp_Loader::get_pre_planning_post_statuses(),
    1818                                        'meta_key'       => 'Start Date (YYYY-mm-dd)',
    1919                                        'orderby'        => 'meta_value',
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/single-wordcamp.php

    r842 r2898  
    8181                                        'posts_per_page' => 30,
    8282                                        'post_type' => 'wordcamp',
    83                                         'post_status' => 'any',
     83                                        'post_status' => WordCamp_Loader::get_public_post_statuses(),
    8484                                        'orderby' => 'ID',
    8585                                        's' => $wordcamp_title,
     
    9595                                                'posts_per_page' => 30,
    9696                                                'order'          => 'ASC',
    97                                                 'post_status'    => 'any',
     97                                                'post_status'    => WordCamp_Loader::get_public_post_statuses(),
    9898                                                'post__in'       => wp_list_pluck( $wordcamps, 'ID' ),
    9999                                        ) )
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/template-home.php

    r1105 r2898  
    1717                        if ( function_exists( 'wcpt_has_wordcamps' ) &&
    1818                                wcpt_has_wordcamps( array(
     19                                        'post_status' => array(
     20                                                'wcpt-scheduled',
     21                                                'wcpt-needs-debrief',
     22                                                'wcpt-debrief-schedul',
     23                                                'wcpt-closed',
     24
     25                                                // back-compat
     26                                                'publish',
     27                                        ),
    1928                                        'posts_per_page' => 5,
    2029                                        'meta_key'       => 'Start Date (YYYY-mm-dd)',
     
    5867                                        $formats[$i] = 'post-format-' . $format;
    5968
    60                                 $news = new WP_Query( array( 
    61                                         'posts_per_page' => 1, 
     69                                $news = new WP_Query( array(
     70                                        'posts_per_page' => 1,
    6271                                        'ignore_sticky_posts' => 1,
    6372                                        'tax_query' => array(
     
    8594                        <?php endif; ?>
    8695
    87                         <a href="<?php echo home_url( '/news/' ); ?>" class="more">More News &rarr;</a> 
     96                        <a href="<?php echo home_url( '/news/' ); ?>" class="more">More News &rarr;</a>
    8897
    8998                </div><!-- .wc-news -->
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/template-past-wordcamps.php

    r1143 r2898  
    1111                <div id="container" class="wc-schedule">
    1212                        <div id="content" role="main">
    13                                
     13
    1414                                <?php if ( have_posts() ) : the_post(); ?>
    1515
     
    2222
    2323                                <?php endif; // end of the loop. ?>
    24                                
     24
    2525                                        <?php // Get the upcoming approved (published) WordCamps
    2626                                        if ( function_exists( 'wcpt_has_wordcamps' ) &&
    2727                                                wcpt_has_wordcamps( array(
     28                                                        'post_status' => array(
     29                                                                'wcpt-needs-debrief',
     30                                                                'wcpt-debrief-schedul',
     31                                                                'wcpt-closed',
     32
     33                                                                // back-compat
     34                                                                'publish',
     35                                                        ),
    2836                                                        'posts_per_page' => -1,
    2937                                                        'meta_key'       => 'Start Date (YYYY-mm-dd)',
     
    7684                </div><!-- #container -->
    7785
    78 <?php 
     86<?php
    7987        /*get_sidebar( 'schedule' ); */
    80         get_footer(); 
     88        get_footer();
    8189?>
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/template-schedule.php

    r1658 r2898  
    1111                <div id="container" class="wc-schedule">
    1212                        <div id="content" role="main">
    13                                
     13
    1414                                <?php if ( have_posts() ) : the_post(); ?>
    1515
     
    2222
    2323                                <?php endif; // end of the loop. ?>
    24                                
     24
    2525                                        <?php // Get the upcoming approved (published) WordCamps
    2626                                        if ( function_exists( 'wcpt_has_wordcamps' ) &&
    2727                                                wcpt_has_wordcamps( array(
     28                                                        'post_status' => WordCamp_Loader::get_public_post_statuses(),
    2829                                                        'posts_per_page' => -1,
    2930                                                        'meta_key'       => 'Start Date (YYYY-mm-dd)',
     
    3536                                                                'compare'    => '>'
    3637                                                        ) )
    37                                                 ) ) 
     38                                                ) )
    3839                                        ) :
    3940                                        ?>
     
    4142                                        <ul class="wc-schedule-list">
    4243                                        <?php while ( wcpt_wordcamps() ) : wcpt_the_wordcamp(); ?>
    43                                                
     44
    4445                                                <li>
    4546                                                        <a href="<?php echo esc_url( wcpt_get_wordcamp_url() ); ?>">
     
    4950                                                                        <div class="wc-image wp-post-image wordcamp-placeholder-thumb" title="<?php the_title(); ?>"></div>
    5051                                                                <?php endif; ?>
    51                                                                
     52
    5253                                                                <h2 class="wc-title"><?php wcpt_wordcamp_title(); ?></h2>
    5354                                                                <span class="wc-country"><?php wcpt_wordcamp_location(); ?></span>
     
    7778                </div><!-- #container -->
    7879
    79 <?php 
    80         get_sidebar( 'schedule' ); 
     80<?php
     81        get_sidebar( 'schedule' );
    8182        get_footer();
Note: See TracChangeset for help on using the changeset viewer.