wppaste
WordPress

twentyseventeen_scripts()

Since
Twenty Seventeen 1.0
Source
wp-content/themes/twentyseventeen/functions.php:464
Enqueues scripts and styles.

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

Reaches the database via get_post().

Scaling
Constant

No loop in the body: the same number of instructions runs whatever you pass in.

Instructions
104–156

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 157.

Plugin surface
None

Nothing here hands control to plugin code.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What it touches

  • optionoption read or writeget_option()called directly
  • hookthird-party callbacksapply_filters()one call below twentyseventeen_scripts()
  • querycontent queryget_post()one call below twentyseventeen_scripts()
  • cacheobject cachewp_cache_get()one call below twentyseventeen_scripts()
  • serializeserialisationmaybe_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.

WhenInstructionsCalls it makes
!is_customize_preview() && !has_nav_menu() && !is_singular()104–105twentyseventeen_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–108twentyseventeen_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–110twentyseventeen_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–111twentyseventeen_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–112twentyseventeen_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–113twentyseventeen_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–114twentyseventeen_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–114twentyseventeen_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–115twentyseventeen_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–116twentyseventeen_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–117twentyseventeen_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–117twentyseventeen_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–118twentyseventeen_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–119twentyseventeen_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–119twentyseventeen_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–120twentyseventeen_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–121twentyseventeen_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–121twentyseventeen_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–122twentyseventeen_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–123twentyseventeen_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–124twentyseventeen_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–126twentyseventeen_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–126twentyseventeen_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–129twentyseventeen_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–132twentyseventeen_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–135twentyseventeen_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–137twentyseventeen_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–138twentyseventeen_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–139twentyseventeen_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–140twentyseventeen_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–141twentyseventeen_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–141twentyseventeen_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–142twentyseventeen_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–143twentyseventeen_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–144twentyseventeen_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–144twentyseventeen_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–145twentyseventeen_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–146twentyseventeen_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–146twentyseventeen_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–147twentyseventeen_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–148twentyseventeen_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–148twentyseventeen_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–149twentyseventeen_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–150twentyseventeen_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–151twentyseventeen_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–153twentyseventeen_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–153twentyseventeen_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–156twentyseventeen_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

PHPCompiledExecutedBranchesNotes
8.6-dev157104–1568
8.5157104–1568
8.4157104–15683 fewer instructions than PHP 8.3
8.3160107–1598
8.2160107–1598
8.1160107–1598
7.4160107–1598

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

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.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 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.