Commit 3228f383 authored by lucha's avatar lucha Committed by agata

Patch themes twenty*

Patch theme twentyten, twentyeleven, twentytwelve, twentythirtheen,
twentyfourteen, twentyfifteen, twentysixteen, twentyseventeen

Added a/i credits, and removed Google Fonts API.
parent ddad0441
......@@ -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 -->
......
......@@ -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.
......
......@@ -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 -->
......
......@@ -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.
......
......@@ -280,27 +280,6 @@ add_action( 'template_redirect', 'twentyseventeen_content_width', 0 );
*/
function twentyseventeen_fonts_url() {
$fonts_url = '';
/*
* Translators: If there are characters in your language that are not
* supported by Libre Franklin, translate this to 'off'. Do not translate
* into your own language.
*/
$libre_franklin = _x( 'on', 'Libre Franklin font: on or off', 'twentyseventeen' );
if ( 'off' !== $libre_franklin ) {
$font_families = array();
$font_families[] = 'Libre Franklin:300,300i,400,400i,600,600i,800,800i';
$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return esc_url_raw( $fonts_url );
}
......@@ -313,6 +292,7 @@ function twentyseventeen_fonts_url() {
* @param string $relation_type The relation type the URLs are printed.
* @return array $urls URLs to print for resource hints.
*/
/*
function twentyseventeen_resource_hints( $urls, $relation_type ) {
if ( wp_style_is( 'twentyseventeen-fonts', 'queue' ) && 'preconnect' === $relation_type ) {
$urls[] = array(
......@@ -324,6 +304,7 @@ function twentyseventeen_resource_hints( $urls, $relation_type ) {
return $urls;
}
add_filter( 'wp_resource_hints', 'twentyseventeen_resource_hints', 10, 2 );
*/
/**
* Register widget area.
......
......@@ -57,9 +57,7 @@
the_privacy_policy_link( '', '<span role="separator" aria-hidden="true"></span>' );
}
?>
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentysixteen' ) ); ?>" class="imprint">
<?php printf( __( 'Proudly powered by %s', 'twentysixteen' ), 'WordPress' ); ?>
</a>
</div><!-- .site-info -->
</footer><!-- .site-footer -->
</div><!-- .site-inner -->
......
......@@ -299,47 +299,19 @@ function twentysixteen_widgets_init() {
add_action( 'widgets_init', 'twentysixteen_widgets_init' );
if ( ! function_exists( 'twentysixteen_fonts_url' ) ) :
/**
* Register Google fonts for Twenty Sixteen.
*
* Create your own twentysixteen_fonts_url() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*
* @return string Google fonts URL for the theme.
*/
function twentysixteen_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = 'latin,latin-ext';
/* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) {
$fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic';
}
/* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) {
$fonts[] = 'Montserrat: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', 'twentysixteen' ) ) {
$fonts[] = 'Inconsolata:400';
}
if ( $fonts ) {
$fonts_url = add_query_arg(
array(
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
),
'https://fonts.googleapis.com/css'
);
}
return $fonts_url;
}
/**
* Register Google fonts for Twenty Sixteen.
*
* Create your own twentysixteen_fonts_url() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*
* @return string Google fonts URL for the theme.
*/
function twentysixteen_fonts_url() {
$fonts_url = '';
return $fonts_url;
}
endif;
/**
......
......@@ -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 -->
......
......@@ -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.
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment