Last active
July 1, 2017 09:08
-
-
Save kadai/b313e77a46c72be6b569bab3e72ff51c to your computer and use it in GitHub Desktop.
Conjunto de código de ejemplo
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 | |
add_filter( 'wp_title', 'myfunction_cambiandoimagen' ); | |
?> |
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 | |
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; | |
} | |
?> |
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 | |
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' ); | |
?> |
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 | |
$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