WordPress.org

Make WordPress Core

Ticket #37587: wordpress.patch.ticket.37587.diff

File wordpress.patch.ticket.37587.diff, 1.1 KB (added by olarmarius, 5 years ago)

Patch for 37587 ticket

  • wp-admin/includes/theme.php

    diff -Naur wordpress-stable/wp-admin/includes/theme.php wordpress-consistent/wp-admin/includes/theme.php
    old new  
    6969
    7070        $themes_dir = trailingslashit( $themes_dir );
    7171        $theme_dir = trailingslashit( $themes_dir . $stylesheet );
     72
     73        /**
     74         * Fires immediately before a theme deletion attempt.
     75         *
     76         * @since 4.6.0
     77         *
     78         * @param string $stylesheet Stylesheet of the theme to delete.
     79         */
     80        do_action( 'delete_theme', $stylesheet );
     81
    7282        $deleted = $wp_filesystem->delete( $theme_dir, true );
    7383
     84        /**
     85         * Fires immediately after a theme deletion attempt.
     86         *
     87         * @since 4.6.0
     88         *
     89         * @param string $stylesheet Stylesheet of the theme to delete.
     90         * @param bool   $deleted    Whether the theme deletion was successful.
     91         */
     92        do_action( 'deleted_theme', $stylesheet, $deleted );
     93
    7494        if ( ! $deleted ) {
    7595                return new WP_Error( 'could_not_remove_theme', sprintf( __( 'Could not fully remove the theme %s.' ), $stylesheet ) );
    7696        }