Skip to content

Instantly share code, notes, and snippets.

View MKlblangenois's full-sized avatar
👨‍💻
Busy to make the world better #JAMstackLover

Logan Blangenois MKlblangenois

👨‍💻
Busy to make the world better #JAMstackLover
View GitHub Profile
@MKlblangenois
MKlblangenois / robots.txt
Created May 14, 2024 12:56
WordPress robots.txt example
User-agent: *
Disallow: /feed/
Disallow: /cgi-bin/
Disallow: /trackback/
Disallow: /xmlrpc.php
Disallow: /blackhole/
Disallow: /transfer/
Disallow: /tweets/
Disallow: /mint/
@MKlblangenois
MKlblangenois / fct_woocommerce.php
Last active April 18, 2024 11:42
Allow shop_manager to edit Privacy policy page and WordPress / WooCommerce
<?php
/**
* Allow the shop manager to edit the "privacy" page on WooCommerce
*
* @return void
*/
function update_shop_manager_caps() {
if (get_role('shop_manager')) {
@MKlblangenois
MKlblangenois / function.php
Last active August 7, 2023 11:16
Fix for WPGraphQL ACF Gutenberg: block null or duplicated content
// Add this filter inside your function.php
add_filter('acf/pre_save_block', 'add_acf_block_identifier');
function add_acf_block_identifier($attributes) {
if (empty($attributes['id'])) {
$attributes['id'] = 'acf-block-' . uniqid();
}
return $attributes;
}
@MKlblangenois
MKlblangenois / lightendarken.js
Last active December 16, 2019 22:12
LIgthen & Darken color in JS like Sass
/**
* Split HSL(a) Color code.
*
* Get the HSL(a) color code and return an array with each value of HSL.
*
* @since 0.1.0
*
* @param {string} HSLa HSL(a) color code.
*
* @return {array} Return each value of HSLa code in an array.