WordPress et shortcodes : comment les lister

Si jamais vous commencez à découvrir la chose super pratique qu’est un shortcode alors voici une petite astuce, si vous êtes sur Linux : comment lister les shortcodes présents.

Il suffit dans le shell, d’aller dans votre répertoire WordPress et de taper cette ligne de commande :

find . -type f -print0 | grep -z php$ | xargs -0 grep 'add_shortcode' | more

Et vous aurez le listing de tous les endroits où on appelle cette fonction. Il ne vous reste plus qu’à regarder ce qu’ont fait les personnes ! Il existe même des shortcodes cachés dans certains thèmes, que les auteurs ont dû faire pour eux, mais qu’ils n’ont pas documenté ! Très pratique !

Exemple :

...ygen/library/functions/shortcodes.php: add_shortcode( 'entry-title', 'hybrid_entry_title_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'entry-author', 'hybrid_entry_author_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'entry-terms', 'hybrid_entry_terms_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'entry-comments-link', 'hybrid_entry_comments_link_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'entry-published', 'hybrid_entry_published_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'entry-edit-link', 'hybrid_entry_edit_link_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'entry-shortlink', 'hybrid_entry_shortlink_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'entry-permalink', 'hybrid_entry_permalink_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'post-format-link', 'hybrid_post_format_link_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'comment-published', 'hybrid_comment_published_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'comment-author', 'hybrid_comment_author_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'comment-edit-link', 'hybrid_comment_edit_link_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'comment-reply-link', 'hybrid_comment_reply_link_shortcode' );
...ygen/library/functions/shortcodes.php: add_shortcode( 'comment-permalink', 'hybrid_comment_permalink_shortcode' );
...gelines/includes/class.shortcodes.php: add_shortcode( $shortcode, array( &$this, $data['function']) );
...b/library/shortcodes.php:add_shortcode('gallery', 'gallery_shortcode_tbs');
...b/library/shortcodes.php:add_shortcode('button', 'buttons');
...b/library/shortcodes.php:add_shortcode('alert', 'alerts');
...b/library/shortcodes.php:add_shortcode('block-message', 'block_messages');
...b/library/shortcodes.php:add_shortcode('blockquote', 'blockquotes');
...ean-retina/library/shortcodes/cleanretina-shortcodes.php: * Creates new shortcodes for use in any shortcode-ready area. This function uses the add_shortcode()
...ean-retina/library/shortcodes/cleanretina-shortcodes.php: * @uses add_shortcode() to create new shortcodes.
...ean-retina/library/shortcodes/cleanretina-shortcodes.php: add_shortcode( 'the-year', 'cleanretina_the_year_shortcode' );
...ean-retina/library/shortcodes/cleanretina-shortcodes.php: add_shortcode( 'site-link', 'cleanretina_site_link_shortcode' );
...ean-retina/library/shortcodes/cleanretina-shortcodes.php: add_shortcode( 'wp-link', 'cleanretina_wp_link_shortcode' );
...ean-retina/library/shortcodes/cleanretina-shortcodes.php: add_shortcode( 'th-link', 'cleanretina_themehorse_link_shortcode' );
...ntra/includes/theme-shortcodes.php:add_shortcode('mantra-site', 'mantra_site_link_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode('mantra-author', 'mantra_the_author_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode('mantra-tag-cloud', 'mantra_tag_cloud_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode('mantra-multi', 'mantra_multi_column_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode('mantra-column', 'mantra_column_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode( 'mantra-pullquote', 'mantra_pullquote_fn' );
...ntra/includes/theme-shortcodes.php:add_shortcode( 'mantra-button-light', 'mantra_button_light_fn' );
...ntra/includes/theme-shortcodes.php:add_shortcode( 'mantra-button-dark', 'mantra_button_dark_fn' );
...ntra/includes/theme-shortcodes.php:add_shortcode( 'mantra-button-color', 'mantra_button_color_fn' );
...ntra/includes/theme-shortcodes.php:add_shortcode('cryout-site', 'mantra_site_link_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode('cryout-author', 'mantra_the_author_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode('cryout-tag-cloud', 'mantra_tag_cloud_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode('cryout-multi', 'mantra_multi_column_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode('cryout-column', 'mantra_column_fn');
...ntra/includes/theme-shortcodes.php:add_shortcode( 'cryout-pullquote', 'mantra_pullquote_fn' );
...ntra/includes/theme-shortcodes.php:add_shortcode( 'cryout-button-light', 'mantra_button_light_fn' );
...ntra/includes/theme-shortcodes.php:add_shortcode( 'cryout-button-dark', 'mantra_button_dark_fn' );
...ntra/includes/theme-shortcodes.php:add_shortcode( 'cryout-button-color', 'mantra_button_color_fn' );
...artupwp/functions.php:add_shortcode('wp_caption', 'fixed_img_caption_shortcode');
...artupwp/functions.php:add_shortcode('caption', 'fixed_img_caption_shortcode');
...p:add_shortcode('wp_caption', 'img_caption_shortcode');
...p:add_shortcode('caption', 'img_caption_shortcode');
...p:add_shortcode('gallery', 'gallery_shortcode');
...p:add_shortcode( 'audio', 'wp_audio_shortcode' );
...p:add_shortcode( 'video', 'wp_video_shortcode' );
...-embed.php: add_shortcode( 'embed', '__return_false' );
...-embed.php: * @uses add_shortcode()
...-embed.php: add_shortcode( 'embed', array( $this, 'shortcode' ) );
...es.php: * add_shortcode('footag', 'footag_func');
...es.php: * add_shortcode('bartag', 'bartag_func');
...es.php: * add_shortcode('baztag', 'baztag_func');
...es.php:function add_shortcode($tag, $func) {

Poster un commentaire

Vous devriez utiliser le HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>