Title: Theme_Installer_Skin::after
Published: April 25, 2014
Last modified: May 20, 2026

---

# Theme_Installer_Skin::after()

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#wp--skip-link--target)

Performs an action following a single theme install.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#source)󠁿

    ```php
    public function after() {
    	if ( $this->do_overwrite() ) {
    		return;
    	}

    	if ( empty( $this->upgrader->result['destination_name'] ) ) {
    		return;
    	}

    	$theme_info = $this->upgrader->theme_info();
    	if ( empty( $theme_info ) ) {
    		return;
    	}

    	$name       = $theme_info->display( 'Name' );
    	$stylesheet = $this->upgrader->result['destination_name'];
    	$template   = $theme_info->get_template();

    	$activate_link = add_query_arg(
    		array(
    			'action'     => 'activate',
    			'template'   => urlencode( $template ),
    			'stylesheet' => urlencode( $stylesheet ),
    		),
    		admin_url( 'themes.php' )
    	);
    	$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );

    	$install_actions = array();

    	if ( current_user_can( 'edit_theme_options' ) && ( $theme_info->is_block_theme() || current_user_can( 'customize' ) ) ) {
    		if ( $theme_info->is_block_theme() ) {
    			$customize_url = add_query_arg(
    				array(
    					'wp_theme_preview' => urlencode( $stylesheet ),
    					'return'           => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
    				),
    				admin_url( 'site-editor.php' )
    			);
    		} else {
    			$customize_url = add_query_arg(
    				array(
    					'theme'  => urlencode( $stylesheet ),
    					'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
    				),
    				admin_url( 'customize.php' )
    			);
    		}

    		$install_actions['preview'] = sprintf(
    			'<a href="%s" class="hide-if-no-customize load-customize">' .
    			'<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
    			esc_url( $customize_url ),
    			__( 'Live Preview' ),
    			/* translators: Hidden accessibility text. %s: Theme name. */
    			sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name )
    		);
    	}

    	$install_actions['activate'] = sprintf(
    		'<a href="%s" class="activatelink">' .
    		'<span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
    		esc_url( $activate_link ),
    		_x( 'Activate', 'theme' ),
    		/* translators: Hidden accessibility text. %s: Theme name. */
    		sprintf( _x( 'Activate &#8220;%s&#8221;', 'theme' ), $name )
    	);

    	if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) {
    		$install_actions['network_enable'] = sprintf(
    			'<a href="%s" target="_parent">%s</a>',
    			esc_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . urlencode( $stylesheet ), 'enable-theme_' . $stylesheet ) ),
    			__( 'Network Enable' )
    		);
    	}

    	if ( 'web' === $this->type ) {
    		$install_actions['themes_page'] = sprintf(
    			'<a href="%s" target="_parent">%s</a>',
    			self_admin_url( 'theme-install.php' ),
    			__( 'Go to Theme Installer' )
    		);
    	} elseif ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) ) {
    		$install_actions['themes_page'] = sprintf(
    			'<a href="%s" target="_parent">%s</a>',
    			self_admin_url( 'themes.php' ),
    			__( 'Go to Themes page' )
    		);
    	}

    	if ( ! $this->result || is_wp_error( $this->result ) || is_network_admin() || ! current_user_can( 'switch_themes' ) ) {
    		unset( $install_actions['activate'], $install_actions['preview'] );
    	} elseif ( get_option( 'template' ) === $stylesheet ) {
    		unset( $install_actions['activate'] );
    	}

    	/**
    	 * Filters the list of action links available following a single theme installation.
    	 *
    	 * @since 2.8.0
    	 *
    	 * @param string[] $install_actions Array of theme action links.
    	 * @param object   $api             Object containing WordPress.org API theme data.
    	 * @param string   $stylesheet      Theme directory name.
    	 * @param WP_Theme $theme_info      Theme object.
    	 */
    	$install_actions = apply_filters( 'install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info );
    	if ( ! empty( $install_actions ) ) {
    		$this->feedback( implode( ' | ', (array) $install_actions ) );
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-theme-installer-skin.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/class-theme-installer-skin.php#L94)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/class-theme-installer-skin.php#L94-L204)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#hooks)󠁿

 [apply_filters( ‘install_theme_complete_actions’, string[] $install_actions, object $api, string $stylesheet, WP_Theme $theme_info )](https://developer.wordpress.org/reference/hooks/install_theme_complete_actions/)

Filters the list of action links available following a single theme installation.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#related)󠁿

| Uses | Description | 
| [Theme_Installer_Skin::do_overwrite()](https://developer.wordpress.org/reference/classes/theme_installer_skin/do_overwrite/)`wp-admin/includes/class-theme-installer-skin.php` |

Checks if the theme can be overwritten and outputs the HTML for overwriting a theme on upload.

  | 
| [is_network_admin()](https://developer.wordpress.org/reference/functions/is_network_admin/)`wp-includes/load.php` |

Determines whether the current request is for the network administrative interface.

  | 
| [self_admin_url()](https://developer.wordpress.org/reference/functions/self_admin_url/)`wp-includes/link-template.php` |

Retrieves the URL to the admin area for either the current site or the network depending on context.

  | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  | 
| [wp_nonce_url()](https://developer.wordpress.org/reference/functions/wp_nonce_url/)`wp-includes/functions.php` |

Retrieves URL with nonce added to URL query.

  | 
| [add_query_arg()](https://developer.wordpress.org/reference/functions/add_query_arg/)`wp-includes/functions.php` |

Retrieves a modified URL query string.

  | 
| [admin_url()](https://developer.wordpress.org/reference/functions/admin_url/)`wp-includes/link-template.php` |

Retrieves the URL to the admin area for the current site.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  | 
| [get_option()](https://developer.wordpress.org/reference/functions/get_option/)`wp-includes/option.php` |

Retrieves an option value based on an option name.

  | 
| [is_wp_error()](https://developer.wordpress.org/reference/functions/is_wp_error/)`wp-includes/load.php` |

Checks whether the given variable is a WordPress Error.

  |

[Show 10 more](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/theme_installer_skin/after/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Ftheme_installer_skin%2Fafter%2F)
before being able to contribute a note or feedback.