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 | |
// What is interesting about this plugin is that it does a deep compare between the post and the updated post | |
// and get the changes inside ACF, | |
// so you will know if an admin or someone has changed an image, a field, a repeater, etc. and send a mail, a post, or whatever | |
// INSTALLATION: | |
// Create inside /plugins/ a folder named /backend-change-notifications | |
// Paste inside /backend-change-notifications this backend-change-notifications.php file |
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 | |
/** | |
* The plugin bootstrap file | |
* | |
* @link iproject.cat | |
* @since 1.0.0 | |
* @package Export ACF fields to Excel | |
* | |
* @wordpress-plugin |
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 | |
// Copia y pega estas lineas en tu fichero wp-config.php dentro de la raiz de tu sistema de ficheros WordPress (Producción o Desarrollo) | |
// EN PRODUCCIÓN nos interesa tener siempre los errores y debug desactivados | |
// para evitar daños colaterales en pantalla o en llamadas AJAX / API que pueden romper el funcionamiento | |
@ini_set( 'log_errors', 'Off' ); | |
@ini_set( 'display_errors', 'Off' ); | |
define( 'WP_DEBUG', false ); | |
define( 'WP_DEBUG_LOG', false ); |
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 | |
// Esta función puede estar dentro de functions.php de tu tema de WordPress (o tema hijo) | |
// Puede estar dentro de un plugin a medida que hagas | |
// Puede estar como un code Snippet | |
// Creamos una función que devuelve un texto "Hola mundo" | |
function crear_shortcode(){ | |
return "<h2>Hola mundo!</h2>"; | |
} |
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 | |
// Redirección a ruta concreta | |
function iproject_login_redirect( $redirect_to, $request, $user ) { | |
return 'https://www.iproject.cat/landing1'; | |
} | |
add_filter( 'login_redirect', 'iproject_login_redirect', 10, 3 ); | |
// Si quieres fusionar el filtro y la función puedes hacerlo usando una función anónima: | |
add_filter( 'login_redirect', function ( $redirect_to, $request, $user ) { | |
return 'https://www.iproject.cat/landing2'; |