Changeset 9908 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php
- Timestamp:
- 05/24/2020 07:27:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php
r9865 r9908 14 14 remove_action( 'customize_preview_init', 'breathe_customize_preview_js' ); 15 15 remove_filter( 'wp_head', 'breathe_color_styles' ); 16 17 16 add_action( 'customize_register', __NAMESPACE__ . '\customize_register' ); 17 18 add_filter( 'o2_filtered_content', __NAMESPACE__ . '\append_last_updated', 10, 2 ); 18 19 } 19 20 add_action( 'after_setup_theme', __NAMESPACE__ . '\after_setup_theme', 11 ); … … 236 237 237 238 /** 239 * Appends a 'Last updated' to handbook pages. 240 * 241 * @param string $content Content of the current post. 242 * @return Content of the current post. 243 */ 244 function append_last_updated( $content, $post ) { 245 if ( ! function_exists( 'wporg_is_handbook' ) || ! wporg_is_handbook( $post->post_type ) ) { 246 return $content; 247 } 248 249 $content .= sprintf( 250 /* translators: %s: Date of last update. */ 251 '<p class="handbook-last-updated">' . __( 'Last updated: %s', 'wporg' ) . '</p>', 252 sprintf( 253 '<time datetime="%s">%s</time>', 254 esc_attr( get_the_modified_date( DATE_W3C ) ), 255 esc_html( get_the_modified_date() ) 256 ) 257 ); 258 259 return $content; 260 } 261 262 /** 238 263 * Register translations for plugins without their own GlotPress project. 239 264 */
Note: See TracChangeset
for help on using the changeset viewer.