Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
noblogs-wp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai
noblogs-wp
Commits
e5291ff2
Commit
e5291ff2
authored
8 years ago
by
lucha
Browse files
Options
Downloads
Patches
Plain Diff
[auto] theme: twentyfifteen 1.7
parent
0acfa8ef
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
wp-content/themes/twentyfifteen/functions.php
+38
-0
38 additions, 0 deletions
wp-content/themes/twentyfifteen/functions.php
with
38 additions
and
0 deletions
wp-content/themes/twentyfifteen/functions.php
+
38
−
0
View file @
e5291ff2
...
...
@@ -118,6 +118,19 @@ function twentyfifteen_setup() {
$default_color
=
trim
(
$color_scheme
[
0
],
'#'
);
// Setup the WordPress core custom background feature.
/**
* Filter Twenty Fifteen custom-header support arguments.
*
* @since Twenty Fifteen 1.0
*
* @param array $args {
* An array of custom-header support arguments.
*
* @type string $default-color Default color of the header.
* @type string $default-attachment Default attachment of the header.
* }
*/
add_theme_support
(
'custom-background'
,
apply_filters
(
'twentyfifteen_custom_background_args'
,
array
(
'default-color'
=>
$default_color
,
'default-attachment'
=>
'fixed'
,
...
...
@@ -272,6 +285,31 @@ function twentyfifteen_scripts() {
}
add_action
(
'wp_enqueue_scripts'
,
'twentyfifteen_scripts'
);
/**
* Add preconnect for Google Fonts.
*
* @since Twenty Fifteen 1.7
*
* @param array $urls URLs to print for resource hints.
* @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'
,
'>='
)
)
{
$urls
[]
=
array
(
'href'
=>
'https://fonts.gstatic.com'
,
'crossorigin'
,
);
}
else
{
$urls
[]
=
'https://fonts.gstatic.com'
;
}
}
return
$urls
;
}
add_filter
(
'wp_resource_hints'
,
'twentyfifteen_resource_hints'
,
10
,
2
);
/**
* Add featured image as background image to post navigation elements.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment