Skip to content

Instantly share code, notes, and snippets.

View MarieComet's full-sized avatar

Marie Comet MarieComet

View GitHub Profile
@MarieComet
MarieComet / wpgb-yearly.php
Created August 5, 2024 14:57
WP Grid Builder : Select of years of posts
// Create a Select Facet with post date as data source
function prefix_row_data( $row, $object_id, $facet ) {
// If not facet ID "1".
if ( 1 !== $facet['id'] ) {
return $row;
}
$row['facet_value'] = date( 'Y', strtotime( $row['facet_value'] ) );
$row['facet_name'] = $row['facet_value'];
<?php
use Automattic\WooCommerce\Blocks\Package;
/*
Plugin Name: Remove WooCommerce patterns
Version: 1.0.0
Plugin URI: https://mariecomet.fr/
Description: Remove all WooCommerce patterns
Author: Marie Comet
Author URI: https://mariecomet.fr/
@MarieComet
MarieComet / accessconfig.scss
Last active January 26, 2023 11:16
Access Config with variables
@charset "UTF-8";
/*
* AccessConfig Variables
*/
:root {
--accessconfig-dark: #323644;
--accessconfig-dark-rgb: 50, 54, 68;
--accessconfig-light: #fff;
@MarieComet
MarieComet / elementor-posts-widget-multiple-post-types.php
Last active October 28, 2024 19:12
Allow to select multiple post types as query source in Elementor Posts widget
<?php
function elementor_posts_widget_multiple_post_types( $element, $args ) {
$element->update_control(
'posts_post_type', // control ID
[
'type' => Elementor\Controls_Manager::SELECT2,
'multiple' => true,
]
);
}
@MarieComet
MarieComet / divi-overlays-ie-edge.css
Created October 21, 2018 15:17
Fallback for Divi overlays option in EDGE/IE
/* IE / EDGE */
.overlayDiv {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
var addFilter = wp.hooks.addFilter;
var Fragment = wp.element.Fragment;
var RichText = wp.editor.RichText;
var InnerBlocks = wp.editor.InnerBlocks;
var el = wp.element.createElement;
// Hook function to add a caption to the core code block
function addColorColumns(settings) {
@MarieComet
MarieComet / divi-custom-link-options.php
Last active May 3, 2024 23:10
Add divi general settings theme options
@MarieComet
MarieComet / divi-theme-options.php
Created June 8, 2018 09:58
Add Divi theme options
if ( is_admin() ) {
add_filter( 'et_epanel_layout_data', 'custom_et_epanel_layout_data' );
}
/**
* Hooked into the et_epanel_layout_data filter
* Add additional social media options to the Divi Theme Options panel
*
* @param $options
*
* @return array