Changeset 3014138
- Timestamp:
- 12/25/2023 06:57:52 PM (2 years ago)
- Location:
- indieweb-post-kinds
- Files:
-
- 4 edited
- 1 copied
-
tags/3.7.2 (copied) (copied from indieweb-post-kinds/trunk)
-
tags/3.7.2/includes/kind-functions.php (modified) (2 diffs)
-
tags/3.7.2/readme.txt (modified) (2 diffs)
-
trunk/includes/kind-functions.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indieweb-post-kinds/tags/3.7.2/includes/kind-functions.php
r2973430 r3014138 137 137 * 138 138 * @param WP_Post|null Post to Display. 139 * @param string|array Classes to add to link 140 * @param string|array Classes to add to the date 139 141 * @return string Marked up link to a post. 140 142 **/ 141 143 142 function kind_get_the_link( $post = null, $cls = null ) {144 function kind_get_the_link( $post = null, $cls = null, $date_cls = null ) { 143 145 $post = get_post( $post ); 144 146 $kind = get_post_kind_slug( $post ); … … 147 149 $cls = implode( ' ', $cls ); 148 150 } 149 $cls = 'class=' . $cls; 150 $time_string = '<time %1$s datetime="%2$s">%3$s</time>'; 151 152 if ( is_array( $date_cls ) ) { 153 $date_cls = implode( ' ', $date_cls ); 154 } 155 156 $time_string = '<time class="%3$s" datetime="%1$s">%2$s</time>'; 151 157 $time_string = sprintf( 152 158 $time_string, 153 esc_attr( $cls ),154 159 esc_attr( get_the_date( DATE_W3C, $post ) ), 155 get_the_date( '', $post ) 160 get_the_date( '', $post ), 161 $date_cls 156 162 ); 157 return sprintf( '<a href="%2$s">%1$s</a> - %3$s', kind_get_the_title( $post, $kind ), get_the_permalink( $post ), $time_string);163 return sprintf( '<a class="%4$s" href="%2$s">%1$s</a> - %3$s', kind_get_the_title( $post, $kind ), get_the_permalink( $post ), $time_string, esc_attr( $cls ) ); 158 164 } 159 165 -
indieweb-post-kinds/tags/3.7.2/readme.txt
r3011061 r3014138 2 2 Contributors: dshanske 3 3 Tags: indieweb, interaction, posts, webmention, share, like, scrobble 4 Stable tag: 3.7. 14 Stable tag: 3.7.2 5 5 Requires at least: 4.9.9 6 6 Requires PHP: 7.0 … … 281 281 282 282 == Changelog == 283 284 = 3.7.2 ( 2023-12-25 ) = 285 * Fix markup on kind_get_the_link function to allow for classes for date for overall link 283 286 284 287 = 3.7.1 ( 2023-12-17 ) = -
indieweb-post-kinds/trunk/includes/kind-functions.php
r2973430 r3014138 137 137 * 138 138 * @param WP_Post|null Post to Display. 139 * @param string|array Classes to add to link 140 * @param string|array Classes to add to the date 139 141 * @return string Marked up link to a post. 140 142 **/ 141 143 142 function kind_get_the_link( $post = null, $cls = null ) {144 function kind_get_the_link( $post = null, $cls = null, $date_cls = null ) { 143 145 $post = get_post( $post ); 144 146 $kind = get_post_kind_slug( $post ); … … 147 149 $cls = implode( ' ', $cls ); 148 150 } 149 $cls = 'class=' . $cls; 150 $time_string = '<time %1$s datetime="%2$s">%3$s</time>'; 151 152 if ( is_array( $date_cls ) ) { 153 $date_cls = implode( ' ', $date_cls ); 154 } 155 156 $time_string = '<time class="%3$s" datetime="%1$s">%2$s</time>'; 151 157 $time_string = sprintf( 152 158 $time_string, 153 esc_attr( $cls ),154 159 esc_attr( get_the_date( DATE_W3C, $post ) ), 155 get_the_date( '', $post ) 160 get_the_date( '', $post ), 161 $date_cls 156 162 ); 157 return sprintf( '<a href="%2$s">%1$s</a> - %3$s', kind_get_the_title( $post, $kind ), get_the_permalink( $post ), $time_string);163 return sprintf( '<a class="%4$s" href="%2$s">%1$s</a> - %3$s', kind_get_the_title( $post, $kind ), get_the_permalink( $post ), $time_string, esc_attr( $cls ) ); 158 164 } 159 165 -
indieweb-post-kinds/trunk/readme.txt
r3011061 r3014138 2 2 Contributors: dshanske 3 3 Tags: indieweb, interaction, posts, webmention, share, like, scrobble 4 Stable tag: 3.7. 14 Stable tag: 3.7.2 5 5 Requires at least: 4.9.9 6 6 Requires PHP: 7.0 … … 281 281 282 282 == Changelog == 283 284 = 3.7.2 ( 2023-12-25 ) = 285 * Fix markup on kind_get_the_link function to allow for classes for date for overall link 283 286 284 287 = 3.7.1 ( 2023-12-17 ) =
Note: See TracChangeset
for help on using the changeset viewer.