Pierre Saikali psaikali
-
Mosaika
- Tours, France
- Sign in to view email
- https://saika.li
View as3cf-update_products_downloadable_files.php
<?php | |
namespace Mosaika; | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** | |
* Register our custom commands. |
View custom_wc_get_products_parameters.php
<?php | |
namespace Mosaika; | |
/** | |
* Handle a custom 'vendor' query var to get products of a specific Vendor. | |
* Handle a custom 'featured_by_vendor' query var to get featured products of a specific Vendor. | |
* | |
* @param array $query_args - WP_Query args | |
* @param array $query_vars - WC_Product_Query args |
View 1mailchimp-wp-fonction.php
<?php | |
namespace MSK\Blog\Mailchimp; | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** | |
* Inscrit un utilisateur dans une liste MailChimp | |
* |
View inspect-wordpress-hooks.php
<?php | |
/** | |
* Inspect/list functions called on hooks containing specific term | |
* | |
* @param array Array of terms that the hook should contain | |
* @return array | |
*/ | |
function inspect_hooks( $terms = [ 'wp_' ] ) { | |
global $wp_filter; | |
$related_hooks = []; |
View gravity-forms-process-form-if-matches-acf-option.php
<?php | |
/** | |
* Intercept form submission and process it | |
*/ | |
function gf_intercept_form_submission( $data, $form ) { | |
if ( (int) $form['id'] !== (int) get_field( 'submit_project_gf_form_id', 'option' ) ) { | |
return; | |
} | |
// Do something with $data |
View acf-gravity-forms-field.php
<?php | |
/** | |
* Populate ACF select field options with Gravity Forms forms | |
*/ | |
function acf_populate_gf_forms_ids( $field ) { | |
if ( class_exists( 'GFFormsModel' ) ) { | |
$choices = []; | |
foreach ( \GFFormsModel::get_forms() as $form ) { | |
$choices[ $form->id ] = $form->title; |
View fix-wordpress-permissions.sh
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
View 8fields_update_erase_data.php
<?php | |
// Article/tutoriel complet sur https://mosaika.fr/astuces-developpement-acf/ | |
// Documentation officielle https://www.advancedcustomfields.com/resources/acf-update_value/ | |
/** | |
* Comparer la valeur de 2 champs pour accepter/refuser leur validation | |
* Filtre : acf/update_value | |
*/ |
View 7fields_update_save_data_elsewhere.php
<?php | |
// Article/tutoriel complet sur https://mosaika.fr/astuces-developpement-acf/ | |
// Documentation officielle https://www.advancedcustomfields.com/resources/acf-save_post/ | |
/** | |
* Enregistrer la variable d'un champ dans un autre champ du post | |
* Filtre : acf/save_post | |
*/ |
View 6fields_update_sanitize_wysiwyg.php
<?php | |
// Article/tutoriel complet sur https://mosaika.fr/astuces-developpement-acf/ | |
// Documentation officielle https://www.advancedcustomfields.com/resources/acf-validate_value/ | |
/** | |
* Nettoyer/sécuriser la valeur d'un champ WYSIWYG | |
* Filtre : acf/update_value | |
*/ |
NewerOlder