Changes between Version 2 and Version 3 of Ticket #53910, comment 8
- Timestamp:
- 08/11/2021 12:36:48 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #53910, comment 8
v2 v3 19 19 <?php 20 20 if ( have_posts() ) : while( have_posts() ) : the_post(); 21 if ( get_post_field( 'post_name', get_the_ID() ) === sanitize_title_with_dashes( get_the_title() ) ) { 22 echo 'Yes'; 23 } else { 24 echo 'No'; 25 } 21 $slug = get_post_field( 'post_name', get_the_ID() ); 22 $sanitized_title = sanitize_title_with_dashes( get_the_title() ); 23 echo ( $slug === $sanitized_title ) ? 'Yes' : 'No'; 26 24 endwhile; endif; 27 25 ?>