Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: upgrader_source_selection

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
444           /**
445            * Filter the source file location for the upgrade package.
446            *
447            * @since 2.8.0
448            *
449            * @param string      $source        File source location.
450            * @param string      $remote_source Remove file source location.
451            * @param WP_Upgrader $this          WP_Upgrader instance.
452            */
453           $source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this );
454           if ( is_wp_error( $source ) ) {
455                return $source;
456           }
457
458           // Has the source location changed? If so, we need a new source_files list.
459           if ( $source !== $remote_source ) {
460                $source_files = array_keys( $wp_filesystem->dirlist( $source ) );
461           }
462           /*