[ADMIN] Disable Spinner Buttons in Number Input Fields
add_action(‘admin_head’, function () { echo ‘ ‘; });Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action(‘admin_head’, function () { echo ‘ ‘; });Continue reading
// Function to duplicate a menu function duplicate_menu_action() { // Check if the action is to duplicate a menu if (isset($_GET[‘action’]) && $_GET[‘action’] === ‘duplicate_menu’ && isset($_GET[‘menu_id’])) { // Verify the user has the required capability if (!current_user_can(‘edit_theme_options’)) { wp_die(__(‘You…Continue reading
// Delete from WordPress when deleted in Formidable add_action(‘frm_before_destroy_entry’, ‘delete_user_with_entry’); function delete_user_with_entry($entry_id) { $form_id = 2; // Replace 2 with the ID of your form $field_id = 180; // Replace 6 with the ID of your userID field $entry =…Continue reading
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
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
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
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
$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
$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
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