Last active
July 26, 2019 14:46
-
-
Save khanrn/569e7fb58369e6a803ed481961c45618 to your computer and use it in GitHub Desktop.
This function helps to understand scripts loading sequence for 'WooCommerce Admin' plugin
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
| /** | |
| * This function helps to understand scripts loading sequence for 'WooCommerce Admin' plugin | |
| * @author Khan Mohammad R. <codemascot@hotmail.com> | |
| * @return void | |
| */ | |
| function codemascot_get_scripts_on_loading_sequence_for_wc_admin() { | |
| // JS Scripts part | |
| global $wp_scripts; | |
| $t = []; | |
| $i = 1; | |
| foreach ( $wp_scripts->registered as $k => $v ) { | |
| if ( false === strpos( $v->src, 'woocommerce-admin' ) ) { | |
| continue; | |
| } | |
| $t[ $i . '-' . $k ] = $v; | |
| $i++; | |
| } | |
| print_r( $t ); | |
| // PHP scripts part | |
| $t = []; | |
| $i = 1; | |
| foreach ( get_included_files() as $k => $v ) { | |
| if ( false === strpos( $v, 'woocommerce-admin' ) ) { | |
| continue; | |
| } | |
| $t[ $i . '-' . $k ] = $v; | |
| $i++; | |
| } | |
| print_r( $t ); | |
| } | |
| add_action( 'admin_footer', 'codemascot_get_scripts_on_loading_sequence_for_wc_admin' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment