WordPress.org

Make WordPress Core

Ticket #14955: 14955.2.patch

File 14955.2.patch, 785 bytes (added by vetyst, 5 years ago)

v4.6 deleted_theme hook

  • src/wp-admin/includes/theme.php

     
    7171        $theme_dir = trailingslashit( $themes_dir . $stylesheet );
    7272        $deleted = $wp_filesystem->delete( $theme_dir, true );
    7373
     74        /**
     75         * Fires immediately after a theme deletion attempt.
     76         *
     77         * @since 4.7.0
     78         *
     79         * @param string $stylesheet Stylesheet of the theme.
     80         * @param bool   $deleted    Whether the theme deletion was successful.
     81         */
     82        do_action( 'deleted_theme', $stylesheet, $deleted );
     83
    7484        if ( ! $deleted ) {
    7585                return new WP_Error( 'could_not_remove_theme', sprintf( __( 'Could not fully remove the theme %s.' ), $stylesheet ) );
    7686        }