This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Sugar Calendar - Gutenberg | |
* Description: Add support of Gutenberg to Sugar Calendar with minor tweaks | |
* Author: Be API Team | |
* Author URI: http://beapi.fr/ | |
* License: GNU General Public License v2 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
* | |
* @see: https://gist.github.com/herewithme/f1c377377cc3dcedc8388dd97196fdb6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'lhr_log_data', | |
function ( $data ) { | |
$backtrace = wp_debug_backtrace_summary(); | |
$data['request_args'] = json_decode( $data['request_args'] ); | |
$data['request_args']->backtrace = $backtrace; | |
$data['request_args'] = json_encode( $data['request_args'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: RankMath & WP Job Manager | |
Version: 1.0.0 | |
Plugin URI: https://beapi.fr | |
Description: Add jobs listing page on rankMath breadcrumb | |
Author: Be API | |
Author URI: https://beapi.fr | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp site list --field=url --url="NETWORK" | xargs -I {} wp wc update --url={} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author Amaury Balmer - BEAPI.fr | |
# See: https://wordpress.stackexchange.com/questions/195046/relaunch-4-2-utf8mb4-databse-upgrade/244992#244992 | |
# Purpose - Convert all tables to UTF8MB4 with WP-CLI | |
# Create array of all tables | |
WPTABLES=($(wp db tables --all-tables)) | |
# loop through array and alter tables | |
for WPTABLE in ${WPTABLES[@]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for url in $( wp site list --allow-root --field="url" --url="https://XXX" ); | |
do | |
echo $url; | |
wp --allow-root user list --network --url="https://XXX" --field=id | xargs -I % wp --allow-root user set-role % administrator --url=$url | |
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WPforms - French Phone Validation | |
* Plugin URI: https://beapi.fr | |
* Description: Add JS and PHP check for validate french number, supported formats : +33123456789 and 0123456789 | |
* Version: 0.2 | |
* Author: BE API | |
* Author URI: https://beapi.fr | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Initialize values: 1000000 keys of 20 bytes with 40 bytes of data | |
$c = 1000000; | |
$values = array(); | |
for ($i=0;$i<$c;$i++) $values[sprintf('%020s',$i)]=sha1($i); | |
// Memcached | |
$m = new Memcached(); | |
$m->addServer('10.0.101.82', 11211); | |
$start = microtime(true); |
NewerOlder