WordPress.org

Make WordPress Core

Ticket #44083: 44083.2.diff

File 44083.2.diff, 930 bytes (added by nx2017, 2 years ago)

Before and after actions for directory creation has been implemented. Target attribute is set with documentation.

  • wp-includes/functions.php

    diff --git a/wp-includes/functions.php b/wp-includes/functions.php
    index 8a168a3..478494e 100644
    a b function wp_mkdir_p( $target ) { 
    16901690                $dir_perms = 0777;
    16911691        }
    16921692       
    1693         do_action('wp_before_directory_creation');
     1693        /**
     1694         * Fires before the directory creation.
     1695         *
     1696         *
     1697         * @since 5.0 The action was added.
     1698         *
     1699         * @param string $target Full path to attempt to create.
     1700         */
     1701        do_action('wp_before_directory_creation', $target);
    16941702       
    16951703        if ( @mkdir( $target, $dir_perms, true ) ) {
    1696            
    1697             do_action('wp_after_directory_creation');
     1704               
     1705                /**
     1706                 * Fires after the directory creation.
     1707                 *
     1708                 *
     1709                 * @since 5.0 The action was added.
     1710                 *
     1711                 * @param string $target Full path to attempt to create.
     1712                 */
     1713            do_action('wp_after_directory_creation', $target);
    16981714
    16991715                /*
    17001716                 * If a umask is set that modifies $dir_perms, we'll have to re-set