Making WordPress.org

Changeset 113


Ignore:
Timestamp:
11/01/2013 12:19:39 AM (11 years ago)
Author:
iandunn
Message:

WordCamp Organizer Nags: Add a notice if tickets are on sale and a Schedule page isn't published.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-organizer-nags/wordcamp-organizer-nags.php

    r112 r113  
    1919        add_action( 'admin_notices', array( $this, 'print_admin_notices' ) );
    2020        add_action( 'admin_init',    array( $this, 'central_about_info' ) );
    21         add_action( 'admin_init',    array( $this, 'published_attendees_page' ) );
     21        add_action( 'admin_init',    array( $this, 'published_attendees_schedule_pages' ) );
    2222    }
    2323
     
    7070
    7171    /**
    72      * Checks if an Attendees page is published along with the Ticket Registration page
     72     * Checks if Attendees and Schedule pages have been published along with the Ticket Registration page
    7373     */
    74     public function published_attendees_page() {
    75         $found_registration = $found_attendees = false;
     74    public function published_attendees_schedule_pages() {
     75        $found_registration = $found_attendees = $found_schedule = false;
    7676        $published_pages    = get_posts( array(
    7777            'post_type'      => 'page',
     
    8888            }
    8989
    90             if ( $found_registration && $found_attendees ) {
     90            if ( has_shortcode( $page->post_content, 'schedule' ) ) {
     91                $found_schedule = true;
     92            }
     93
     94            if ( $found_registration && $found_attendees && $found_schedule ) {
    9195                break;
    9296            }
     
    96100            $this->notices['updated'][] = 'Tickets are on sale now! Don’t forget to <a href="http://plan.wordcamp.org/using-camptix/#attendees-list">publish an Attendees page</a>, so everyone can see what amazing people are coming to your WordCamp.';
    97101        }
     102
     103        if ( $found_registration && ! $found_schedule ) {
     104            $this->notices['updated'][] = 'Tickets sell a lot faster when people can see who\'s speaking at your WordCamp. How about <a href="http://plan.wordcamp.org/first-steps/web-presence/working-with-speakers-sessions-and-sponsors/#schedule">publishing a schedule</a> today?';
     105        }
    98106    }
    99107}
Note: See TracChangeset for help on using the changeset viewer.