Gli shortcode sono stati introdotti dal WordPress 2.5 e riportando la definizione presente sui Docs di WordPress
Introduced in WordPress 2.5 is the Shortcode API, a simple set of functions for creating macro codes for use in post content. For instance, the following shortcode (in the post/page content) would add a photo gallery into the page:
1 [gallery]
Come si utilizza:
Uno shortcode si inserisce nel post o nella pagina che si sta scrivendo ed esegue delle operazioni da noi programmate.
esempio:
1 2 3 4 | function hello_word_func(){ return echo"<h1>hello world!</h1>"; } add_shortcode('hello_word', 'hello_word_func'); |
inserendo nella pagina o nel post
1 | [hello_word] |
otterreno

Sottoscrivi RSS Feed