Skip to main content
added 1 character in body
Source Link

To display registered scripts information in posts/pages, we'll use a shortcode. For admin registered scripts, we'll use admin_footer action hook. Put this code into your plugin:

if(!is_admin) {
    function fpwScripts($atts) {
        global $wp_scripts;
        $out = '<h2>Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        return $out;
    }
    add_shortcode('scripts', 'fpwScripts');
} else {
    function fpwAdminScripts() {
        global $wp_scripts;
        $out = '<div style="margin-left:200px">';
        $out .= '<h2>Admin Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        $out .= '<p>&nbsp;</p><p>&nbsp;</p></div>';
        echo $out;
    }
    add_action('admin_footer', 'fpwAdminScripts');
}

Note: if you decide to display admin registered scripts on your plugin's page, instead of using admin_footer hook, just use fpwAdminScripts() function, there.

To display registered scripts information in posts/pages, we'll use a shortcode. For admin registered scripts, we'll use admin_footer action hook. Put this code into your plugin:

if(!is_admin) {
    function fpwScripts($atts) {
        global $wp_scripts;
        $out = '<h2>Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        return $out;
    }
    add_shortcode('scripts', 'fpwScripts');
} else {
    function fpwAdminScripts() {
        global $wp_scripts;
        $out = '<div style="margin-left:200px">';
        $out .= '<h2>Admin Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        $out .= '<p>&nbsp;</p><p>&nbsp;</p></div>';
        echo $out;
    }
    add_action('admin_footer', 'fpwAdminScripts');
}

To display registered scripts information in posts/pages, we'll use a shortcode. For admin registered scripts, we'll use admin_footer action hook. Put this code into your plugin:

if(!is_admin) {
    function fpwScripts($atts) {
        global $wp_scripts;
        $out = '<h2>Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        return $out;
    }
    add_shortcode('scripts', 'fpwScripts');
} else {
    function fpwAdminScripts() {
        global $wp_scripts;
        $out = '<div style="margin-left:200px">';
        $out .= '<h2>Admin Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        $out .= '<p>&nbsp;</p><p>&nbsp;</p></div>';
        echo $out;
    }
    add_action('admin_footer', 'fpwAdminScripts');
}

Note: if you decide to display admin registered scripts on your plugin's page, instead of using admin_footer hook, just use fpwAdminScripts() function, there.

added 1 character in body
Source Link

To display registered scripts information in posts/pages, we'll use a shortcode. For admin registered scripts, we'll use admin_footer action hook. Put this code into your plugin:

if(!is_admin) {
    function fpwScripts($atts) {
        global $wp_scripts;
        $out ='<h2>Registered= '<h2>Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        return $out;
    }
    add_shortcode('scripts', 'fpwScripts');
} else {
    function fpwAdminScripts() {
        global $wp_scripts;
        $out = '<div style="margin-left:200px">';
        $out .= '<h2>Admin Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        $out .= '<p>&nbsp;</p><p>&nbsp;</p></div>';
        echo $out;
    }
    add_action('admin_footer', 'fpwAdminScripts');
}

To display registered scripts information in posts/pages, we'll use a shortcode. For admin registered scripts, we'll use admin_footer action hook. Put this code into your plugin:

if(!is_admin) {
    function fpwScripts($atts) {
        global $wp_scripts;
        $out ='<h2>Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        return $out;
    }
    add_shortcode('scripts', 'fpwScripts');
} else {
    function fpwAdminScripts() {
        global $wp_scripts;
        $out = '<div style="margin-left:200px">';
        $out .= '<h2>Admin Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        $out .= '<p>&nbsp;</p><p>&nbsp;</p></div>';
        echo $out;
    }
    add_action('admin_footer', 'fpwAdminScripts');
}

To display registered scripts information in posts/pages, we'll use a shortcode. For admin registered scripts, we'll use admin_footer action hook. Put this code into your plugin:

if(!is_admin) {
    function fpwScripts($atts) {
        global $wp_scripts;
        $out = '<h2>Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        return $out;
    }
    add_shortcode('scripts', 'fpwScripts');
} else {
    function fpwAdminScripts() {
        global $wp_scripts;
        $out = '<div style="margin-left:200px">';
        $out .= '<h2>Admin Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        $out .= '<p>&nbsp;</p><p>&nbsp;</p></div>';
        echo $out;
    }
    add_action('admin_footer', 'fpwAdminScripts');
}
Source Link

To display registered scripts information in posts/pages, we'll use a shortcode. For admin registered scripts, we'll use admin_footer action hook. Put this code into your plugin:

if(!is_admin) {
    function fpwScripts($atts) {
        global $wp_scripts;
        $out ='<h2>Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        return $out;
    }
    add_shortcode('scripts', 'fpwScripts');
} else {
    function fpwAdminScripts() {
        global $wp_scripts;
        $out = '<div style="margin-left:200px">';
        $out .= '<h2>Admin Registered Scripts</h2>';
        foreach($wp_scripts->registered as $key => $value) {
            $out .= "<h3>{$value->handle}</h3>";
            $out .= "source = {$value->src}<br>";
            $out .= "dependencies = array(<br>";
            foreach($value->deps as $dep) {
                $out .= '&nbsp;&nbsp;&nbsp;&nbsp;' . "{$dep},<br>";
            }
            $out .= ")";
        }
        $out .= '<p>&nbsp;</p><p>&nbsp;</p></div>';
        echo $out;
    }
    add_action('admin_footer', 'fpwAdminScripts');
}