Skip to content

Instantly share code, notes, and snippets.

@kadai kadai/dummy_funct.php
Last active Jul 1, 2017

Embed
What would you like to do?
Conjunto de código de ejemplo
<?php
add_filter( 'wp_title', 'myfunction_cambiandoimagen' );
?>
<?php
function myfunction_cambiandoimagen($get_image_options){
/* SOLAMENTE LE CAMBIAMOS EL TAMAÑO A LO QUE RECIBAMOS... SI LO HACEMOS! */
$default = 150;
$get_image_options['avatar_size'] = $default;
$get_image_options['width'] = $default;
$get_image_options['height'] = $default;
return $get_image_options;
}
?>
<?php
function myfunction_cambiandoimagen($get_image_options){
$default = 150;
$get_image_options['avatar_size'] = $default;
$get_image_options['width'] = $default;
$get_image_options['height'] = $default;
return $get_image_options;
}
add_filter( 'jetpack_top_posts_widget_image_options', 'myfunction_cambiandoimagen' );
?>
<?php
$dato_transient = get_transient('mytransient_salvada');
/* SOLO LOS ADMINISTRADORES PUEDEN "VER" ESTO */
if (($dato_transient === FALSE) && current_user_can('edit_theme_options')){
add_filter('elfiltro_que_veran_administradores', 'funcion_que_se_llamara');
$dato_transient['ya_se_ejecuto'] = TRUE;
/* HACEMOS QUE EL TRANSIENT EXPIRE EN UN DÍA */
/* SOLO SE EJECUTARÁ UNA VEZ AL DÍA */
set_transient('mytransient_salvada', $dato_transient, DAY_IN_SECONDS);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.