Delete from WordPress when deleted in Formidable and Vice Versa

/** * Name: fw_deleteWPUserWithRegistration * Desc: Delete user from WordPress when deleted in Formidable registration form **/ add_action(‘frm_before_destroy_entry’, ‘fw_deleteWPUserWithRegistration’); function fw_deleteWPUserWithRegistration($entry_id) { $entry = FrmEntry::getOne($entry_id, true); if ($entry->form_id == MEMBER_REGISTRATION_FORM_ID) { $entry = FrmEntry::getOne($entry_id, true); $user_id = fw_getValueFromMetasByID($entry->metas, MEMBER_REGISTRATION_USER_ID_FIELD_ID); if…Continue reading

Wpallimport Time Stamp Converter

function convert_to_cst_for_import( $utc ) { if ( empty( $utc ) ) return ”; try { $dt = new DateTime( $utc, new DateTimeZone( ‘UTC’ ) ); $dt->setTimezone( new DateTimeZone( ‘America/Chicago’ ) ); // CST/CDT auto-handled return $dt->format( ‘Y-m-d H:i:s’ ); }…Continue reading

snip_FetchPriority version 10

add_action(‘template_redirect’, function () { ob_start(function ($html) { return preg_replace_callback( ‘#]+class=”[^”]*highfetchprio[^”]*”[^>]*)>#i’, function ($matches) { $img = $matches[0]; // ✅ Supprimer lazyload et attributs inutiles $img = preg_replace(‘#slazyload(ed)?#i’, ”, $img); $img = preg_replace(‘#sdata-lazy-[a-z]+=”[^”]*”#i’, ”, $img); // ✅ Supprimer anciens attributs $img =…Continue reading

snip_FetchPriority version 9

add_filter(‘wp_get_attachment_image_attributes’, function ($attr, $attachment) { if (!empty($attr[‘class’]) && strpos($attr[‘class’], ‘highfetchprio’) !== false) { // ✅ Optimisations LCP $attr[‘fetchpriority’] = ‘high’; $attr[‘loading’] = ‘eager’; $attr[‘decoding’] = ‘async’; // ✅ Suppression complète des traces de lazyload $attr[‘class’] = str_replace([‘lazyloaded’, ‘lazyload’], ”, $attr[‘class’]);…Continue reading

snip_FetchPriority version 8

add_filter( ‘wp_get_attachment_image_attributes’, function( $attr, $attachment ) { if ( isset($attr[‘class’]) && strpos($attr[‘class’], ‘highfetchprio’) !== false ) { // Optimisations LCP $attr[‘fetchpriority’] = ‘high’; $attr[‘loading’] = ‘eager’; $attr[‘decoding’] = ‘async’; // Supprimer toute trace lazyload HTML $attr[‘class’] = str_replace([‘lazyloaded’, ‘lazyload’], ”,…Continue reading

Social Share Buttons (copy)

$post_url = urlencode( get_permalink() ); $post_title = urlencode( get_the_title() ); $facebook_url = “https://www.facebook.com/sharer/sharer.php?u=$post_url”; $x_url = “https://twitter.com/intent/tweet?url=$post_url&text=$post_title”; $linkedin_url = “https://www.linkedin.com/shareArticle?mini=true&url=$post_url&title=$post_title”; $social_buttons = ‘ ‘; echo $social_buttons; // Styles for the social sharing buttons. echo ‘ .social-share-buttons { display: flex; gap: 10px;…Continue reading

Social Share Buttons (copy)

$post_url = urlencode( get_permalink() ); $post_title = urlencode( get_the_title() ); $facebook_url = “https://www.facebook.com/sharer/sharer.php?u=$post_url”; $x_url = “https://twitter.com/intent/tweet?url=$post_url&text=$post_title”; $linkedin_url = “https://www.linkedin.com/shareArticle?mini=true&url=$post_url&title=$post_title”; $social_buttons = ‘ ‘; echo $social_buttons; // Styles for the social sharing buttons. echo ‘ .social-share-buttons { display: flex; gap: 10px;…Continue reading

snip_FetchPriority version 7

add_filter( ‘wp_get_attachment_image_attributes’, function( $attr, $attachment ) { if ( isset($attr[‘class’]) && strpos($attr[‘class’], ‘highfetchprio’) !== false ) { // Optimisations LCP $attr[‘loading’] = ‘eager’; $attr[‘fetchpriority’] = ‘high’; $attr[‘decoding’] = ‘async’; // Supprimer toute trace lazyload HTML $attr[‘class’] = str_replace([‘lazyloaded’, ‘lazyload’], ”,…Continue reading