study64

Untitled

Aug 17th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Prueba
  4. Plugin URI: http://wordpress.org/plugins/hello-dolly/
  5. 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.
  6. Author: Matt Mullenweg
  7. Version: 1.7.2
  8. Author URI: http://ma.tt/
  9. */
  10.  
  11. function mostrarFormulario1() {
  12.     //Puedo directamente devolver un string
  13.     return 'Hola Mundo!!!';
  14. }
  15.  
  16. add_shortcode( 'mostrar_formulario1', 'mostrarFormulario1');
  17.  
  18. function mostrarFormulario2() {
  19.     //Puedo capturar la salida y usar echos
  20.     ob_start();
  21.     echo "Hola, ";
  22.     ?>
  23.         acรก puedo meter html y mesclarlo con <?php echo "php"; ?>
  24.     <?php
  25.     return ob_get_clean();
  26. }
  27.  
  28. add_shortcode( 'mostrar_formulario2', 'mostrarFormulario2');
  29.  
  30. function mostrarFormulario3() {
  31.     ob_start();
  32.     //O puedo directamente incluir un archivo php
  33.     include __DIR__ . '/algo.php';
  34.     return ob_get_clean();
  35. }
  36.  
  37. add_shortcode( 'mostrar_formulario3', 'mostrarFormulario3');
Add Comment
Please, Sign In to add comment