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
//*------------------------------------------------*/ | |
/* Cambiamos la url de upload para que sirva | |
* los archivos desde el CDN | |
/*----------------------------------------------*/ | |
function cl_cdn_upload_url() { | |
return 'https://cdnc2.dng.pw/wp-content/uploads'; | |
} | |
if ( ! is_admin() ) { // Si no estamos en el panelde administración |
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
function cl_add_sitemap_yoast() { | |
$mes = date( 'm' ); | |
$anhio = date( 'Y' ); | |
$res = ''; | |
$url_raiz = 'https://www.fotodng.com/dng-includes/sitemaps/'; | |
$array_sitemaps[] = 'concurso_dng_06-sitemap_dng.xml'; | |
$array_sitemaps[] = 'concurso_dng_07-sitemap_dng.xml'; | |
$array_sitemaps[] = 'concurso_dng_08-sitemap_dng.xml'; | |
$array_sitemaps[] = 'concurso_dng_09-sitemap_dng.xml'; | |
$array_sitemaps[] = 'concurso_dng_10-sitemap_dng.xml'; |
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
// Carga de Disqus solo en posts | |
/** | |
* Evita que se carguen los comentarios Disqus donde no haga falta | |
*/ | |
function cl_disqus_comments() { | |
// Si estamos en un posts con los comentarios abiertos es necesario el código | |
if ( is_singular( array( 'post' ) ) && comments_open() ) { | |
return; | |
} |
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
/** | |
* Optimizar las imágenes con el programa de sistema jpegoptim | |
* | |
* @param array $array_imgs Array con los nombres de las fotos. | |
* @param string $ruta_fotos Ruta donde están las fotos. | |
* @param boolean $no_exec Si se ejecuta o sólo ver el resultado sin ejecutar. | |
* | |
* @return string|array Devuelve una cadena con el fallo o un array con los resultados. | |
*/ | |
function optimiza_img( $array_imgs, $ruta_fotos = '', $no_exec = true ) { |
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
function dng_nombre_archivo( $filename, $filename_raw ) { | |
$info = pathinfo( $filename ); | |
$nombre_arch = $info['filename']; | |
if ( ! empty( $info['extension'] ) ) { | |
$ext = $info['extension']; | |
} else { | |
$ext = ''; | |
} |
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
Verifying that "carloslongarela.id" is my Blockstack ID. https://onename.com/carloslongarela |
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 cl_product_delete_meta_price( $product = null ) { | |
if ( ! is_object( $product ) ) { | |
global $product; | |
} | |
if ( ! is_a( $product, 'WC_Product' ) ) { | |
return; | |
} |
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 | |
if (!function_exists('getOrderDetailById')) { | |
//to get full order details | |
function getOrderDetailById($id, $fields = null, $filter = array()) { | |
if (is_wp_error($id)) | |
return $id; |
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 | |
/** | |
* Script for change WordPress live url to local url, | |
* local url to live url, http url to https url | |
* or any other url change in database. | |
* | |
* @author Carlos Longarela <carlos@longarela.eu> | |
* @link https://tabernawp.com/ | |
* | |
*/ |
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
/** | |
* Hide Pods Admin Menu if logged user is different that "username". | |
*/ | |
function css_hide_pods_noncl() { | |
global $current_user; | |
if ( 'username' !== $current_user->user_login ) { | |
echo '<style type="text/css">#toplevel_page_pods{display:none!important;}</style>'; | |
} | |
} |
OlderNewer