Making WordPress.org

Changeset 3159


Ignore:
Timestamp:
05/17/2016 07:52:21 PM (10 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Require E-mail Address for needs-site, not pre-planning.

Since the extra statuses were added in r2898, we can be more specific about when the address is actually needed. Requiring it before then is inconvenient.

File:
1 edited

Legend:

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

    r3126 r3159  
    764764        $min_site_id = apply_filters( 'wcpt_require_complete_meta_min_site_id', '2416297' );
    765765
    766         $required_pre_planning_fields = $this->get_required_fields( 'pre-planning' );
     766        $required_needs_site_fields = $this->get_required_fields( 'needs-site' );
    767767        $required_scheduled_fields    = $this->get_required_fields( 'scheduled' );
     768        // todo realign
    768769
    769770        // Check pending posts
    770         if ( 'wcpt-approved-pre-pl' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
    771             foreach( $required_pre_planning_fields as $field ) {
     771        if ( 'wcpt-needs-site' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
     772            foreach( $required_needs_site_fields as $field ) {
    772773                $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
    773774
    774775                if ( empty( $value ) || 'null' == $value ) {
    775                     $post_data['post_status']     = 'wcpt-interview-sched';
     776                    $post_data['post_status']     = 'wcpt-needs-email';
    776777                    $this->active_admin_notices[] = 1;
    777778                    break;
     
    799800     * Get a list of fields required to move to a certain post status
    800801     *
    801      * @param string $status 'pre-planning' | 'scheduled' | 'any'
     802     * @param string $status 'needs-site' | 'scheduled' | 'any'
    802803     *
    803804     * @return array
    804805     */
    805806    public static function get_required_fields( $status ) {
    806         $pre_planning = array( 'E-mail Address' );
     807        $needs_site = array( 'E-mail Address' );
    807808
    808809        $scheduled = array(
     
    828829
    829830        switch ( $status ) {
    830             case 'pre-planning':
    831                 $required_fields = $pre_planning;
     831            case 'needs-site':
     832                $required_fields = $needs_site;
    832833                break;
    833834
     
    838839            case 'any':
    839840            default:
    840                 $required_fields = array_merge( $pre_planning, $scheduled );
     841                $required_fields = array_merge( $needs_site, $scheduled );
    841842                break;
    842843        }
     
    888889            1 => array(
    889890                'type'   => 'error',
    890                 'notice' => __( 'This WordCamp cannot be approved for pre-planning until all of its required metadata is filled in.', 'wordcamporg' ),
     891                'notice' => __( 'This WordCamp cannot be moved to Needs Site until all of its required metadata is filled in.', 'wordcamporg' ),
    891892            ),
    892893
Note: See TracChangeset for help on using the changeset viewer.