Skip to content

Instantly share code, notes, and snippets.

View herewithme's full-sized avatar
🎯
Focusing

Amaury Balmer herewithme

🎯
Focusing
View GitHub Profile
@herewithme
herewithme / gist:fb65d93ca9c8a2c5cf1b
Created June 2, 2015 15:37
Force english on WP admin !
<?php
/*
Plugin Name: Languages Admin
Plugin URI: http://www.beapi.fr
Description: Force English on WP admin
Author: BeAPI
Author URI: http://www.beapi.fr
Version: 0.1
Text Domain: bea-languages
@herewithme
herewithme / force-domain-mapping.php
Last active December 1, 2015 13:19
Force replace original domain by mapped domain for WPMU Domain Mapping
<?php
/*
Plugin Name: BEA Domain Mapping
Description: Always force replace original domain by mapping domain
Plugin URI: http://www.beapi.fr
Version: 1.0
Author: BeAPI
Author URI: http://www.beapi.fr
/*
@herewithme
herewithme / members-fix-attachment.php
Created September 23, 2013 09:13
This plugin fix an issue with medias and content restriction on "Members" plugin WordPress (http://wordpress.org/plugins/members/). Allow to save correctly metabox data also for "attachment" post type.
<?php
/*
Plugin Name: Members - Fix for attachment
Plugin URI: http://www.beapi.fr
Description: This plugin fix an issue with medias and content restriction on "Members" plugin WordPress (http://wordpress.org/plugins/members/). Allow to save correctly metabox data also for "attachment" post type.
Author: BeAPI
Author URI: http://www.beapi.fr
Version: 0.1
----
@herewithme
herewithme / bea-acf-helpers.php
Created December 3, 2013 16:20
Small class helper for get ACF fields for a specific post type
<?php
class BEA_ACF_Helpers {
// Fields to not add to the available fields of acf
private static $unauth_fields = array(
'repeater',
'relationship',
'flexible_content'
);
/**
@herewithme
herewithme / varnish-purge-all.php
Last active February 16, 2016 11:47
Internal usage -- Purge all varnish when WP changes any content
<?php
/*
Plugin Name: Purge all varnish
Plugin URI: http://www.beapi.fr
Description: Purge all varnish cache when a post is modified/edited
Version: 1.3
Author: BeAPI
Author URI: http://www.beapi.fr
Network: true
*/
@herewithme
herewithme / sanitize-filename.php
Created November 29, 2013 11:15
WordPress - No french punctuation and accents for filename
<?php
/*
Plugin Name: No french punctuation and accents for filename
Description: Remove all french punctuation and accents from the filename of upload for client limitation (Safari Mac/IOS)
Plugin URI: http://www.beapi.fr
Version: 1.0
Author: BeAPI
Author URI: http://www.beapi.fr
/*
@herewithme
herewithme / acf-functions-helper.php
Last active February 14, 2018 07:58
ACF template helper - Checks if at least one field is completed by BO for display or not a block
<?php
/**
* This function checks if at least one field is completed by BO
*
* @param array|string $fields the list of ACF fields to test, an array or a string of text separated by a comma
* @param mixed $object the post_id of which the value is saved against
* @param bool $is_sub_field
*
* @return bool
*/
@herewithme
herewithme / prod-images.php
Last active March 31, 2019 11:17
This plugin allow to build development environnement without copy data from uploads folder. Manage an failback with PHP and production assets.
<?php
/*
* Plugin Name: BEA - Prod images
* Version: 0.1
* Plugin URI: http://www.beapi.fr
* Description: This plugin allow to build development environnement without copy data from uploads folder. Manage an failback with PHP and production assets.
* Author: BeAPI
* Author URI: http://www.beapi.fr
* Domain Path: languages
* Network: false
@herewithme
herewithme / wp-cli-wc-update-network.sh
Created June 29, 2019 16:34
WP-CLI, update WooCommerce for each sites of network
wp site list --field=url --url="NETWORK" | xargs -I {} wp wc update --url={}
@herewithme
herewithme / wpcli-wpaep.php
Created June 29, 2019 17:23
A WP-CLI command for refresh existing export (trigger|processing) from WP All Export Pro plugin
<?php
/*
Plugin Name: WP-CLI - WP All Export Pro
Plugin URI: http://www.beapi.fr
Description: Add a WP-CLI command for refresh existing export (trigger|processing) from WP All Export Pro plugin
Author: Be API
Author URI: http://www.beapi.fr
Version: 0.1
----