[wp-trac] [WordPress Trac] #34617: Add filter for shiny updates
WordPress Trac
noreply at wordpress.org
Wed Nov 11 23:15:13 UTC 2015
#34617: Add filter for shiny updates
-----------------------------+----------------------
Reporter: afragen | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Upgrade/Install | Version: trunk
Severity: normal | Resolution: invalid
Keywords: has-patch close | Focuses:
-----------------------------+----------------------
Changes (by dd32):
* resolution: duplicate => invalid
Comment:
@afragen like previously suggested, you can use the
`upgrader_source_selection` filter like so:
{{{
add_filter( 'upgrader_source_selection', '_upgrader_source_selection', 10,
3 );
function _upgrader_source_selection( $source, $remote_source,
$upgrader_instance ) {
global $wp_filesystem;
$new_path = trailingslashit( $remote_source ) . basename( $source
) . '-dd32/';
$wp_filesystem->move( $source, $new_path );
return $new_path;
}
}}}
That suffixes all updates with `-dd32` in the foldername, so you should be
able to use the same thing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34617#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list