Skip to content

Instantly share code, notes, and snippets.

@Glinkfr
Glinkfr / function.php
Created Nov 23, 2022
Code à ajouter au fichier function du theme enfant afin de régler le problème d'affichage des boutons PayPal avec WooCommerce et Divi
View function.php
add_filter('woocommerce_paypal_payments_single_product_renderer_hook', function() {
return 'woocommerce_after_add_to_cart_form';
});
@Glinkfr
Glinkfr / function.php
Created Nov 23, 2022
Position par défaut des boutons PayPal sur la page du produit
View function.php
add_filter('woocommerce_paypal_payments_single_product_renderer_hook', function() {
return 'woocommerce_after_add_to_cart_button';
});
@Glinkfr
Glinkfr / function.php
Created Nov 23, 2022
Creation d'un shortcode wordpress pour pour utiliser le fil d'Ariane du plugin NavXT Breadcrumb
View function.php
function glink_bcn() {
echo '<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">';
echo bcn_display() . '</div>';
}
add_shortcode('glink_bcn', 'glink_bcn');
@Glinkfr
Glinkfr / wpbdp-navxt-integration.php
Created May 25, 2020
Plugin pour Intégrer NavXT Breadcrumb Plugin à Business Directory Plugin
View wpbdp-navxt-integration.php
<?php
/*
Plugin Name: wpbdp navxt integration
Plugin URI: https://www.glink.fr
Version: 1.0.0
Author: L. Perderiset and Business Directory Team
Description: Better integration of NavXT Breadcrumb Plugin with Business Directory Plugin
Author URI: https://www.glink.fr
*/
View wpbdp-navxt-integration.php
// ajoute la nouvelle class au plugin BD APRES la suppression grâce à la priorité 999
add_action('wpbdp_loaded', function(){new WPBDP_NavXT_Integration_glink();}, 999);
View wpbdp-navxt-integration.php
// supprime toutes les actions de BD sur le plugin NavXT
add_action( 'wpbdp_loaded', function(){
remove_all_actions('bcn_before_fill');
remove_all_actions('bcn_after_fill');
});
View class-wpbdp.php
$this->compat = new WPBDP_Compat();
$this->rewrite = new WPBDP__Rewrite();
do_action( 'wpbdp_loaded' );
View class-navxt-integration.php
function __construct() {
add_action( 'bcn_before_fill', array( &$this, 'prepare_state' ) );
add_action( 'bcn_after_fill', array( &$this, 'restore_state' ) );
}
View class-navxt-integration.php
<?php
/**
* @since 3.6.5
*/
class WPBDP_NavXT_Integration{
private $state = array();
private $doing = '';
@Glinkfr
Glinkfr / functions.php
Created Oct 7, 2019
Fichier fonctions thème enfant Sparkling
View functions.php
<?php
/**
* On enlève les scripts du thème parent
*/
function sparkling_child_dequeue_script() {
wp_dequeue_script( 'sparkling_scripts' );
}
add_action( 'wp_print_scripts', 'sparkling_child_dequeue_script()', 100 );
/**