Action hook 'after_setup_theme'

in WP Core File wp-settings.php at line 705

View Source

after_setup_theme

Action Hook
Description
Fires after the theme is loaded.

Hook Information

File Location wp-settings.php View on GitHub
Hook Type Action
Line Number 705

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into after_setup_theme
add_action('after_setup_theme', 'my_custom_function');

function my_custom_function() {
    // Your custom code here
}

Source Code Context

wp-settings.php:705 - How this hook is used in WordPress core
<?php
 700  /**
 701   * Fires after the theme is loaded.
 702   *
 703   * @since 3.0.0
 704   */
 705  do_action( 'after_setup_theme' );
 706  
 707  // Create an instance of WP_Site_Health so that Cron events may fire.
 708  if ( ! class_exists( 'WP_Site_Health' ) ) {
 709  	require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
 710  }

PHP Documentation

<?php
/**
 * Fires after the theme is loaded.
 *
 * @since 3.0.0
 */
Quick Info
  • Hook Type: Action
  • Parameters: 0
  • File: wp-settings.php
Related Hooks

Related hooks will be displayed here in future updates.