Permalink
Browse files

Swap 'else if' for elseif.

This doesn't address any particular issue besides my own OCD.
  • Loading branch information...
1 parent 63f3d24 commit 61f4624f43d4c4775d8ad6b23bc33edc6a35fe81 @mgsisk committed Jan 22, 2013
View
@@ -767,7 +767,7 @@ class OAuthUtil {
public static function urlencode_rfc3986($input) {
if (is_array($input)) {
return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input);
- } else if (is_scalar($input)) {
+ } elseif (is_scalar($input)) {
return str_replace(
'+',
' ',
View
@@ -173,7 +173,7 @@ public function activate() {
delete_option( 'webcomic_options' );
self::$config[ 'legacy' ] = self::$config[ 'legacy_notice' ] = 3;
- } else if ( $legacy ) {
+ } elseif ( $legacy ) {
self::$config[ 'legacy' ] = self::$config[ 'legacy_notice' ] = version_compare( $legacy, '2', '>=' ) ? 2 : 1;
$legacy_config = array(
@@ -254,7 +254,7 @@ public function activate() {
add_option( 'webcomic_options', self::$config );
wp_schedule_event( ( integer ) current_time( 'timestamp' ), 'daily', 'webcomic_buffer_alert' );
- } else if ( version_compare( self::$config[ 'version' ], self::$version, '<' ) ) {
+ } elseif ( version_compare( self::$config[ 'version' ], self::$version, '<' ) ) {
require_once self::$dir . '-/php/upgrade.php'; new WebcomicUpgrade;
}
@@ -420,7 +420,7 @@ public function admin_head() {
if ( preg_match( '/^(edit-)?webcomic_(transcript|language)$/', $screen->id ) ) {
echo '<style>#icon-edit{background:url("', self::$url, '-/img/transcript.png")}</style>';;
- } else if ( preg_match( '/^(edit-)?webcomic\d+(_storyline|_character)?$/', $screen->id ) ) {
+ } elseif ( preg_match( '/^(edit-)?webcomic\d+(_storyline|_character)?$/', $screen->id ) ) {
echo '<style>#icon-edit{background:url("', self::$url, '-/img/webcomic.png")}</style>';
}
}
View
@@ -972,7 +972,7 @@ public function save( $options ) {
self::$config[ 'increment' ]++;
add_settings_error( 'webcomic_otions', 'new-collection', sprintf( __( 'Added <q>%s</q>', 'webcomic' ), esc_html( $name ) ), 'updated' );
- } else if ( $_POST[ 'webcomic_bulk_collection' ] and isset( $_POST[ 'webcomic_collection' ] ) ) {
+ } elseif ( $_POST[ 'webcomic_bulk_collection' ] and isset( $_POST[ 'webcomic_collection' ] ) ) {
$bulk = true;
$count = 0;
@@ -994,7 +994,7 @@ public function save( $options ) {
$count++;
}
- } else if ( 'delete_save' === $_POST[ 'webcomic_bulk_collection' ] ) {
+ } elseif ( 'delete_save' === $_POST[ 'webcomic_bulk_collection' ] ) {
foreach ( $_POST[ 'webcomic_collection' ] as $id ) {
WebcomicAdmin::save_collection( $id );
@@ -1014,7 +1014,7 @@ public function save( $options ) {
self::$config[ 'uninstall' ] = isset( $_POST[ 'webcomic_uninstall' ] );
self::$config[ 'convert' ] = isset( $_POST[ 'webcomic_uninstall' ], $_POST[ 'webcomic_convert' ] );
}
- } else if ( isset( $_POST[ 'webcomic_collection' ] ) ) {
+ } elseif ( isset( $_POST[ 'webcomic_collection' ] ) ) {
$id = $_POST[ 'webcomic_collection' ];
$tokens = array( '%year%', '%monthnum%', '%day%', '%hour%', '%minute%', '%second%', '%post_id%', '%author%', "%{$id}_storyline%" );
$collection = array(
@@ -1123,7 +1123,7 @@ public function save( $options ) {
if ( $collection[ 'twitter' ][ 'consumer_key' ] !== self::$config[ 'collections' ][ $id ][ 'twitter' ][ 'consumer_key' ] or $collection[ 'twitter' ][ 'consumer_secret' ] !== self::$config[ 'collections' ][ $id ][ 'twitter' ][ 'consumer_secret' ] ) {
$collection[ 'twitter' ][ 'oauth_token' ] = $collection[ 'twitter' ][ 'oauth_secret' ] = '';
- } else if ( $collection[ 'twitter' ][ 'oauth_token' ] and $collection[ 'twitter' ][ 'oauth_secret' ] ) {
+ } elseif ( $collection[ 'twitter' ][ 'oauth_token' ] and $collection[ 'twitter' ][ 'oauth_secret' ] ) {
$collection[ 'twitter' ][ 'request_token' ] = $collection[ 'twitter' ][ 'request_secret' ] = '';
}
@@ -1261,7 +1261,7 @@ private function save_sizes() {
if ( $size = sanitize_title( $_POST[ 'webcomic_new_size' ] ) ) {
if ( 'thumb' === $size or 'thumbnail' === $size or 'medium' === $size or 'large' === $size or 'post-thumbnail' === $size ) {
wp_die( sprintf( __( 'The name <q>%s</q> is reserved by WordPress.', 'webcomic' ), $size ), __( 'Error | Webcomic', 'webcomic' ) );
- } else if ( in_array( $size, get_intermediate_image_sizes() ) ) {
+ } elseif ( in_array( $size, get_intermediate_image_sizes() ) ) {
wp_die( sprintf( __( 'A size with the name <q>%s</q> already exists.', 'webcomic' ), $size ), __( 'Error | Webcomic', 'webcomic' ) );
} else {
self::$config[ 'sizes' ][ $size ] = array(
View
@@ -64,31 +64,31 @@ public function __construct( $screen ) {
'title' => __( 'Webcomic Collection', 'webcomic' ),
'content' => $this->page_collection()
) );
- } else if ( 'options-media' === $screen->id ) {
+ } elseif ( 'options-media' === $screen->id ) {
$screen->add_help_tab( array(
'id' => 'webcomic-sizes',
'title' => __( 'Additional Image Sizes', 'webcomic' ),
'content' => $this->media_sizes()
) );
- } else if ( 'tools_page_webcomic-commerce' === $screen->id ) {
+ } elseif ( 'tools_page_webcomic-commerce' === $screen->id ) {
$screen->add_help_tab( array(
'id' => 'overview',
'title' => __( 'Overview', 'webcomic' ),
'content' => $this->commerce_overview()
) );
- } else if ( 'tools_page_webcomic-upgrader' === $screen->id ) {
+ } elseif ( 'tools_page_webcomic-upgrader' === $screen->id ) {
$screen->add_help_tab( array(
'id' => 'overview',
'title' => __( 'Overview', 'webcomic' ),
'content' => $this->legacy_overview()
) );
- } else if ( 'media_page_webcomic-generator' === $screen->id ) {
+ } elseif ( 'media_page_webcomic-generator' === $screen->id ) {
$screen->add_help_tab( array(
'id' => 'overview',
'title' => __( 'Overview', 'webcomic' ),
'content' => $this->generator_overview()
) );
- } else if ( 'settings_page_webcomic-options' === $screen->id ) {
+ } elseif ( 'settings_page_webcomic-options' === $screen->id ) {
$screen->add_help_tab( array(
'id' => 'general-settings',
'title' => __( 'General Settings', 'webcomic' ),
@@ -100,7 +100,7 @@ public function __construct( $screen ) {
'title' => __( 'Collections', 'webcomic' ),
'content' => $this->settings_collections()
) );
- } else if ( 'edit-webcomic_transcript' === $screen->id ) {
+ } elseif ( 'edit-webcomic_transcript' === $screen->id ) {
$screen->add_help_tab( array(
'id' => 'overview',
'title' => __( 'Overview', 'webcomic' ),
@@ -154,7 +154,7 @@ public function __construct( $screen ) {
'title' => __( 'Transcript Authors', 'webcomic' ),
'content' => $this->edit_transcript_authors()
) );
- } else if ( "edit-{$screen->post_type}" === $screen->id ) {
+ } elseif ( "edit-{$screen->post_type}" === $screen->id ) {
$screen->add_help_tab( array(
'id' => 'overview',
'title' => __( 'Overview', 'webcomic' ),
@@ -178,7 +178,7 @@ public function __construct( $screen ) {
'title' => __( 'Bulk Actions', 'webcomic' ),
'content' => $this->webcomics_bulk()
) );
- } else if ( $screen->post_type === $screen->id ) {
+ } elseif ( $screen->post_type === $screen->id ) {
$screen->add_help_tab( array(
'id' => 'customizing-this-display',
'title' => __( 'Customizing This Display', 'webcomic' ),
@@ -220,7 +220,7 @@ public function __construct( $screen ) {
'title' => __( 'Discussion Settings', 'webcomic' ),
'content' => $this->edit_webcomic_discussion()
) );
- } else if ( "edit-{$screen->post_type}_storyline" === $screen->id and empty( $_GET[ 'tag_ID' ] ) ) {
+ } elseif ( "edit-{$screen->post_type}_storyline" === $screen->id and empty( $_GET[ 'tag_ID' ] ) ) {
$screen->add_help_tab( array(
'id' => 'overview',
'title' => __( 'Overview', 'webcomic' ),
@@ -238,7 +238,7 @@ public function __construct( $screen ) {
'title' => __( 'Moving Storylines', 'webcomic' ),
'content' => $this->storylines_moving()
) );
- } else if ( "edit-{$screen->post_type}_character" === $screen->id and empty( $_GET[ 'tag_ID' ] ) ) {
+ } elseif ( "edit-{$screen->post_type}_character" === $screen->id and empty( $_GET[ 'tag_ID' ] ) ) {
$screen->add_help_tab( array(
'id' => 'overview',
'title' => __( 'Overview', 'webcomic' ),
@@ -250,7 +250,7 @@ public function __construct( $screen ) {
'title' => __( 'Adding Characters', 'webcomic' ),
'content' => $this->characters_adding()
) );
- } else if ( 'edit-webcomic_language' === $screen->id and empty( $_GET[ 'tag_ID' ] ) ) {
+ } elseif ( 'edit-webcomic_language' === $screen->id and empty( $_GET[ 'tag_ID' ] ) ) {
$screen->add_help_tab( array(
'id' => 'overview',
'title' => __( 'Overview', 'webcomic' ),
@@ -262,7 +262,7 @@ public function __construct( $screen ) {
'title' => __( 'Adding Languages', 'webcomic' ),
'content' => $this->languages_adding()
) );
- } else if ( "{$screen->post_type}_page_{$screen->post_type}-options" === $screen->id ) {
+ } elseif ( "{$screen->post_type}_page_{$screen->post_type}-options" === $screen->id ) {
$screen->add_help_tab( array(
'id' => 'general-settings',
'title' => __( 'General Settings', 'webcomic' ),
@@ -68,22 +68,22 @@
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
</div>
-<?php } else if ( is_webcomic() ) { ?>
+<?php } elseif ( is_webcomic() ) { ?>
<div class="integrated-webcomic">
<nav class="webcomic-above"><?php first_webcomic_link(); previous_webcomic_link(); random_webcomic_link(); next_webcomic_link(); last_webcomic_link(); ?></nav><!-- .webcomic-above -->
<div class="webcomic-img"><?php the_webcomic( 'full', 'next' ); ?></div><!-- .webcomic-img -->
<nav class="webcomic-below"><?php first_webcomic_link(); previous_webcomic_link(); random_webcomic_link(); next_webcomic_link(); last_webcomic_link(); ?></nav><!-- .webcomic-below -->
</div><!-- .integrated-webcomic -->
-<?php } else if ( is_webcomic_archive() ) { ?>
+<?php } elseif ( is_webcomic_archive() ) { ?>
<h2 class="webcomic-collection-title"><?php webcomic_collection_title(); ?></h2><!-- .webcomic-collection-title -->
<div class="webcomic-img webcomic-collection-poster"><?php webcomic_collection_poster(); ?></div><!-- .webcomic-collection-poster -->
<div class="webcomic-collection-description"><?php webcomic_collection_description(); ?></div><!-- .webcomic-collection-description -->
-<?php } else if ( is_webcomic_storyline() ) { ?>
+<?php } elseif ( is_webcomic_storyline() ) { ?>
<h2 class="webcomic-storyline-title"><?php webcomic_storyline_title(); ?></h2><!-- .webcomic-storyline-title -->
<div class="webcomic-img webcomic-storyline-cover"><?php webcomic_storyline_cover(); ?></div><!-- .webcomic-storyline-cover -->
<div class="webcomic-storyline-description"><?php webcomic_storyline_description(); ?></div><!-- .webcomic-storyline-description -->
<nav class="webcomic-storyline"><?php first_webcomic_storyline_link(); previous_webcomic_storyline_link(); random_webcomic_storyline_link(); next_webcomic_storyline_link(); last_webcomic_storyline_link(); ?></nav><!-- .webcomic-storyline -->
-<?php } else if ( is_webcomic_character() ) { ?>
+<?php } elseif ( is_webcomic_character() ) { ?>
<h2 class="webcomic-character-title"><?php webcomic_character_title(); ?></h2><!-- .webcomic-character-title -->
<div class="webcomic-img webcomic-character-avatar"><?php webcomic_character_avatar(); ?></div><!-- .webcomic-character-avatar -->
<div class="webcomic-character-description"><?php webcomic_character_description(); ?></div><!-- .webcomic-character-description -->
@@ -38,6 +38,6 @@
$append .= WebcomicTag::get_the_webcomic_term_list( $post->ID, 'storyline', sprintf( '<div class="webcomic-storylines"><b>%s</b>', __( 'Part of ', 'webcomic' ) ), ', ', '</div><!-- .webcomic-storylines -->' );
$append .= WebcomicTag::get_the_webcomic_term_list( $post->ID, 'character', sprintf( '<div class="webcomic-characters"><b>%s</b>', __( 'Featuring ', 'webcomic' ) ), ', ', '</div><!-- .webcomic-characters -->' );
$append .= WebcomicTag::webcomic_dropdown_transcript_terms( array( 'before' => '<div class="webcomic-transcript-languages">', 'sep' => __( ' | ', 'webcomic' ), 'after' => '</div><!-- .webcomic-transcript-languages-->', 'show_option_all' => __( '- Transcript Language -', 'webcomic' ), 'taxonomy' => 'webcomic_language' ) );
-} else if ( is_webcomic_archive() or is_webcomic_storyline() or is_webcomic_character() or is_search() ) {
+} elseif ( is_webcomic_archive() or is_webcomic_storyline() or is_webcomic_character() or is_search() ) {
$prepend = sprintf( '<div class="integrated-webcomic"><div class="webcomic-img">%s</div><!-- .webcomic-img --></div><!-- .integrated-webcomic -->', WebcomicTag::the_webcomic( 'medium', 'self' ) );
}
View
@@ -93,7 +93,7 @@ public function admin_init() {
wp_redirect( html_entity_decode( wp_nonce_url( add_query_arg( array( 'action' => 'deactivate', 'plugin' => $file ), admin_url( 'plugins.php' ) ), 'deactivate-plugin_' . $file ) ) );
die;
- } else if ( isset( $_POST[ 'upgrade_legacy' ] ) ) {
+ } elseif ( isset( $_POST[ 'upgrade_legacy' ] ) ) {
$stage = !empty( $_POST[ 'webcomic_upgrade_stage' ] ) ? $_POST[ 'webcomic_upgrade_stage' ] : 0;
if ( !empty( $_POST[ 'webcomic_upgrade_complete' ] ) ) {
@@ -106,9 +106,9 @@ public function admin_init() {
wp_redirect( admin_url() );
die;
- } else if ( 3 === self::$config[ 'legacy' ] ) {
+ } elseif ( 3 === self::$config[ 'legacy' ] ) {
$_POST[ 'webcomic_upgrade_status' ] = self::upgrade3( $stage );
- } else if ( 2 === self::$config[ 'legacy' ] ) {
+ } elseif ( 2 === self::$config[ 'legacy' ] ) {
$_POST[ 'webcomic_upgrade_status' ] = self::upgrade2( $stage );
} else {
$_POST[ 'webcomic_upgrade_status' ] = self::upgrade1( $stage );
@@ -217,7 +217,7 @@ public function page() {
</div>
</form>
- <?php } else if ( isset( $_POST[ 'webcomic_upgrade_status' ] ) ) { ?>
+ <?php } elseif ( isset( $_POST[ 'webcomic_upgrade_status' ] ) ) { ?>
<p style="color:#e66f00;font-size:larger"><strong><?php _e( 'Webcomic has paused the upgrade to prevent a timeout error.', 'webcomic' ); ?></strong></p>
<p><?php _e( 'The upgrade will automatically resume in 5 seconds, or you may click <strong>Continue Upgrading</strong> to resume now.', 'webcomic' ); ?></p>
@@ -417,7 +417,7 @@ private function upgrade1( $stage = 0 ) {
foreach ( $posts as $post ) {
if ( 'date' === $legacy_config[ 'comic_name_format' ] ) {
$format = get_the_time( $legacy_config[ 'comic_name_format_date' ], $post );
- } else if ( 'slug' === $legacy_config[ 'comic_name_format' ] ) {
+ } elseif ( 'slug' === $legacy_config[ 'comic_name_format' ] ) {
$format = '';
} else {
$format = get_post_meta( $post, 'comic_filename', true );
@@ -543,7 +543,7 @@ private function upgrade2( $stage = 0 ) {
if ( $legacy_config[ 'comic_transcripts_loggedin' ] ) {
$transcripts_permission = 'register';
- } else if ( $legacy_config[ 'comic_transcripts_required' ] ) {
+ } elseif ( $legacy_config[ 'comic_transcripts_required' ] ) {
$transcripts_permission = 'identify';
} else {
$transcripts_permission = 'everyone';
@@ -708,7 +708,7 @@ private function upgrade2( $stage = 0 ) {
if ( get_post_meta( $post, 'comic_transcript', true ) ) {
$status = 'publish';
- } else if ( get_post_meta( $post, 'comic_transcript_pending', true ) ) {
+ } elseif ( get_post_meta( $post, 'comic_transcript_pending', true ) ) {
$status = 'pending';
} else {
$status = 'draft';
@@ -827,7 +827,7 @@ private function upgrade3( $stage = 0 ) {
if ( 'login' === $legacy_config[ 'transcribe_restrict' ] ) {
$transcripts_permission = 'register';
- } else if ( 'selfid' === $legacy_config[ 'transcribe_restrict' ] ) {
+ } elseif ( 'selfid' === $legacy_config[ 'transcribe_restrict' ] ) {
$transcripts_permission = 'identify';
} else {
$transcripts_permission = 'everyone';
View
@@ -36,9 +36,9 @@ public function __construct() {
if ( isset( $_GET[ 'webcomic_action_status' ] ) and 1 === count( $_GET ) ) {
if ( 'regenerate-clear' === $_GET[ 'webcomic_action_status' ] ) {
self::$notice[] = __( 'Regenerated images for media object.', 'webcomic' );
- } else if ( 'regenerate-error' === $_GET[ 'webcomic_action_status' ] ) {
+ } elseif ( 'regenerate-error' === $_GET[ 'webcomic_action_status' ] ) {
self::$error[] = __( 'Images could not be regenerated.', 'webcomic' );
- } else if ( 'detach-clear' === $_GET[ 'webcomic_action_status' ] ) {
+ } elseif ( 'detach-clear' === $_GET[ 'webcomic_action_status' ] ) {
self::$notice[] = __( 'Detached media object.', 'webcomic' );
}
}
@@ -92,9 +92,9 @@ public function admin_init() {
if ( isset( $_POST[ 'webcomic_action' ] ) and 'generate' === $_POST[ 'webcomic_action' ] and wp_verify_nonce( $_POST[ 'webcomic_generate' ], 'webcomic_generate' ) ) {
if ( empty( $_POST[ 'attachments' ] ) or !$attachments = $_POST[ 'attachments' ] ) {
self::$error[] = sprintf( '<strong>%s</strong>', __( 'No media objects selected.', 'webcomic' ) );
- } else if ( !$start = strtotime( $_POST[ 'webcomic_generate_start' ] ) ) {
+ } elseif ( !$start = strtotime( $_POST[ 'webcomic_generate_start' ] ) ) {
self::$error[] = sprintf( '<strong>%s</strong>', __( 'The start date could not be understood.', 'webcomic' ) );
- } else if ( !$days = $_POST[ 'webcomic_generate_days' ] ) {
+ } elseif ( !$days = $_POST[ 'webcomic_generate_days' ] ) {
self::$error[] = sprintf( '<strong>%s</strong>', __( 'No weekdays selected.', 'webcomic' ) );
} else {
$now = $start;
@@ -137,7 +137,7 @@ public function admin_init() {
if ( false !== ( $key = array_search( $weekday, $days ) ) ) {
$weekday = empty( $days[ $key + 1 ] ) ? $days[ 0 ] : $days[ $key + 1 ];
- } else if ( $weekday > max( $days ) or $weekday < min( $days ) ) {
+ } elseif ( $weekday > max( $days ) or $weekday < min( $days ) ) {
$weekday = $days[ 0 ];
} else {
foreach ( $days as $day ) {
@@ -266,9 +266,9 @@ public function display_media_states( $states ) {
if ( empty( $type[ 1 ] ) ) {
$states[] = sprintf( __( '%s Poster', 'webcomic' ), esc_html( self::$config[ 'collections' ][ $type[ 0 ] ][ 'name' ] ) );
- } else if ( 'storyline' === $type[ 1 ] ) {
+ } elseif ( 'storyline' === $type[ 1 ] ) {
$states[] = sprintf( __( '%s Cover', 'webcomic' ), esc_html( self::$config[ 'collections' ][ $type[ 0 ] ][ 'name' ] ) );
- } else if ( 'character' === $type[ 1 ] ) {
+ } elseif ( 'character' === $type[ 1 ] ) {
$states[] = sprintf( __( '%s Avatar', 'webcomic' ), esc_html( self::$config[ 'collections' ][ $type[ 0 ] ][ 'name' ] ) );
}
}
@@ -293,9 +293,9 @@ public function attachment_fields_to_edit( $fields, $attachment ) {
if ( isset( $_GET[ 'post_id' ] ) ) {
$id = $_GET[ 'post_id' ];
- } else if ( $post and $post->post_parent ) {
+ } elseif ( $post and $post->post_parent ) {
$id = $post->post_parent;
- } else if ( $post and isset( self::$config[ 'collections' ][ $post->post_type ] ) ) {
+ } elseif ( $post and isset( self::$config[ 'collections' ][ $post->post_type ] ) ) {
$id = $post->ID;
} else {
$id = false;
View
@@ -231,7 +231,7 @@ public function request( $request ) {
'meta_key' => 'webcomic_collection',
'orderby' => 'meta_value'
) );
- } else if ( isset( $request[ 'post_type' ], $_GET[ 'meta_key' ], $_GET[ 'meta_value' ] ) and 'page' === $request[ 'post_type' ] and 'webcomic_collection' === $_GET[ 'meta_key' ] ) {
+ } elseif ( isset( $request[ 'post_type' ], $_GET[ 'meta_key' ], $_GET[ 'meta_value' ] ) and 'page' === $request[ 'post_type' ] and 'webcomic_collection' === $_GET[ 'meta_key' ] ) {
$request = array_merge( $request, array(
'meta_key' => 'webcomic_collection',
'meta_value' => $_GET[ 'meta_value' ]
Oops, something went wrong.

0 comments on commit 61f4624

Please sign in to comment.