Améliorer Recherche par posts BuddyPress (pas sur)

function custom_bp_user_activity_search($search_terms) { // Vérifiez que la recherche n’est pas vide if (empty($search_terms)) { return; } global $wpdb; // Sanitize le terme de recherche $search = implode(‘ ‘, array_map(‘esc_sql’, explode(‘ ‘, $search_terms))); // Recherche l’utilisateur par son nom d’utilisateur ou…Continue reading

Forcer la redirection inscription vers la page Se connecter

function custom_redirect_app_pages() { // Vérifiez si l’URL actuelle correspond à ‘app/register-2’ ou ‘app/activate’ $request_uri = $_SERVER[‘REQUEST_URI’]; if (strpos($request_uri, ‘/app/register-2’) !== false || strpos($request_uri, ‘/app/activate’) !== false) { // Rediriger vers la nouvelle URL wp_redirect(‘https://francodeal.com/se-connecter-sur-mon-espace-fd/’); exit(); } } add_action(‘template_redirect’, ‘custom_redirect_app_pages’);Continue reading

Change Validation Messages for Required Fields – WPML

/** * Customize strings for WPForms form validation * * @link https://wpforms.com/developers/change-validation-messages-for-wpml/ */ function wpforms_dev_frontend_strings( $strings ) { $currentLanguage = defined( ‘ICL_LANGUAGE_CODE’ ) ? ICL_LANGUAGE_CODE : null; switch ( $currentLanguage ) { case ‘fr’: $strings[ ‘val_required’ ] = ‘Ce champ…Continue reading

Do not cache events

/** * Force no-cache via HTTP headers. */ function my_no_cache_headers() { // Use WordPress core helper to set typical no-cache headers: nocache_headers(); // Or you could manually set them if needed: // header( ‘Cache-Control: no-store, no-cache, must-revalidate, max-age=0’ ); //…Continue reading

VGNummer-database-fetch-function-PHP

add_action(‘wp_ajax_fetch_vg_data’, ‘fetch_vg_data’); add_action(‘wp_ajax_nopriv_fetch_vg_data’, ‘fetch_vg_data’); function fetch_vg_data() { $vg_nummer = sanitize_text_field($_POST[‘test’]); // Update to match the URL parameter global $wpdb; $result = $wpdb->get_row( $wpdb->prepare(“SELECT `email`, `inkontakt_id`, `link_test`, `new_link_test` , `new_link_test_2` FROM vg_nummern WHERE `vg_nummer` = %s”, $vg_nummer) ); if ($result) {…Continue reading