Browse Source

mode phpcs fixes

tags/8.0^2
Chris Wiegman 1 year ago
parent
commit
9599e8396e
No known key found for this signature in database GPG Key ID: 63C83F823595106A
5 changed files with 18 additions and 4 deletions
  1. +1
    -1
      includes/classes/widgets/class-latest-tweets.php
  2. +3
    -3
      includes/functions/core.php
  3. +9
    -0
      includes/functions/template-tags.php
  4. +4
    -0
      template-parts/content-none.php
  5. +1
    -0
      template-parts/content.php

+ 1
- 1
includes/classes/widgets/class-latest-tweets.php View File

@@ -243,7 +243,7 @@ class Latest_Tweets extends \WP_Widget {
public function update( $new_instance, $old_instance ) {

$instance = array();
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['title'] = wp_strip_all_tags( $new_instance['title'] );
$instance['user_name'] = sanitize_text_field( str_replace( '@', '', $new_instance['user_name'] ) );
$instance['tweet_count'] = absint( $new_instance['tweet_count'] );



+ 3
- 3
includes/functions/core.php View File

@@ -246,7 +246,7 @@ function filter_wp_default_scripts( $scripts ) {
* @since 5.1.0
*
* @param string $items The HTML list content for the menu items.
* @param object $args An object containing wp_nav_menu() arguments.
* @param mixed $args An object containing wp_nav_menu() arguments.
*
* @return string Filtered HTML list of menu items
*/
@@ -412,8 +412,8 @@ function action_gform_post_add_entry( $entry, $form ) {
*
* @since 8.0
*
* @param int $post_id The ID of the current post.
* @param sting $comment_status The status flag for the comment.
* @param int $post_id The ID of the current post.
* @param string $comment_status The status flag for the comment.
*/
function action_comment_post( $post_id, $comment_status ) {



+ 9
- 0
includes/functions/template-tags.php View File

@@ -40,17 +40,22 @@ function paging_nav( $query = null ) {

<?php if ( get_next_posts_link( null, $query->max_num_pages ) ) { ?>

<?php // translators: arrow is direction indicator. ?>
<div class="nav-previous"><?php next_posts_link( sprintf( esc_html__( '%s Older posts', 'chriswiegman' ), '<span class="meta-nav">&larr;</span>' ), $query->max_num_pages ); ?></div>
<?php } ?>

<?php if ( get_previous_posts_link() ) { ?>

<?php // translators: arrow is direction indicator. ?>
<div class="nav-next"><?php previous_posts_link( sprintf( esc_html__( 'Newer posts %s', 'chriswiegman' ), '<span class="meta-nav">&rarr;</span>' ) ); ?></div>

<?php } ?>

</div>
<!-- .nav-links -->
</nav><!-- .navigation -->
<?php

}

/**
@@ -75,6 +80,7 @@ function post_nav() {

<div class="nav-links">
<?php

previous_post_link( '<div class="nav-previous">%link</div>', _x( '<span class="meta-nav">&larr;</span>&nbsp;%title', 'Previous post link', 'chriswiegman' ) );
next_post_link( '<div class="nav-next">%link</div>', _x( '%title&nbsp;<span class="meta-nav">&rarr;</span>', 'Next post link', 'chriswiegman' ) );
?>
@@ -82,6 +88,7 @@ function post_nav() {
<!-- .nav-links -->
</nav><!-- .navigation -->
<?php

}

/**
@@ -112,6 +119,7 @@ function posted_on() {
if ( get_the_author_meta( 'ID' ) !== 2 ) {

$byline = sprintf(
// translators: placeholder is author.
_x( ' by %s', 'post author', 'chriswiegman' ),
'<span class="byline"> <span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span> </span>'
);
@@ -297,6 +305,7 @@ function get_comments_popup_link( $zero = false, $one = false, $more = false, $c
$attributes = '';

$return_string .= apply_filters( 'comments_popup_link_attributes', $attributes );
// translators: placeholder is post title.
$return_string .= ' title="' . esc_attr( sprintf( __( 'Comment on %s', 'chriswiegman' ), $title ) ) . '">';
$return_string .= get_comments_number_string( $zero, $one, $more );
$return_string .= '</a>';


+ 4
- 0
template-parts/content-none.php View File

@@ -10,6 +10,7 @@
*/

namespace CW\Theme\Templates\Parts\Content\None;

?>

<section class="no-results not-found">
@@ -20,7 +21,10 @@ namespace CW\Theme\Templates\Parts\Content\None;
<div class="page-content">
<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>

<?php // @codingStandardsIgnoreStart ?>
<?php // translators: placeholder is url. ?>
<p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'chriswiegman' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<?php // @codingStandardsIgnoreEnd ?>

<?php elseif ( is_search() ) : ?>



+ 1
- 0
template-parts/content.php View File

@@ -45,6 +45,7 @@ use CW\Theme\Functions\Template_Tags;

<div class="entry-content">
<?php
// translators: placeholder is direction arrow.
the_content( sprintf( esc_html__( 'Continue Reading %s', 'chriswiegman' ), '<span class="meta-nav">&rarr;</span>' ) );

wp_link_pages(