Created
August 13, 2019 03:15
-
-
Save parzibyte/d4204dc7d529ae942fb06de3612bdc9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Insertar publicidad entre párrafos | |
Plugin URI: https://parzibyte.me/blog | |
Description: Insertar publicidad entre párrafos | |
Version: 1.0 | |
Author: Luis Cabrera Benito a.k.a Parzibyte | |
Author URI: https://parzibyte.me/blog | |
*/ | |
defined("ABSPATH") or die("No es permitido el acceso directo al archivo"); | |
if (!class_exists("ParzibytePublicidad")) { | |
class ParzibytePublicidad | |
{ | |
public static function iniciar() | |
{ | |
add_filter("the_content", "ParzibytePublicidad::agregar_publicidad"); | |
} | |
public function agregar_publicidad($contenido) | |
{ | |
# Aquí modificar el contenido y regresarlo | |
return $contenido | |
} | |
} | |
# Aquí llamamos a la función que agrega el filtro | |
ParzibytePublicidad::iniciar(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment