Skip to content

Commit

Permalink
Merge pull request #4298 from Codeinwp/bugfix/pro/2854
Browse files Browse the repository at this point in the history
Fixed PHP warning in template_parts.php
  • Loading branch information
vytisbulkevicius authored Oct 28, 2024
2 parents 62fa6d1 + d4769e6 commit 1da5560
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions inc/views/template_parts.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,15 @@ public function link_excerpt_more( $moretag, $post_id = null ) {
)
);

$markup = '<a href="' . esc_url( get_the_permalink( $post_id ) ) . '"';
$markup .= ' class="' . esc_attr( $read_more_args['classes'] ) . '"';
// Return $new_moretag if 'text' key is not set in $read_more_args.
if ( ! isset( $read_more_args['text'] ) ) {
return $new_moretag;
}

$markup = '<a href="' . esc_url( get_the_permalink( $post_id ) ) . '"';
if ( ! empty( $read_more_args['classes'] ) ) {
$markup .= ' class="' . esc_attr( $read_more_args['classes'] ) . '"';
}
$markup .= ' rel="bookmark">';
$markup .= esc_html( $read_more_args['text'] );
$markup .= '<span class="screen-reader-text">' . get_the_title( $post_id ) . '</span>';
Expand Down

0 comments on commit 1da5560

Please sign in to comment.