Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: Prueba
- Plugin URI: http://wordpress.org/plugins/hello-dolly/
- Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
- Author: Matt Mullenweg
- Version: 1.7.2
- Author URI: http://ma.tt/
- */
- function mostrarFormulario1() {
- //Puedo directamente devolver un string
- return 'Hola Mundo!!!';
- }
- add_shortcode( 'mostrar_formulario1', 'mostrarFormulario1');
- function mostrarFormulario2() {
- //Puedo capturar la salida y usar echos
- ob_start();
- echo "Hola, ";
- ?>
- acรก puedo meter html y mesclarlo con <?php echo "php"; ?>
- <?php
- return ob_get_clean();
- }
- add_shortcode( 'mostrar_formulario2', 'mostrarFormulario2');
- function mostrarFormulario3() {
- ob_start();
- //O puedo directamente incluir un archivo php
- include __DIR__ . '/algo.php';
- return ob_get_clean();
- }
- add_shortcode( 'mostrar_formulario3', 'mostrarFormulario3');
Add Comment
Please, Sign In to add comment