Last active
December 11, 2016 21:01
-
-
Save Rarst/4012e07d1bf7db55f90624202aaa9fdc to your computer and use it in GitHub Desktop.
Dump included PHP files from specific path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'shutdown', function () { | |
if ( ! defined( 'WPSEO_PATH' ) ) { | |
return; | |
} | |
$path = str_replace( '\\', '/', WPSEO_PATH ); | |
$includes = array_reduce( get_included_files(), function ( $plugin_includes, $include_path ) use ( $path ) { | |
$include_path = str_replace( '\\', '/', $include_path ); | |
if ( false !== stripos( $include_path, $path ) ) { | |
$plugin_includes[] = substr( $include_path, strlen( $path ) ); | |
} | |
return $plugin_includes; | |
} ); | |
sort( $includes ); | |
s( $includes ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment