Action hook 'install_themes_pre_{$tab}'

in WP Core File wp-admin/theme-install.php at line 103

View Source

install_themes_pre_{$tab}

Action Hook
Description
Fires before each of the tabs are rendered on the Install Themes page. The dynamic portion of the hook name, `$tab`, refers to the current theme installation tab. Possible hook names include: - `install_themes_pre_block-themes` - `install_themes_pre_dashboard` - `install_themes_pre_featured` - `install_themes_pre_new` - `install_themes_pre_search` - `install_themes_pre_updated` - `install_themes_pre_upload`

Hook Information

File Location wp-admin/theme-install.php View on GitHub
Hook Type Action
Line Number 103

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into install_themes_pre_{$tab}
add_action('install_themes_pre_{$tab}', 'my_custom_function');

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

Source Code Context

wp-admin/theme-install.php:103 - How this hook is used in WordPress core
<?php
  98  	 *  - `install_themes_pre_upload`
  99  	 *
 100  	 * @since 2.8.0
 101  	 * @since 6.1.0 Added the `install_themes_pre_block-themes` hook name.
 102  	 */
 103  	do_action( "install_themes_pre_{$tab}" );
 104  }
 105  
 106  $help_overview =
 107  	'<p>' . sprintf(
 108  		/* translators: %s: Theme Directory URL. */

PHP Documentation

<?php
/**
	 * Fires before each of the tabs are rendered on the Install Themes page.
	 *
	 * The dynamic portion of the hook name, `$tab`, refers to the current
	 * theme installation tab.
	 *
	 * Possible hook names include:
	 *
	 *  - `install_themes_pre_block-themes`
	 *  - `install_themes_pre_dashboard`
	 *  - `install_themes_pre_featured`
	 *  - `install_themes_pre_new`
	 *  - `install_themes_pre_search`
	 *  - `install_themes_pre_updated`
	 *  - `install_themes_pre_upload`
	 *
	 * @since 2.8.0
	 * @since 6.1.0 Added the `install_themes_pre_block-themes` hook name.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 0
  • File: wp-admin/theme-install.php
Related Hooks

Related hooks will be displayed here in future updates.