Skip to content

Instantly share code, notes, and snippets.

Fixe l'issue #
### Description
Expliquer pourquoi ces changements sont importants - quel est le problème, et comment cette PR y remédie.
### Changements dans cette PR
-
-
### Description de l'issue
Description claire et concise du bug ou de la feature.
### Pour répliquer
Etapes pour répliquer:
1. Aller à '...'
2. Cliquer sur '....'
@corsonr
corsonr / rest_api_create_post.php
Created December 2, 2022 11:08
Introduction to the WordPress Rest API
<?php
// Set the endpoint and request method
$endpoint = '/wp/v2/posts';
$method = 'POST';
// Set the request body data
$body = array(
'title' => 'My new post',
'content' => 'This is the content of my new post.',
@corsonr
corsonr / iDoneThis-clickable-urls.user.js
Created July 1, 2022 10:26
Make iDoneThis URLs Clickable on Calendar View
// ==UserScript==
// @name iDoneThis - Make URLs clickable
// @version 0.1
// @description Make URLs clickable on iDoneThis
// @author Remi Corson
// @match https://app.idonethis.com/*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@corsonr
corsonr / featured.json
Last active August 5, 2022 08:12
featured.json.txt
@corsonr
corsonr / attestation-derogatoire.user.js
Last active January 16, 2021 08:59
Génération automatique de l'attestation dérogatoire obligatoire en France pour le confinement V2.
// ==UserScript==
// @name Attestation Derogatoire
// @namespace https://media.interieur.gouv.fr/
// @version 0.1
// @description Auto-génération de l'attestation. Passez le motif en URL, par exemple https://media.interieur.gouv.fr/deplacement-covid-19/?raison=travail
// @author Remi Corson
// @match https://media.interieur.gouv.fr/*
// @require http://code.jquery.com/jquery-latest.js
// @grant none
// ==/UserScript==
@corsonr
corsonr / woo-restrict-ordersper-day.php
Last active July 6, 2023 02:39
WooCommerce - restrict number of orders per day
<?php
/**
* Plugin Name: Restrict Orders per Day for WooCommerce
* Plugin URI: https://remicorson.com
* Description: Put the shop into catalogue mode once number of orders per day is reached.
* Version: 0.1
* Author: Remi Corson, corsonr
* Author URI: https://remicorson.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@corsonr
corsonr / gist:c9b03ee67425606365b17742ba3d0a2f
Created February 14, 2020 13:49
wp-cli: delete all WooCommerce products
wp post delete $(wp post list --post_type='product' --format=ids --posts_per_page=10000) --force
@corsonr
corsonr / functions.php
Created December 20, 2019 08:37
Restrict WooCommerce Subscriptions Creation Process
<?php
if ( current_user_can( 'edit_pages' ) ) { // Edit capability here.
remove_filter( 'product_type_selector', 'WC_Subscriptions_Admin::add_subscription_products_to_select' );
}
@corsonr
corsonr / README.md
Last active September 25, 2022 09:17
WooCommerce: redirect user upon coupon removal

WooCommerce: Redirect user to a specific page after removing a coupon

This snippet gives the ability to redirect a user after removing a coupon. You can place the code in functions.php.