From eff044d59af54eb925f6d172f57d75b1991f90ba Mon Sep 17 00:00:00 2001 From: lucha <lucha@paranoici.org> Date: Sun, 23 Aug 2015 16:17:33 +0200 Subject: [PATCH] Patch themes twenty* Patch theme twentyten, twentyeleven, twentytwelve, twentythirtheen, twentyfourteen, twentyfifteen, twentysixteen, twentyseventeen Added a/i credits, and removed Google Fonts API. --- wp-content/themes/twentyfifteen/footer.php | 7 +- wp-content/themes/twentyfifteen/functions.php | 72 +++---------------- wp-content/themes/twentyfourteen/footer.php | 4 +- .../themes/twentyfourteen/functions.php | 13 +--- .../themes/twentyseventeen/functions.php | 7 +- wp-content/themes/twentysixteen/functions.php | 3 +- wp-content/themes/twentyten/footer.php | 6 +- .../themes/twentythirteen/functions.php | 2 + wp-content/themes/twentytwelve/functions.php | 2 + 9 files changed, 30 insertions(+), 86 deletions(-) diff --git a/wp-content/themes/twentyfifteen/footer.php b/wp-content/themes/twentyfifteen/footer.php index 6447da0e1..2097c9fd2 100644 --- a/wp-content/themes/twentyfifteen/footer.php +++ b/wp-content/themes/twentyfifteen/footer.php @@ -22,14 +22,13 @@ */ do_action( 'twentyfifteen_credits' ); ?> - <?php + +<?php if ( function_exists( 'the_privacy_policy_link' ) ) { the_privacy_policy_link( '', '<span role="separator" aria-hidden="true"></span>' ); } ?> - <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyfifteen' ) ); ?>" class="imprint"> - <?php printf( __( 'Proudly powered by %s', 'twentyfifteen' ), 'WordPress' ); ?> - </a> + <strong>Proudly powered by <a href="http://www.autistici.org">R*</a></strong> </div><!-- .site-info --> </footer><!-- .site-footer --> diff --git a/wp-content/themes/twentyfifteen/functions.php b/wp-content/themes/twentyfifteen/functions.php index db6451f0b..9e5f50fd6 100644 --- a/wp-content/themes/twentyfifteen/functions.php +++ b/wp-content/themes/twentyfifteen/functions.php @@ -276,67 +276,15 @@ function twentyfifteen_widgets_init() { add_action( 'widgets_init', 'twentyfifteen_widgets_init' ); if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) : - /** - * Register Google fonts for Twenty Fifteen. - * - * @since Twenty Fifteen 1.0 - * - * @return string Google fonts URL for the theme. - */ - function twentyfifteen_fonts_url() { - $fonts_url = ''; - $fonts = array(); - $subsets = 'latin,latin-ext'; - - /* - * Translators: If there are characters in your language that are not supported - * by Noto Sans, translate this to 'off'. Do not translate into your own language. - */ - if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'twentyfifteen' ) ) { - $fonts[] = 'Noto Sans:400italic,700italic,400,700'; - } - - /* - * Translators: If there are characters in your language that are not supported - * by Noto Serif, translate this to 'off'. Do not translate into your own language. - */ - if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'twentyfifteen' ) ) { - $fonts[] = 'Noto Serif:400italic,700italic,400,700'; - } - - /* - * Translators: If there are characters in your language that are not supported - * by Inconsolata, translate this to 'off'. Do not translate into your own language. - */ - if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentyfifteen' ) ) { - $fonts[] = 'Inconsolata:400,700'; - } - - /* - * Translators: To add an additional character subset specific to your language, - * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. - */ - $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'twentyfifteen' ); - - if ( 'cyrillic' == $subset ) { - $subsets .= ',cyrillic,cyrillic-ext'; - } elseif ( 'greek' == $subset ) { - $subsets .= ',greek,greek-ext'; - } elseif ( 'devanagari' == $subset ) { - $subsets .= ',devanagari'; - } elseif ( 'vietnamese' == $subset ) { - $subsets .= ',vietnamese'; - } - - if ( $fonts ) { - $fonts_url = add_query_arg( - array( - 'family' => urlencode( implode( '|', $fonts ) ), - 'subset' => urlencode( $subsets ), - ), - 'https://fonts.googleapis.com/css' - ); - } +/** + * Register Google fonts for Twenty Fifteen. + * + * @since Twenty Fifteen 1.0 + * + * @return string Google fonts URL for the theme. + */ +function twentyfifteen_fonts_url() { + $fonts_url = ''; return $fonts_url; } @@ -425,6 +373,7 @@ add_action( 'enqueue_block_editor_assets', 'twentyfifteen_block_editor_styles' ) * @param string $relation_type The relation type the URLs are printed. * @return array URLs to print for resource hints. */ +/* function twentyfifteen_resource_hints( $urls, $relation_type ) { if ( wp_style_is( 'twentyfifteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { @@ -440,6 +389,7 @@ function twentyfifteen_resource_hints( $urls, $relation_type ) { return $urls; } add_filter( 'wp_resource_hints', 'twentyfifteen_resource_hints', 10, 2 ); +*/ /** * Add featured image as background image to post navigation elements. diff --git a/wp-content/themes/twentyfourteen/footer.php b/wp-content/themes/twentyfourteen/footer.php index d1016eb96..51bd4833d 100644 --- a/wp-content/themes/twentyfourteen/footer.php +++ b/wp-content/themes/twentyfourteen/footer.php @@ -23,9 +23,7 @@ the_privacy_policy_link( '', '<span role="separator" aria-hidden="true"></span>' ); } ?> - <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyfourteen' ) ); ?>" class="imprint"> - <?php printf( __( 'Proudly powered by %s', 'twentyfourteen' ), 'WordPress' ); ?> - </a> + <strong>Proudly powered by <a href="http://www.autistici.org">R*</a></strong> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> diff --git a/wp-content/themes/twentyfourteen/functions.php b/wp-content/themes/twentyfourteen/functions.php index c017dac64..ec71dff88 100644 --- a/wp-content/themes/twentyfourteen/functions.php +++ b/wp-content/themes/twentyfourteen/functions.php @@ -288,17 +288,6 @@ add_action( 'widgets_init', 'twentyfourteen_widgets_init' ); */ function twentyfourteen_font_url() { $font_url = ''; - /* - * Translators: If there are characters in your language that are not supported - * by Lato, translate this to 'off'. Do not translate into your own language. - */ - if ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) ) { - $query_args = array( - 'family' => urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ), - 'subset' => urlencode( 'latin,latin-ext' ), - ); - $font_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); - } return $font_url; } @@ -372,6 +361,7 @@ add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen * @param string $relation_type The relation type the URLs are printed. * @return array URLs to print for resource hints. */ +/* function twentyfourteen_resource_hints( $urls, $relation_type ) { if ( wp_style_is( 'twentyfourteen-lato', 'queue' ) && 'preconnect' === $relation_type ) { if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { @@ -387,6 +377,7 @@ function twentyfourteen_resource_hints( $urls, $relation_type ) { return $urls; } add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 ); +*/ /** * Enqueue styles for the block-based editor. diff --git a/wp-content/themes/twentyseventeen/functions.php b/wp-content/themes/twentyseventeen/functions.php index 1ef1b570a..952da193e 100644 --- a/wp-content/themes/twentyseventeen/functions.php +++ b/wp-content/themes/twentyseventeen/functions.php @@ -299,8 +299,8 @@ function twentyseventeen_fonts_url() { 'subset' => urlencode( 'latin,latin-ext' ), 'display' => urlencode( 'fallback' ), ); - - $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); + // A/I removed google fonts + $fonts_url = add_query_arg( $query_args, '' ); } return esc_url_raw( $fonts_url ); @@ -318,7 +318,8 @@ function twentyseventeen_fonts_url() { function twentyseventeen_resource_hints( $urls, $relation_type ) { if ( wp_style_is( 'twentyseventeen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { $urls[] = array( - 'href' => 'https://fonts.gstatic.com', + // A/I removed google Fonts + 'href' => '', 'crossorigin', ); } diff --git a/wp-content/themes/twentysixteen/functions.php b/wp-content/themes/twentysixteen/functions.php index c180b826f..b63354eb4 100644 --- a/wp-content/themes/twentysixteen/functions.php +++ b/wp-content/themes/twentysixteen/functions.php @@ -346,7 +346,8 @@ if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : 'subset' => urlencode( $subsets ), 'display' => urlencode( 'fallback' ), ), - 'https://fonts.googleapis.com/css' + // A/I removed google fonts + '' ); } diff --git a/wp-content/themes/twentyten/footer.php b/wp-content/themes/twentyten/footer.php index 4763e99ab..3752b7001 100644 --- a/wp-content/themes/twentyten/footer.php +++ b/wp-content/themes/twentyten/footer.php @@ -43,9 +43,9 @@ */ do_action( 'twentyten_credits' ); ?> - <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyten' ) ); ?>" class="imprint" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyten' ); ?>"> - <?php printf( __( 'Proudly powered by %s.', 'twentyten' ), 'WordPress' ); ?> - </a> + + <strong>Proudly powered by <a href="http://www.autistici.org">R*</a></strong> + </div><!-- #site-generator --> </div><!-- #colophon --> diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index 2b2eb72fc..9e2175cde 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -271,6 +271,7 @@ add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' ); * @param string $relation_type The relation type the URLs are printed. * @return array URLs to print for resource hints. */ +/* function twentythirteen_resource_hints( $urls, $relation_type ) { if ( wp_style_is( 'twentythirteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { @@ -286,6 +287,7 @@ function twentythirteen_resource_hints( $urls, $relation_type ) { return $urls; } add_filter( 'wp_resource_hints', 'twentythirteen_resource_hints', 10, 2 ); +*/ /** * Enqueue styles for the block-based editor. diff --git a/wp-content/themes/twentytwelve/functions.php b/wp-content/themes/twentytwelve/functions.php index bdda0c644..fb5840166 100644 --- a/wp-content/themes/twentytwelve/functions.php +++ b/wp-content/themes/twentytwelve/functions.php @@ -208,6 +208,7 @@ add_action( 'enqueue_block_editor_assets', 'twentytwelve_block_editor_styles' ); * @param string $relation_type The relation type the URLs are printed. * @return array URLs to print for resource hints. */ +/* function twentytwelve_resource_hints( $urls, $relation_type ) { if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) && 'preconnect' === $relation_type ) { if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { @@ -223,6 +224,7 @@ function twentytwelve_resource_hints( $urls, $relation_type ) { return $urls; } add_filter( 'wp_resource_hints', 'twentytwelve_resource_hints', 10, 2 ); +*/ /** * Filter TinyMCE CSS path to include Google Fonts. -- GitLab