[wp-trac] [WordPress Trac] #57386: Add filter to WP_Upgrader::install_package for copy_dir()

WordPress Trac noreply at wordpress.org
Fri Jan 6 16:37:57 UTC 2023


#57386: Add filter to WP_Upgrader::install_package for copy_dir()
-----------------------------+--------------------------
 Reporter:  afragen          |       Owner:  (none)
     Type:  feature request  |      Status:  reopened
 Priority:  normal           |   Milestone:  6.2
Component:  Upgrade/Install  |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  performance
-----------------------------+--------------------------

Comment (by afragen):

 Examples of how the filter could look.


 {{{
 if ( ! apply_filters( 'upgrader_use_move_dir', false ) ) {
         $result = copy_dir( $source, $remote_destination );
 } else {
         $result = move_dir( $source, $remote_destination );
 }
 }}}



 {{{
 if ( apply_filters( 'upgrader_use_move_dir', false ) ) {
         $result = move_dir( $source, $remote_destination );
 } else {
         $result = copy_dir( $source, $remote_destination );
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57386#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list