Skip to content

Instantly share code, notes, and snippets.

View MaximeCulea's full-sized avatar
🇨🇭
New life begining.

Maxime CULEA MaximeCulea

🇨🇭
New life begining.
View GitHub Profile
@mehdichaouch
mehdichaouch / README.md
Last active November 30, 2023 17:33
🔧 WordPress Plugins Compatibility from command line with WP-CLI
@nicomollet
nicomollet / gravity-forms-use-woocommerce-email-template-for-notifications.php
Last active December 12, 2023 04:49
Gravity Forms: Use WooCommerce emails templates for notifications
<?php
/**
* Gravity Forms: Use WooCommerce emails templates for notifications.
*
* @param string $template
*
* @return string
*/
public function custom_gform_html_message_template_pre_send_email( string $template ) {
#!/usr/bin/env bash
#
# Factory Hook: post-staging-update
# factory-hooks/post-site-install/02-setup-cohesion.sh
# Run Site Studio commands after executing
SITEGROUP="$1"
ENVIRONMENT="$2"
DB_ROLE="$3"
DOMAIN="$4"
@MaximeCulea
MaximeCulea / wp-cli-cheatset.sh
Last active January 18, 2023 16:58
A list of WordPress WP Cli commands.
#!/usr/bin/env bash
# Related to WP CLI in Multisite check following link
# @see https://gist.github.com/MaximeCulea/575e493a061359edbb12cefc3aa4c770
# Update all post's thumnbail
wp post update $(wp post list --format=ids --post_type=post) --post_type=post --meta_input='{"_thumbnail_id":"160"}'
# Generate and add dummy thumbnails to a wanted post type : https://gist.github.com/MaximeCulea/c04e62c4b6e79b4e4e17b73dd023b6c4
# Search Replace with regex
@psaikali
psaikali / 0readme.md
Last active January 25, 2021 21:17
Créer un formulaire ACF "multi-étapes" : chaque groupe de champs (type "Groupe") est une étape du formulaire

Démonstration en vidéo

Explications

option

  • Créer un groupe de champs ACF et activer l'option "Multi-étapes"
  • Créer des champs de type "Groupe" et les remplir des sous-champs nécessaires. Chaque champ "Groupe" sera une étape à part entière dans le formulaire.
  • Insérer le formulaire front-end avec acf_form en ajoutant les 2 champs de types hidden (acf_multisteps_form & acf_multistep_current_step).
  • Enjoy !
@microneer
microneer / gist:abe764ae031e88c5b0919b661a0c8ff9
Last active November 16, 2017 14:52 — forked from swalkinshaw/gist:2695510
WordPress: Mandatory Excerpt
// put this in functions.php or in your custom plugin or theme code.
$m = new Mandatory_Excerpt()
$m->add('post', 20 ); // will require all 'post' post types to have an excerpt at least 20 characters long
/**
* Helper class which removes specified metaboxes from specified pages. It manages setting up the hooks
* and calling them.
*
* @author: Michael Fielding
*
@johnbillion
johnbillion / install-all-languages.sh
Created February 18, 2017 20:12
Install all available languages on a WordPress site with WP-CLI
wp core language list --field=language | xargs -n 1 wp core language install
@media (max-width: 320px) {
body { background-color: red; }
}
@media (min-width: 321px ) and (max-width: 375px) {
body { background-color: blue; }
}
@media (min-width: 376px ) and (max-width: 425px) {
body { background-color: orange; }
@morganestes
morganestes / .readme.md
Last active November 9, 2022 18:07
Create multiple sites with wp-cli in WordPress multisite for testing.

These commands will install multiple dummy sites in a WordPress Multisite environment.

I wrote this to easily create an environment to work on https://core.trac.wordpress.org/ticket/15317.

Usage

Shell

In the terminal, inside your WordPress directory: simply copy, paste, and run the one-line command.

You can also add it to a location available in your $PATH and invoke the script from the shell.

@eteubert
eteubert / wordpress-passwort-reset-unmultisite.php
Last active May 4, 2024 18:30
Multisite: Passwort Reset on Local Blog
<?php
/**
* Plugin Name: Multisite: Passwort Reset on Local Blog
* Plugin URI: https://gist.github.com/eteubert/293e07a49f56f300ddbb
* Description: By default, WordPress Multisite uses the main blog for passwort resets. This plugin enables users to stay in their blog during the whole reset process.
* Version: 1.0.0
* Author: Eric Teubert
* Author URI: http://ericteubert.de
* License: MIT
*/