twentyseventeen_scripts()
- Since
- Twenty Seventeen 1.0
- Source
wp-content/themes/twentyseventeen/functions.php:464
Compatibility
- WordPress
- since Twenty Seventeen 1.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Performance profile
How much work a call to twentyseventeen_scripts() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Heavy
- Scaling
- Constant
- Instructions
- 104–156
- Plugin surface
- None
- Called by
- 0
Reaches the database via get_post().
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 157.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- optionoption read or write
get_option()called directly - hookthird-party callbacks
apply_filters()one call below twentyseventeen_scripts() - querycontent query
get_post()one call below twentyseventeen_scripts() - cacheobject cache
wp_cache_get()one call below twentyseventeen_scripts() - serializeserialisation
maybe_unserialize()one call below twentyseventeen_scripts()
Further down the call graph this can also reach transient. That is the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 48 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost twentyseventeen_scripts() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!is_customize_preview() && !has_nav_menu() && !is_singular() | 104–105 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!is_customize_preview() && !has_nav_menu() && is_singular() && !comments_open() | 107–108 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
!has_nav_menu() && !is_singular() | 109–110 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!is_customize_preview() && !has_nav_menu() && !is_singular() | 110–111 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!is_customize_preview() && !has_nav_menu() && is_singular() && comments_open() && !get_option() | 111–112 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
!has_nav_menu() && is_singular() && !comments_open() | 112–113 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
!is_customize_preview() && !has_nav_menu() && is_singular() && !comments_open() | 113–114 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
!has_nav_menu() && !is_singular() | 113–114 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!is_customize_preview() && !has_nav_menu() && is_singular() && comments_open() && get_option() | 114–115 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
is_customize_preview() && !has_nav_menu() && !is_singular() | 115–116 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!has_nav_menu() && is_singular() && comments_open() && !get_option() | 116–117 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
!has_nav_menu() && is_singular() && !comments_open() | 116–117 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
36 further outcomes, up to 156 instructions
!is_customize_preview() && !has_nav_menu() && is_singular() && comments_open() && !get_option() | 117–118 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
is_customize_preview() && !has_nav_menu() && is_singular() && !comments_open() | 118–119 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
is_customize_preview() && !has_nav_menu() && !is_singular() | 118–119 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!has_nav_menu() && is_singular() && comments_open() && get_option() | 119–120 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
!is_customize_preview() && !has_nav_menu() && is_singular() && comments_open() && get_option() | 120–121 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
!has_nav_menu() && is_singular() && comments_open() && !get_option() | 120–121 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
is_customize_preview() && !has_nav_menu() && is_singular() && !comments_open() | 121–122 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
is_customize_preview() && !has_nav_menu() && is_singular() && comments_open() && !get_option() | 122–123 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
!has_nav_menu() && is_singular() && comments_open() && get_option() | 123–124 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
is_customize_preview() && !has_nav_menu() && is_singular() && comments_open() && get_option() | 125–126 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
is_customize_preview() && !has_nav_menu() && is_singular() && comments_open() && !get_option() | 125–126 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
is_customize_preview() && !has_nav_menu() && is_singular() && comments_open() && get_option() | 128–129 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
!is_customize_preview() && has_nav_menu() && !is_singular() | 131–132 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!is_customize_preview() && has_nav_menu() && is_singular() && !comments_open() | 134–135 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
has_nav_menu() && !is_singular() | 136–137 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!is_customize_preview() && has_nav_menu() && !is_singular() | 137–138 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!is_customize_preview() && has_nav_menu() && is_singular() && comments_open() && !get_option() | 138–139 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
has_nav_menu() && is_singular() && !comments_open() | 139–140 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
!is_customize_preview() && has_nav_menu() && is_singular() && !comments_open() | 140–141 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
has_nav_menu() && !is_singular() | 140–141 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
!is_customize_preview() && has_nav_menu() && is_singular() && comments_open() && get_option() | 141–142 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
is_customize_preview() && has_nav_menu() && !is_singular() | 142–143 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
has_nav_menu() && is_singular() && comments_open() && !get_option() | 143–144 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
has_nav_menu() && is_singular() && !comments_open() | 143–144 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
!is_customize_preview() && has_nav_menu() && is_singular() && comments_open() && !get_option() | 144–145 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
is_customize_preview() && has_nav_menu() && is_singular() && !comments_open() | 145–146 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
is_customize_preview() && has_nav_menu() && !is_singular() | 145–146 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular() |
has_nav_menu() && is_singular() && comments_open() && get_option() | 146–147 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
!is_customize_preview() && has_nav_menu() && is_singular() && comments_open() && get_option() | 147–148 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
has_nav_menu() && is_singular() && comments_open() && !get_option() | 147–148 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
is_customize_preview() && has_nav_menu() && is_singular() && !comments_open() | 148–149 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open() |
is_customize_preview() && has_nav_menu() && is_singular() && comments_open() && !get_option() | 149–150 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
has_nav_menu() && is_singular() && comments_open() && get_option() | 150–151 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
is_customize_preview() && has_nav_menu() && is_singular() && comments_open() && get_option() | 152–153 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
is_customize_preview() && has_nav_menu() && is_singular() && comments_open() && !get_option() | 152–153 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option() |
is_customize_preview() && has_nav_menu() && is_singular() && comments_open() && get_option() | 155–156 | twentyseventeen_fonts_url(), get_template_directory_uri(), twentyseventeen_fonts_url(), wp_enqueue_style(), get_stylesheet_uri(), wp_enqueue_style(), get_theme_file_uri(), wp_enqueue_style(), get_theme_mod(), is_customize_preview(), get_theme_file_uri(), wp_enqueue_style(), is_customize_preview(), wp_register_style(), wp_register_style(), wp_register_script(), get_theme_file_uri(), wp_register_script(), get_theme_file_uri(), wp_enqueue_script(), twentyseventeen_get_svg(), has_nav_menu(), get_theme_file_uri(), wp_enqueue_script(), __(), __(), twentyseventeen_get_svg(), wp_localize_script(), get_theme_file_uri(), wp_enqueue_script(), is_singular(), comments_open(), get_option(), wp_enqueue_script() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 157 | 104–156 | 8 | |
| 8.5 | 157 | 104–156 | 8 | |
| 8.4 | 157 | 104–156 | 8 | 3 fewer instructions than PHP 8.3 |
| 8.3 | 160 | 107–159 | 8 | |
| 8.2 | 160 | 107–159 | 8 | |
| 8.1 | 160 | 107–159 | 8 | |
| 7.4 | 160 | 107–159 | 8 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 17
- twentyseventeen_fonts_url()Registers custom fonts.
- get_template_directory_uri()Retrieves template directory URI for the active theme.
- wp_enqueue_style()Enqueues a CSS stylesheet.
- get_stylesheet_uri()Retrieves stylesheet URI for the active theme.
- get_theme_file_uri()Retrieves the URL of a file in the theme.
- get_theme_mod()Retrieves theme modification value for the active theme.
- is_customize_preview()Whether the site is being previewed in the Customizer.
- wp_register_style()Registers a CSS stylesheet.
- wp_register_script()Registers a new script.
- wp_enqueue_script()Enqueues a script.
- twentyseventeen_get_svg()Returns SVG markup.
- has_nav_menu()Determines whether a registered nav menu location has a menu assigned to it.
Show all 17
- __()Retrieves the translation of $text.
- wp_localize_script()Localizes a script.
- is_singular()Determines whether the query is for an existing single post of any post type (post, attachment, page, custom post types).
- comments_open()Determines whether the current post is open for comments.
- get_option()Retrieves an option value based on an option name.
Source code
function twentyseventeen_scripts() { // Add custom fonts, used in the main stylesheet. $font_version = ( 0 === strpos( (string) twentyseventeen_fonts_url(), get_template_directory_uri() . '/' ) ) ? '20230328' : null; wp_enqueue_style( 'twentyseventeen-fonts', twentyseventeen_fonts_url(), array(), $font_version ); // Theme stylesheet. wp_enqueue_style( 'twentyseventeen-style', get_stylesheet_uri(), array(), '20260819' ); // Theme block stylesheet. wp_enqueue_style( 'twentyseventeen-block-style', get_theme_file_uri( '/assets/css/blocks.css' ), array( 'twentyseventeen-style' ), '20240729' ); // Load the dark colorscheme. if ( 'dark' === get_theme_mod( 'colorscheme', 'light' ) || is_customize_preview() ) { wp_enqueue_style( 'twentyseventeen-colors-dark', get_theme_file_uri( '/assets/css/colors-dark.css' ), array( 'twentyseventeen-style' ), '20240412' ); } // Register handles for removed stylesheets and scripts. if ( is_customize_preview() ) { wp_register_style( 'twentyseventeen-ie9', false, array( 'twentyseventeen-style' ) ); } wp_register_style( 'twentyseventeen-ie8', false, array( 'twentyseventeen-style' ) ); wp_register_script( 'html5', false ); wp_register_script( 'twentyseventeen-skip-link-focus-fix', get_theme_file_uri( '/assets/js/skip-link-focus-fix.js' ), array(), '20161114', array( 'in_footer' => true ) ); wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '20211130', array( 'in_footer' => false, // Because involves header. 'strategy' => 'defer', ) ); $twentyseventeen_l10n = array( 'quote' => twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) ), ); if ( has_nav_menu( 'top' ) ) { wp_enqueue_script( 'twentyseventeen-navigation', get_theme_file_uri( '/assets/js/navigation.js' ), array( 'jquery' ), '20210122', array( 'in_footer' => false, // Because involves header. 'strategy' => 'defer', ) ); $twentyseventeen_l10n['expand'] = __( 'Expand child menu', 'twentyseventeen' ); $twentyseventeen_l10n['collapse'] = __( 'Collapse child menu', 'twentyseventeen' ); $twentyseventeen_l10n['icon'] = twentyseventeen_get_svg( array( 'icon' => 'angle-down', 'fallback' => true, ) ); } wp_localize_script( 'twentyseventeen-global', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n ); wp_enqueue_script( 'jquery-scrollto', get_theme_file_uri( '/assets/js/jquery.scrollTo.js' ), array( 'jquery' ), '2.1.3', array( 'in_footer' => true, 'strategy' => 'defer', ) ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }}Changelog
Introduced in Twenty Seventeen 1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-content/themes/twentyseventeen/functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.