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
/** | |
* Création du shortcode Année en cours. | |
*/ | |
// utilisez [year] dans vos widgets, pages, articles ou votre footer | |
function shortcode_year() { | |
$year = date('Y'); | |
return $year; | |
} | |
add_shortcode('year', 'shortcode_year'); |
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 | |
/** | |
* Modifie l'apparence de l'administration pour les administrateurs sauf pour un seul administrateur (CHANGE_PSEUDONYME) | |
*/ | |
//On récupère les infos sur l'utilisateur | |
$current_user = wp_get_current_user(); | |
//On verifie que l'utilisateur connecté est un administrateur dont le pseudonyme n'est pas 'CHANGE_PSEUDONYME' | |
if ( |
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 | |
/** | |
* Modify admin rights and appearance except for a specific administrator username (CHANGE_USERNAME) | |
*/ | |
$current_user = wp_get_current_user(); | |
//Checking if the current user has the 'administrator' role and their username is not 'CHANGE_USERNAME' | |
if ( | |
in_array("administrator", $current_user->roles) && | |
$current_user->user_login !== "CHANGE_USERNAME" | |
) { |
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
add_filter('woocommerce_paypal_payments_single_product_renderer_hook', function() { | |
return 'woocommerce_after_add_to_cart_form'; | |
}); |
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
add_filter('woocommerce_paypal_payments_single_product_renderer_hook', function() { | |
return 'woocommerce_after_add_to_cart_button'; | |
}); |
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 glink_bcn() { | |
echo '<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">'; | |
echo bcn_display() . '</div>'; | |
} | |
add_shortcode('glink_bcn', 'glink_bcn'); |