Skip to content

Commit

Permalink
Revert "Reduce WP Coding Standards Messages Part 6"
Browse files Browse the repository at this point in the history
This reverts commit eb91512.
  • Loading branch information
kniebremser committed Jun 12, 2019
1 parent eb91512 commit 17ebb13
Show file tree
Hide file tree
Showing 15 changed files with 285 additions and 384 deletions.
30 changes: 15 additions & 15 deletions functions/classes.php
Expand Up @@ -23,16 +23,16 @@ function comicpress_body_class( $classes = array() ) {

if ( comicpress_is_signup() ) $classes[] = 'signup';

if ( $is_lynx ) $classes[] = 'lynx';
elseif ( $is_gecko ) $classes[] = 'gecko';
elseif ( $is_opera ) $classes[] = 'opera';
elseif ( $is_NS4 ) $classes[] = 'ns4';
elseif ( $is_safari ) $classes[] = 'safari';
elseif ( $is_chrome ) $classes[] = 'chrome';
elseif ( $is_IE ) $classes[] = 'ie';
else $classes[] = 'unknown';
if ( $is_iphone ) $classes[] = 'iphone';
if ( wp_is_mobile() ) $classes[] = 'is-mobile';
if ( $is_lynx ) $classes[] = 'lynx';
elseif ( $is_gecko ) $classes[] = 'gecko';
elseif ( $is_opera ) $classes[] = 'opera';
elseif ( $is_NS4 ) $classes[] = 'ns4';
elseif ( $is_safari ) $classes[] = 'safari';
elseif ( $is_chrome ) $classes[] = 'chrome';
elseif ( $is_IE ) $classes[] = 'ie';
else $classes[] = 'unknown';
if ( $is_iphone ) $classes[] = 'iphone';
if ( wp_is_mobile() ) $classes[] = 'is-mobile';


// Hijacked from the hybrid theme, http://themehybrid.com/ .
Expand All @@ -43,8 +43,8 @@ function comicpress_body_class( $classes = array() ) {
$classes[] = 'single-author-' . get_the_author_meta( 'user_nicename', $wp_query->post->post_author );
}

if ( is_page() ) {
if ( isset( $wp_query->query_vars['pagename'] ) )
if (is_page()) {
if ( isset($wp_query->query_vars['pagename']) )
$classes[] = 'page-' . $wp_query->query_vars['pagename'];
}

Expand All @@ -54,7 +54,7 @@ function comicpress_body_class( $classes = array() ) {

// NOT hijacked from anything, doi! people should do this.
$timestamp = current_time( 'timestamp' );
$rightnow = (int) date( 'Gi', $timestamp );
$rightnow = (int) date( 'Gi',$timestamp );
$ampm = date( 'a', $timestamp );
$classes[] = $ampm;
// $classes[] = 'time-'.$rightnow;
Expand Down Expand Up @@ -95,7 +95,7 @@ function comicpress_post_class( $classes = '' ) {
'entry_tax' => array(
'category',
'post_tag',
),
)
);

/* Microformats. */
Expand All @@ -105,7 +105,7 @@ function comicpress_post_class( $classes = '' ) {
$classes[] = 'postonpage-' . ++$post_alt;

if ( $post_alt % 2 )
$classes[] = 'odd';
$classes[] = 'odd';
else $classes[] = 'even';

/* Sticky class (only on home/blog page). */
Expand Down
2 changes: 1 addition & 1 deletion functions/copyright.php
Expand Up @@ -67,7 +67,7 @@ function comicpress_copyright_dates() {
if ( $copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate ) {
$copyright .= '-' . $copyright_dates[0]->lastdate;
}
$output = $copyright;
$output = $copyright;
}
return apply_filters( 'comicpress_copyright_dates', $output );
}
Expand Down
28 changes: 13 additions & 15 deletions functions/custom-header.php
@@ -1,21 +1,20 @@
<?php

$custom_header_args = array(
'default-text-color' => 'B00',
'flex-width' => true,
'width' => get_theme_mod( 'comicpress-customize-range-site-width', '980' ),
'flex-height' => true,
'height' => '110',
'header-text' => false,
'wp-head-callback' => 'comicpress_header_style',
'admin-head-callback' => 'comicpress_admin_header_style',
'admin-preview-callback' => 'comicpress_admin_header_style',
);
'default-text-color' => 'B00',
'flex-width' => true,
'width' => get_theme_mod('comicpress-customize-range-site-width', '980'),
'flex-height' => true,
'height' => '110',
'header-text' => false,
'wp-head-callback' => 'comicpress_header_style',
'admin-head-callback' => 'comicpress_admin_header_style',
'admin-preview-callback' => 'comicpress_admin_header_style'
);

add_theme_support( 'custom-header', $custom_header_args );

function comicpress_admin_header_style() {
?>
function comicpress_admin_header_style() { ?>
<style type="text/css">
#headimg { width: <?php echo get_custom_header()->width; ?>px; height: <?php echo get_custom_header()->height; ?>px; background: url(<?php header_image(); ?>) top center no-repeat; }
<?php if (!display_header_text()) { ?>
Expand All @@ -37,10 +36,9 @@ function comicpress_header_style() {
.header-info, .header-info h1 a { padding: 0; }
<?php } elseif (!display_header_text()) { ?>
#header h1, #header .description { display: none; }
<?php } elseif ( ! empty($textcolor ) ) { ?>
<?php } elseif (!empty($textcolor)) { ?>
#header h1, #header h1 a { color: #<?php echo $textcolor; ?>; }
<?php } ?>
</style>
<?php
}
<?php }
}
43 changes: 20 additions & 23 deletions functions/displaypost.php
Expand Up @@ -7,7 +7,7 @@ function comicpress_latest_blog_post_jump() {
$catnum = 0;
if ( isset( $_GET['latestblogpost'] ) ) $catnum = (int) esc_attr( $_GET['latestblogpost'] );
if ( ! empty( $catnum ) ) {
$args = array(
$args = array(
'numberposts' => 1,
'post_type' => 'post',
'orderby' => 'post_date',
Expand All @@ -17,7 +17,7 @@ function comicpress_latest_blog_post_jump() {
);
$qposts = get_posts( $args );
} else {
$args = array(
$args = array(
'numberposts' => 1,
'post_type' => 'post',
'orderby' => 'post_date',
Expand All @@ -41,23 +41,23 @@ function comicpress_display_post_title() {
global $post, $wp_query;
$get_post_title = '';
if ( ( $post->post_type == 'page' ) && is_front_page() ) return; // Don't display the title on static home pages.
if ( ( comicpress_themeinfo( 'disable_page_titles' ) && is_page() ) || ( comicpress_themeinfo( 'disable_post_titles' ) && ! is_page() ) || ( is_page( 'chat' ) || is_page( 'forum' ) ) ) return;
if ( ( comicpress_themeinfo( 'disable_page_titles' ) && is_page() ) || ( comicpress_themeinfo( 'disable_post_titles' ) && ! is_page() ) || (is_page( 'chat' ) || is_page( 'forum' ) ) ) return;
if ( is_page() ) {
$post_title = "<h2 class=\"page-title\">";
} else {
$post_title = "<h2 class=\"post-title\">";
}
if ( ( is_page_template( 'blog.php' ) || is_home() || is_front_page() || is_archive() || is_search() ) && ( $post->post_type != 'page' ) ) $post_title .= "<a href=\"" . get_permalink() . "\">";
if ( ( is_page_template( 'blog.php' ) || is_home() || is_front_page() || is_archive() || is_search() ) && ( $post->post_type != 'page') ) $post_title .= "<a href=\"".get_permalink()."\">";
$get_post_title .= get_the_title();
if ( ! $get_post_title ) $get_post_title = '( No Title )';
$post_title .= $get_post_title;
if ( ( is_page_template('blog.php') || is_home() || is_front_page() || is_archive() || is_search() ) && ( $post->post_type != 'page' ) ) $post_title .= "</a>";
if ( ( is_page_template('blog.php') || is_home() || is_front_page() || is_archive() || is_search() ) && ( $post->post_type != 'page') ) $post_title .= "</a>";
$post_title .= "</h2>\r\n";
echo apply_filters( 'comicpress_display_post_title ', $post_title );
}
}

if ( ! function_exists( 'comicpress_display_post_thumbnail' ) ) {
if ( ! function_exists('comicpress_display_post_thumbnail' ) ) {
function comicpress_display_post_thumbnail( $size = 'thumbnail' ) {
global $post, $wp_query;
if ( $post->post_type == 'post' ) {
Expand All @@ -67,7 +67,8 @@ function comicpress_display_post_thumbnail( $size = 'thumbnail' ) {
if ( has_post_thumbnail() ) {
if ( is_home() ) {
$post_thumbnail = '<div class="post-image"><center><a href="'.$link.'" rel="featured-image" title="Link to ' . get_the_title() . '">' . get_the_post_thumbnail( $post->ID, $size ) . '</a></center></div>'."\r\n";
} else $post_thumbnail = '<div class="post-image"><center>' . get_the_post_thumbnail( $post->ID, $size ) . '</center></div>'."\r\n";
} else
$post_thumbnail = '<div class="post-image"><center>' . get_the_post_thumbnail( $post->ID, $size ) . '</center></div>'."\r\n";
} else {
$url_image = get_post_meta($post->ID, 'featured-image', true);
if ( ! empty( $url_image ) ) $post_thumbnail = '<div class="post-image"><center><a href="' . $link . '" rel="featured-image" title="Link to "' . get_the_title() . '"><img src="' . $url_image . '" title="' . get_the_title() .'" alt="' . get_the_title() . '"></a></center></div>' . "\r\n";
Expand All @@ -90,12 +91,12 @@ function comicpress_display_author_gravatar() {
}
}

if ( ! function_exists( 'comicpress_display_post_calendar' ) ) {
if ( ! function_exists('comicpress_display_post_calendar' ) ) {
function comicpress_display_post_calendar() {
global $post, $wp_query;
if ( is_page() ) return;
if ( comicpress_themeinfo( 'enable_post_calendar' ) ) {
$post_calendar = "<div class=\"post-calendar-date\"><div class=\"calendar-date\"><span>" . get_the_time( 'M' ) . "</span>" . get_the_time( 'd' ) . "</div></div>\r\n";
if ( comicpress_themeinfo( 'enable_post_calendar') ) {
$post_calendar = "<div class=\"post-calendar-date\"><div class=\"calendar-date\"><span>" . get_the_time(' M' ) . "</span>" . get_the_time( 'd' ) . "</div></div>\r\n";
echo apply_filters( 'comicpress_display_post_calendar', $post_calendar );
}
}
Expand Down Expand Up @@ -150,7 +151,7 @@ function comicpress_display_modified_date_time() {
function comicpress_display_post_category() {
global $post;
$post_category = '';
if ( ! comicpress_is_bbpress() && ! comicpress_themeinfo( 'disable_categories_in_posts' ) && ! is_attachment() && ( $post->post_type == 'post' ) ) {
if ( ! comicpress_is_bbpress() && ! comicpress_themeinfo( 'disable_categories_in_posts' ) && !is_attachment() && ( $post->post_type == 'post' ) ) {
$post_category = "<div class=\"post-cat\">" . __( 'Posted In:', 'comicpress' ) . ' ' . get_the_category_list( ', ' ) . "</div>\r\n";
}
echo apply_filters( 'comicpress_display_post_category', $post_category );
Expand Down Expand Up @@ -184,8 +185,8 @@ function comicpress_display_comment_link() {
function comicpress_display_blog_navigation() {
global $post, $wp_query;
if ( comicpress_themeinfo( 'enable_comments_on_homepage' ) && ( comicpress_themeinfo( 'home_post_count' ) == '1' ) ) {
$temp_single = $wp_query->is_single;
$wp_query->is_single = true;
$temp_single = $wp_query -> is_single;
$wp_query -> is_single = true;
}
if ( is_single() && ! is_page() && ! is_archive() && ! is_search() && ( $post->post_type == 'post' ) ) {
?>
Expand All @@ -196,8 +197,8 @@ function comicpress_display_blog_navigation() {
</div>
<?php
}
if ( comicpress_themeinfo( 'enable_comments_on_homepage' ) && ( comicpress_themeinfo( 'home_post_count' ) == '1' ) ) {
$wp_query->is_single = $temp_single;
if ( comicpress_themeinfo( 'enable_comments_on_homepage' ) && ( comicpress_themeinfo( 'home_post_count' ) == '1') ) {
$wp_query -> is_single = $temp_single;
}
}
}
Expand Down Expand Up @@ -233,9 +234,9 @@ function comicpress_display_post() {
<div class="post-content">
<div class="post-info">
<?php
if ( ! comicpress_is_bbpress() ) comicpress_display_author_gravatar();
if ( ! comicpress_is_bbpress() ) comicpress_display_post_calendar();
if ( is_sticky() ) {
if ( ! comicpress_is_bbpress() ) comicpress_display_author_gravatar();
if ( ! comicpress_is_bbpress() ) comicpress_display_post_calendar();
if ( is_sticky() ) {
?>
<div class="sticky-image">Featured Post</div>
<?php
Expand Down Expand Up @@ -294,11 +295,7 @@ function comicpress_display_post() {
?>
</div>
<div class="post-foot">
<?php
do_action( 'comic-post-foot' );
do_action( 'comicpress-post-foot' );
?>
</div>
<?php do_action('comic-post-foot'); ?><?php do_action('comicpress-post-foot'); ?></div>
</div>
<?php
do_action( 'comic-post-extras' );
Expand Down
4 changes: 2 additions & 2 deletions functions/moods.php
Expand Up @@ -74,9 +74,9 @@ function comicpress_showmood_edit_post() {
}

$count = 0;
$count = count( $results = glob( get_stylesheet_directory() . '/images/moods/' . $moods_directory . '/*' ) );
$count = count( $results = glob( get_stylesheet_directory() . '/images/moods/' . $moods_directory . '/*') );
if ( ! $count ) {
$count = count( $results = glob( get_template_directory() . '/images/moods/' . $moods_directory . '/*' ) );
$count = count( $results = glob(get_template_directory() . '/images/moods/' . $moods_directory . '/*') );
$moods_uri = get_template_directory_uri();
} else {
$moods_uri = get_stylesheet_directory_uri();
Expand Down
2 changes: 1 addition & 1 deletion functions/page-options.php
Expand Up @@ -25,7 +25,7 @@ function comicpress_add_page_editor_meta_box() {
}

function comicpress_save_page_editor_options( $post_id ) {
if ( isset( $_POST['comicpress-update-page-options'] ) && ! wp_verify_nonce( $_POST['comicpress-update-page-options'], 'comicpress_post_options-' . $post_id ) ) {
if ( isset( $_POST['comicpress-update-page-options']) && ! wp_verify_nonce( $_POST['comicpress-update-page-options'], 'comicpress_post_options-' . $post_id ) ) {
return $post_id;
}
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
Expand Down
4 changes: 2 additions & 2 deletions functions/pagination.php
Expand Up @@ -8,10 +8,10 @@ function comicpress_pagination() {
?>
<div id="pagenav">
<div class="pagenav-right">
<?php previous_posts_link( __( 'Newer Entries &uarr;', 'comicpress' ) ) ?>
<?php previous_posts_link(__( 'Newer Entries &uarr;', 'comicpress' )) ?>
</div>
<div class="pagenav-left">
<?php next_posts_link( __( '&darr; Previous Entries', 'comicpress' ) ) ?>
<?php next_posts_link(__( '&darr; Previous Entries', 'comicpress' )) ?>
</div>
<div class="clear"></div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion functions/profile-options.php
Expand Up @@ -32,7 +32,7 @@ function comicpress_remove_unwanted_contactmethods( $contactmethods ) {
* Sites that you could be on but not exactly the same reference for an author page.
* When activated, this must be integrated into author.php in table 'user-contacts'.
*/
function add_new_contactmethods( $methods ) {
function add_new_contactmethods( $methods ){
// Default contact methods.
$methods['twitter'] = 'Twitter (url)';
$methods['facebook'] = 'Facebook (url)';
Expand All @@ -53,3 +53,4 @@ function add_new_contactmethods( $methods ) {
}

add_filter( 'user_contactmethods', 'add_new_contactmethods' );

10 changes: 5 additions & 5 deletions functions/protect.php
Expand Up @@ -4,15 +4,15 @@
* Protect global $post and $wp_query.
* @param object $use_this_post If provided, after saving the current post, set up this post for template tag use.
*/
function Protect ( $use_this_post = null ) {
function Protect ($use_this_post = null) {
global $post, $wp_query, $__post, $__wp_query;
if ( ! empty( $post ) ) {
if ( ! empty( $post) ) {
$__post = $post;
}
if ( ! empty( $wp_query ) ) {
if ( ! empty( $wp_query) ) {
$__wp_query = $wp_query;
}
if ( ! is_null( $use_this_post ) ) {
if ( ! is_null( $use_this_post) ) {
$post = $use_this_post;
setup_postdata( $post );
}
Expand All @@ -35,7 +35,7 @@ function Unprotect() {
if ( ! empty( $__post) ) {
$post = $__post;
}
if ( ! empty( $__wp_query ) ) {
if ( ! empty( $__wp_query) ) {
$wp_query = $__wp_query;
}

Expand Down
2 changes: 1 addition & 1 deletion functions/syndication.php
Expand Up @@ -18,7 +18,7 @@ function comicpress_include_custom_post_types_in_rss( $query ) {
$operator = 'and';
$post_types = get_post_types( $args , $output , $operator );
// Remove 'pages' from the RSS.
$post_types = array_merge( $post_types, array( 'post' ) );
$post_types = array_merge( $post_types, array( 'post' ) ) ;
$query->set( 'post_type' , $post_types );
}
return $query;
Expand Down

0 comments on commit 17ebb13

Please sign in to comment.