-
Try to access the Local adminer in order to generate it
-
Copy all credentials into the .env:
WP_ENV=local
DB_NAME=local
DB_USER=root
DB_PASSWORD=root
DB_PREFIX=local_ -
Delete everything into the Local docroot (app/public) folder
-
Copy and sync the gited folder to the "app" Local folder
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 | |
/** | |
* Class MC_BP_Notifications | |
* Handle the read all notifications without post / get method, based on unread notifications | |
* | |
* To be used in HTML : <a href="<?php echo Wide_Notifications::mark_notifications_as_read_url(); ?>">Read all notifications</a> | |
* | |
* @author Maxime CULEA | |
*/ |
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 | |
/** | |
* Hide ACF Edition buttons for repeater for publication_most_commented, etc | |
*/ | |
function admin_print_scripts() { | |
echo "<script type='text/javascript'>jQuery(\"[data-name='publication_most_commented'], [data-name='publication_by_user'], [data-name='publication_most_liked']\").find('.acf-actions, .acf-row-handle').hide();</script>"; | |
} | |
add_action( 'admin_print_footer_scripts', 'admin_print_scripts' ); |
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 | |
/** | |
* Change on the fly an ACF value | |
* Here group id into group name | |
* | |
* @param $value : original value | |
* @param $field_name : field key name | |
* @param $post_id : post id | |
* |
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 | |
/** | |
* Manage to "group" by new notifications first but still order all notifications by date | |
* @author Maxime CULEA | |
*/ | |
// inside the notifications loop | |
$args = [ 'is_new' => 'both', 'order_by' => 'mc_custom_notification_order', 'sort_order' => 'DESC' ]; | |
if ( bp_has_notifications( $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 | |
add_action( 'init', function() { | |
$check_list_of_caps = [ 'custom_capability_one', 'custom_capability_two', 'manage_options' ]; | |
// Test one | |
$time_start = microtime( true ); | |
// Get current user caps | |
$all_users_caps = wp_get_current_user()->allcaps; |
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 | |
/** | |
* Strip then trim a text around the cut $cut_length | |
* | |
* @param string $text | |
* @param int $cut_length | |
* | |
* @author Maxime CULEA | |
* | |
* @return string |
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 | |
/** | |
* For all files into one site folder. | |
*/ | |
//add_filter( 'upload_dir', 'move_uploads' ); | |
function move_uploads( $cache_key ) { | |
$blog_id = get_current_blog_id(); | |
if ( 6 === $blog_id ) { | |
return $cache_key; | |
} |
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: Be API - Search WP | |
Plugin URI: http://www.beapi.fr | |
Description: Deactive Search WP on AJAX P2P search query | |
Author: BeAPI | |
Author URI: http://www.beapi.fr | |
Version: 1.0.0 | |
*/ |
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 | |
/** | |
* When using woocommerce_form_field api | |
* Some tips to maje custom things | |
*/ | |
woocommerce_form_field( 'field_id', [ | |
// make the field readonly | |
'custom_attributes' => [ 'readonly' => true ] | |
], 'value' ); |