Skip to content

Instantly share code, notes, and snippets.

View hrenaud's full-sized avatar

hrenaud

View GitHub Profile

création directory

.gitlab/issue_templates

Création des fichiers templates dans issue_templates

les labels et assign sont à adapter au projet

BUG-template.md

@hrenaud
hrenaud / remove-astra-css-on-Elementor-page.php
Created August 26, 2020 16:43
Remove astra css on Elementor page
// https://wpastra.com/docs/remove-inline-css-from-astra/
// https://klbtheme.com/elementor-if-the-page-is_elementor/
function astra_force_remove_style() {
add_filter( 'print_styles_array', function($styles) {
// Set styles to remove.
$styles_to_remove = array('astra-theme-css', 'astra-addon-css');
$id = get_the_ID();
<?php
if (function_exists('my_plugin_function')) {
remove_action('CALLED_HOOK', 'my_plugin_function');
add_action('CALLED_HOOK', 'my_NEW_plugin_function');
} else {
add_action('admin_notices', 'my_plugin_patch_error');
}
function my_plugin_patch_error()
{
$class = 'notice notice-error';
// https://wpastra.com/docs/remove-inline-css-from-astra/
// https://klbtheme.com/elementor-if-the-page-is_elementor/
function astra_force_remove_style() {
add_filter( 'print_styles_array', function($styles) {
// Set styles to remove.
$styles_to_remove = array('astra-theme-css', 'astra-addon-css', 'la-moissonniere-astra-child-theme-css');
$id = get_the_ID();
<?php
/**
* Ajouter une page option configurable avec ACF
* https://www.advancedcustomfields.com/resources/acf_add_options_page/
*/
add_action('acf/init', 'my_acf_op_init');
function my_acf_op_init() {
<?php
function bidirectional_acf_update_value($value, $post_id, $field)
{
// vars
$field_name = $field['name'];
$field_key = $field['key'];
$global_name = 'is_updating_' . $field_name;
<?php
add_filter('acf/update_value/key=field_5a67cc16e1169', 'acf_reciprocal_relationship', 10, 3); //edit this with your ID - field one
add_filter('acf/update_value/key=field_5b7d60a26c7b5', 'acf_reciprocal_relationship', 10, 3); //edit this with your ID - field two
function acf_reciprocal_relationship($value, $post_id, $field) {
// set the two fields that you want to create
// a two way relationship for
// these values can be the same field key
<?php
add_action(
/* Pre-Elementor 2.5.1 use this:
'elementor_pro/posts/query/lwp_related_posts', */
'elementor/query/lwp_contributeurs_de_travaux',
'lwp_0001_contributeurs_de_travaux'
);
function lwp_0001_contributeurs_de_travaux( $query ) {
global $post;
function displayValue($value){
echo '<pre>';
var_dump($value);
echo '</pre>';
}