This file contains hidden or 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 is_ficharme_boss(){ | |
return (current_user_can('administrator') || current_user_can( 'empresa' )) ? true : false; | |
} |
This file contains hidden or 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 buzz_logout_redirect( $url ) { | |
return home_url( '/wp-login.php' ); | |
} | |
add_filter( 'logout_redirect', 'buzz_logout_redirect' ); |
This file contains hidden or 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 buzz_redirect_to_login(){ | |
// Si en Multisite queremos evitar está funcionalidad en alguna de las páginas tenemos que añadir esto | |
if (get_current_blog_id() == 1) { | |
return; | |
} | |
if ( !is_page(array('wp-admin', 'wp-login.php')) && !is_user_logged_in() ){ | |
wp_redirect( home_url( '/wp-login.php' ) ); |
This file contains hidden or 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 ficharme_create_plugin_database_table() | |
{ | |
global $table_prefix, $wpdb; | |
$tblname = 'buzz_registro_fichaje'; | |
$wp_track_table = $table_prefix . "$tblname"; | |
#Check to see if the table exists already, if not, then create it | |
if($wpdb->get_var( "show tables like '$wp_track_table'" ) != $wp_track_table) |
This file contains hidden or 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
#!/bin/bash | |
#Executa this script with sudo command | |
##cd /var/www | |
find . -type d -exec chmod 750 {} \; | |
find . -type f -exec chmod 640 {} \; | |
chmod 400 wp-config.php |
This file contains hidden or 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
brew install imapsync |
This file contains hidden or 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
imapsync --host1 DOMINIO_O_IP_IMAP_ORIGEN --user1 USUARIO_ORIGEN --password1 'PASSWORD' --host2 DOMINIO_O_IP_IMAP_DESTINO --user2 USUARIO_DESTINO --password2 'PASSWORD' --no-modulesversion |
This file contains hidden or 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 buzz_393_billing_fields( $fields ) { | |
global $woocommerce; | |
// if the total is more than 0 then we still need the fields | |
if ( $woocommerce->cart->total != 0) { | |
//return $fields; | |
} |
This file contains hidden or 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 | |
/** | |
* Change the add to cart text on single product pages | |
*/ | |
add_filter('woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text'); | |
function woo_custom_cart_button_text() { | |
foreach( WC()->cart->get_cart() as $cart_item_key => $values ) { |
This file contains hidden or 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 | |
/** | |
* Extend WordPress search to include custom fields | |
* | |
* https://adambalee.com | |
*/ | |
/** | |
* Join posts and postmeta tables |