Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * List off all plugins used via `[list_plugins]` shortcode.
- *
- * Note that this includes inactive plugins, so keep the plugins tidy.
- *
- * @return string of html, list of plufins and links to their site.
- */
- add_shortcode('list_plugins', function(){
- $list_plugins = [];
- $plugins = get_plugins();
- foreach ( $plugins as $plugin ) {
- if ( in_array( $plugin['Name'], [ 'Gutenberg', 'Classic Editor' ] ) ) {
- continue;
- }
- $list_plugins[] = "<a href='".esc_url( $plugin['PluginURI'] )."'>".esc_html( $plugin['Name'] )."</a>";
- }
- return implode( ', ', $list_plugins );
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement