Making WordPress.org

Changeset 4272


Ignore:
Timestamp:
10/19/2016 08:04:15 PM (10 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Return early instead of indenting to improve readability

File:
1 edited

Legend:

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

    r4255 r4272  
    7979                $field_name = wcpt_key_to_str( $key, 'wcpt_' );
    8080
    81                 if ( 'URL' == $key && 'wc-url' == $field_type && isset( $_POST[ $field_name ] ) ) {
     81                if ( 'URL' !== $key || 'wc-url' !== $field_type || ! isset( $_POST[ $field_name ] ) ) {
     82                        return;
     83                }
     84
    8285                        $url = strtolower( substr( $_POST[ $field_name ], 0, 4 ) ) == 'http' ? $_POST[ $field_name ] : 'http://' . $_POST[ $field_name ];
    8386                        $url = set_url_scheme( esc_url_raw( $url ), 'https' );
     
    9396                                return;
    9497                        }
    95                 }
     98
     99                // todo realign
    96100        }
    97101
Note: See TracChangeset for help on using the changeset viewer.