get( 'Version' ) // this only works if you have Version in the style header ); } } if ( !function_exists( "degruchy_org_disable_archive_prefix" ) ) { /** * Removes the archive prefix title from any listing-style pages that are auto-generated, these sorts of prefixes, * while helpful, feel more annoying to me. * * @param string $title Title string to be manipulated. * * @return string The mangled string. * @since 1.1 */ function degruchy_org_disable_archive_prefix( string $title ) :string { if ( is_category() ) { $title = single_cat_title( '', FALSE ); } else if ( is_tag() ) { $title = single_tag_title( '', FALSE ); } else if ( is_author() ) { $title = '' . get_the_author() . ''; } else if ( is_post_type_archive() ) { $title = post_type_archive_title( '', FALSE ); } else if ( is_tax() ) { $title = single_term_title( '', FALSE ); } return $title; } } if( !function_exists( "degruchy_twenty_twenty_one_social_icons_map" ) ) { /** * Add mastodon support in social icons * @param Array $icons List of existing social icons to append * @link https://wordpress.org/support/topic/2021-social-icons/ * @since 1.1.3 * @return array An array of icons for the social menu */ function degruchy_twenty_twenty_one_social_icons_map( array $icons ): Array { $icons[ 'mastodon' ] = array( 'fosstodon.org', // this only maps fosstodon, you could add more here ); return $icons; } } if( !function_exists( "degruchy_twenty_twenty_one_svg_icons_social" )) { /** * @param $icons array List of existing social icons svg content * @since 1.1.3 * @return array an updated repository of SVG icons for the social menu */ function degruchy_twenty_twenty_one_svg_icons_social( array $icons ): Array { $icons[ 'mastodon' ] = ''; return $icons; } } /** * Prints HTML with meta information for the categories, tags and comments. * Footer entry meta is displayed differently in archives and single posts. * * @since Twenty Twenty-One 1.0 * * @return void */ function twenty_twenty_one_entry_meta_footer() { // Early exit if not a post. if ('post' !== get_post_type()) { return; } // Hide meta information on pages. if (!is_single()) { if (is_sticky()) { echo '

' . esc_html_x('Featured post', 'Label for sticky posts', 'twentytwentyone') . '

'; } $post_format = get_post_format(); if ('aside' === $post_format || 'status' === $post_format) { echo '

' . twenty_twenty_one_continue_reading_text() . '

'; // phpcs:ignore WordPress.Security.EscapeOutput } // Posted on. twenty_twenty_one_posted_on(); // Edit post link. edit_post_link( sprintf( /* translators: %s: Name of current post. Only visible to screen readers. */ esc_html__('Edit %s', 'twentytwentyone'), '' . get_the_title() . '' ), '', '
' ); if (has_category() || has_tag()) { echo '
'; /* translators: Used between list items, there is a space after the comma. */ $categories_list = get_the_category_list(__(', ', 'twentytwentyone')); if ($categories_list) { printf( /* translators: %s: List of categories. */ '' . esc_html__('Categorized as %s', 'twentytwentyone') . ' ', $categories_list // phpcs:ignore WordPress.Security.EscapeOutput ); } /* translators: Used between list items, there is a space after the comma. */ $tags_list = get_the_tag_list('', __(', ', 'twentytwentyone')); if ($tags_list) { printf( /* translators: %s: List of tags. */ '' . esc_html__('Tagged %s', 'twentytwentyone') . '', $tags_list // phpcs:ignore WordPress.Security.EscapeOutput ); } echo '
'; } } else { echo '
'; // Posted on. twenty_twenty_one_posted_on(); // Posted by. twenty_twenty_one_posted_by(); // Edit post link. edit_post_link( sprintf( /* translators: %s: Name of current post. Only visible to screen readers. */ esc_html__('Edit %s', 'twentytwentyone'), '' . get_the_title() . '' ), '', '' ); echo '
'; if (has_category() || has_tag()) { echo '
'; /* translators: Used between list items, there is a space after the comma. */ $categories_list = get_the_category_list(__(', ', 'twentytwentyone')); if ($categories_list) { printf( /* translators: %s: List of categories. */ '' . esc_html__('Categorized as %s', 'twentytwentyone') . ' ', $categories_list // phpcs:ignore WordPress.Security.EscapeOutput ); } /* translators: Used between list items, there is a space after the comma. */ $tags_list = get_the_tag_list('', __(', ', 'twentytwentyone')); if ($tags_list) { printf( /* translators: %s: List of tags. */ '' . esc_html__('Tagged %s', 'twentytwentyone') . '', $tags_list // phpcs:ignore WordPress.Security.EscapeOutput ); } echo '
'; } } } /** * Prints HTML with meta information for the current post-date/time. * * @since Twenty Twenty-One 1.0 * * @return void */ function twenty_twenty_one_posted_on() { $time_string = ''; $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ) ); echo ''; printf( /* translators: %s: Publish date. */ esc_html__( 'Published %s', 'twentytwentyone' ), $time_string // phpcs:ignore WordPress.Security.EscapeOutput ); echo ''; } add_filter( 'twenty_twenty_one_social_icons_map', 'degruchy_twenty_twenty_one_social_icons_map' ); add_filter( 'twenty_twenty_one_svg_icons_social', 'degruchy_twenty_twenty_one_svg_icons_social' ); add_filter( 'get_the_archive_title', 'degruchy_org_disable_archive_prefix' ); add_action( 'wp_enqueue_scripts', 'degruchy_org_enqueue_tto_styles' );