Skip to content

Commit

Permalink
Adds PHPCS rules & fixes linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
carrieforde committed Jun 18, 2018
1 parent 061355f commit 45899c1
Show file tree
Hide file tree
Showing 18 changed files with 232 additions and 150 deletions.
5 changes: 3 additions & 2 deletions comments.php
Expand Up @@ -26,6 +26,7 @@
<h2 class="comments-title">
<?php
printf( // WPCS: XSS OK.
/* translators: %2$s: post name */
esc_html( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'alcatraz' ) ),
number_format_i18n( get_comments_number() ),
'<span>' . get_the_title() . '</span>'
Expand All @@ -48,8 +49,8 @@
<ol class="comment-list">
<?php
wp_list_comments( array(
'style' => 'ul',
'short_ping' => true,
'style' => 'ul',
'short_ping' => true,
'avatar_size' => 75,
) );
?>
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Expand Up @@ -32,4 +32,4 @@
<?php wp_footer(); ?>

</body>
</html>
</html>
8 changes: 4 additions & 4 deletions functions.php
Expand Up @@ -210,10 +210,10 @@ function alcatraz_scripts() {

add_action( 'init', 'alcatraz_init_bfa' );
/**
* Include and initialize the Better Font Awesome Library.
*
* @since 1.0.0
*/
* Include and initialize the Better Font Awesome Library.
*
* @since 1.0.0
*/
function alcatraz_init_bfa() {

if ( ! class_exists( 'Better_Font_Awesome_Library' ) ) {
Expand Down
22 changes: 11 additions & 11 deletions inc/admin/admin.php
Expand Up @@ -16,9 +16,9 @@
/**
* Enqueue our admin JS.
*
* @since 1.0.0
* @since 1.0.0
*
* @param string $hook The page being displayed.
* @param string $hook The page being displayed.
*/
function alcatraz_admin_enqueue_scripts( $hook ) {

Expand Down Expand Up @@ -57,9 +57,9 @@ function alcatraz_activation_notice() {

?>
<div id="alcatraz-activation-notice" class="updated notice is-dismissible" style="padding-bottom: 5px;">
<h2><?php _e( 'Welcome to Alcatraz', 'alcatraz' ); ?></h2>
<p><?php _e( 'Get started by configuring visual options in the', 'alcatraz' ); ?> <?php echo $customizer_link; ?></p>
<p><?php _e( 'For development resources visit the', 'alcatraz' ); ?> <?php echo $documentation_link; ?></p>
<h2><?php esc_html__e( 'Welcome to Alcatraz', 'alcatraz' ); ?></h2>
<p><?php esc_html__e( 'Get started by configuring visual options in the', 'alcatraz' ); ?> <?php echo esc_html( $customizer_link ); ?></p>
<p><?php esc_html__e( 'For development resources visit the', 'alcatraz' ); ?> <?php echo esc_html( $documentation_link ); ?></p>
</div>
<?php
}
Expand Down Expand Up @@ -91,12 +91,12 @@ function alcatraz_page_options_metabox() {
* Initialize the metabox.
*/
$page_options = new_cmb2_box( array(
'id' => 'page_options_metabox',
'title' => __( 'Page Options', 'alcatraz' ),
'object_types' => $post_type,
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
'id' => 'page_options_metabox',
'title' => __( 'Page Options', 'alcatraz' ),
'object_types' => $post_type,
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
) );

// Page sidebar.
Expand Down
2 changes: 2 additions & 0 deletions inc/admin/customizer.php
Expand Up @@ -10,6 +10,8 @@
* Modify the $wp_customize object.
*
* @since 1.0.0
*
* @param array $wp_customize The Customizer object.
*/
function alcatraz_customize_register( $wp_customize ) {

Expand Down
2 changes: 1 addition & 1 deletion inc/ajax.php
Expand Up @@ -20,4 +20,4 @@ function alcatraz_hide_admin_notice() {
update_option( 'alcatraz_options', $options, true );

wp_die();
}
}
16 changes: 9 additions & 7 deletions inc/extras.php
Expand Up @@ -11,10 +11,10 @@
/**
* Add custom body classes.
*
* @since 1.0.0
* @since 1.0.0
*
* @param array $classes Classes for the body element.
* @return array
* @param array $classes Classes for the body element.
* @return array
*/
function alcatraz_body_classes( $classes ) {

Expand Down Expand Up @@ -87,11 +87,11 @@ function alcatraz_body_classes( $classes ) {
/**
* Return either an empty string or the integer value of the passed in value.
*
* @since 1.0.0
* @since 1.0.0
*
* @param string|int $value The value to test.
* @param string|int $value The value to test.
*
* @return string|int
* @return string|int
*/
function alcatraz_empty_or_int( $value ) {
if ( '' === $value ) {
Expand All @@ -103,8 +103,10 @@ function alcatraz_empty_or_int( $value ) {

/**
* Filter post types passed to our Custom Meta box.
*
* @param array $context The post types on which the CMB2 metaboxes display.
*/
function alcatraz_allowed_post_types( $context = '' ) {
function alcatraz_allowed_post_types( $context = array() ) {

$post_type = array(
'page',
Expand Down
4 changes: 2 additions & 2 deletions inc/jetpack.php
Expand Up @@ -33,9 +33,9 @@ function alcatraz_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
if ( is_search() ) :
get_template_part( 'template-parts/content', 'search' );
get_template_part( 'template-parts/content', 'search' );
else :
get_template_part( 'template-parts/content', get_post_format() );
get_template_part( 'template-parts/content', get_post_format() );
endif;
}
} // end function alcatraz_infinite_scroll_render

0 comments on commit 45899c1

Please sign in to comment.