/** * xmoze theme functions and definitions */ // File Security Check if (!defined('ABSPATH')) { exit; } /** * xmoze functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package xmoze */ if (!function_exists('xmoze_setup')) : /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function xmoze_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on xmoze, use a find and replace * to change 'xmoze' to the name of your theme in all the template files. */ load_theme_textdomain('xmoze', get_template_directory() . '/languages'); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support('title-tag'); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support('post-thumbnails'); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'main-menu' => esc_html__('Main Menu', 'xmoze'), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script', ) ); // Set up the WordPress core custom background feature. $args = apply_filters( 'xmoze_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ); add_theme_support('custom-background', $args); // Add theme support for selective refresh for widgets. add_theme_support('customize-selective-refresh-widgets'); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 250, 'width' => 250, 'flex-width' => true, 'flex-height' => true, ) ); } endif; add_action('after_setup_theme', 'xmoze_setup'); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function xmoze_content_width() { // This variable is intended to be overruled from themes. // Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}. // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound $GLOBALS['content_width'] = apply_filters('xmoze_content_width', 1200); } add_action('after_setup_theme', 'xmoze_content_width', 0); /** * * Intialize xmoze * */ require get_parent_theme_file_path('/inc/init.php'); function mon_traitement_apres_commande($order_id) { // Récupérer l'objet de la commande $order = wc_get_order($order_id); $create = get_field('cannards_crees', $order_id); if (!$create) { $first_name = $order->get_billing_first_name(); $last_name = $order->get_billing_last_name(); $email = $order->get_billing_email(); // Récupérer les articles de la commande $items = $order->get_items(); // Obtenir le numéro de canard actuel $duck_number = get_option('last_duck_number', 0) + 1; // Parcourir chaque article de la commande foreach ($items as $item_id => $item_data) { // Récupérer l'ID du produit $product_id = $item_data->get_product_id(); // Vérifier si l'ID du produit est 11366 if ($product_id == 11366) { // Récupérer la quantité commandée du produit $product_quantity = $item_data->get_quantity(); // Créer des posts de type "canard" for ($i = 0; $i < $product_quantity; $i++) { // Générer un nom de post unique avec le numéro de canard if($duck_number > 20000 && $duck_number < 25001){ $duck_number = 25001; } $post_name = $duck_number; // Créer le post de type "canard" en tant que post privé $post_id = wp_insert_post(array( 'post_title' => $post_name, 'post_name' => $post_name, 'post_type' => 'canard', 'post_status' => 'private' // Définir le statut comme "privé" )); // Attribuer la commande liée au champ ACF "commande_liee" update_field('commande_liee', $order_id, $post_id); update_field('prenom_client_canard', $first_name, $post_id); update_field('nom_client_canard', $last_name, $post_id); update_field('email_client_canard', $email, $post_id); // Incrémenter le numéro de canard pour le prochain $duck_number++; } //verrou pour dire les canards sont créés update_field('cannards_crees', 1, $order_id); } } // Mettre à jour le numéro de canard dans les options update_option('last_duck_number', $duck_number - 1); } } add_action('woocommerce_checkout_order_processed', 'mon_traitement_apres_commande'); function mon_traitement_apres_commande_TEST() { global $wpdb; $duck_number = get_option('last_duck_number', 0) + 1; var_dump($duck_number); // Tableau des statuts de commande à récupérer $statuses = array('wc-completed', 'wc-processing', 'wc-on-hold', 'wc-pending'); // Requête SQL pour récupérer les ID des commandes $requete_orders = $wpdb->prepare(" SELECT ID FROM {$wpdb->posts} WHERE post_type = 'shop_order' AND post_status IN ('" . implode("', '", $statuses) . "') "); // Exécution de la requête pour récupérer les ID des commandes $order_ids = $wpdb->get_col($requete_orders); // Vérifier si des commandes ont été trouvées if ($order_ids) { // Parcourir chaque ID de commande foreach ($order_ids as $order_id) { //canards créés $table_postmeta = $wpdb->prefix . 'postmeta'; $meta_value = $order_id; $requete = $wpdb->prepare(" SELECT COUNT(*) FROM $table_postmeta WHERE meta_key LIKE 'commande_liee' AND meta_value LIKE %s ORDER BY meta_id DESC ", $meta_value); $countCanards = (int)($wpdb->get_var($requete)); //nb de canards dans la commande $requeteOrder = $wpdb->prepare("SELECT SUM(product_qty) FROM `wpji_wc_order_product_lookup` WHERE `order_id` = %d", $meta_value); $countItems = (int)($wpdb->get_var($requeteOrder)); if ($countCanards != $countItems) { echo('la commande ' . $order_id . ' contient ' . $countItems . ' canards dans la commande mais ' . $countCanards . ' ont été créés.<br />'); } if($countCanards == 0){ } } } else { echo "Aucune commande trouvée."; } } add_shortcode('mon_shortcode_test', 'mon_traitement_apres_commande_TEST'); /************************** colonnes admin pour canards *********************************/ // Add the custom columns to the commande post type: add_filter('manage_canard_posts_columns', 'set_custom_edit_canard_columns'); function set_custom_edit_canard_columns($columns) { $columns['commande'] = 'Commande'; return $columns; } // Add the data to the custom columns for the annonce post type: add_action('manage_canard_posts_custom_column', 'custom_canard_column', 10, 2); function custom_canard_column($column, $post_id) { $commandeliee = get_field('commande_liee', $post_id); switch ($column) { case 'commande' : echo($commandeliee); break; } } add_action('pre_get_posts', 'extend_admin_search_canard'); function extend_admin_search_canard($query) { $post_type = 'canard'; $custom_fields = array("commande_liee"); if (!is_admin()) return; if ($query->query['post_type'] != $post_type) return; $search_term = $query->query_vars['s']; $query->query_vars['s'] = ''; if ($search_term != '') { $meta_query = array('relation' => 'OR'); foreach ($custom_fields as $custom_field) { array_push($meta_query, array( 'key' => $custom_field, 'value' => $search_term, 'compare' => 'LIKE' )); } $query->set('meta_query', $meta_query); }; }<!doctype html> <html dir="ltr" lang="fr-FR" prefix="og: https://ogp.me/ns#"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="https://gmpg.org/xfn/11"> <!-- All in One SEO 4.8.3.2 - aioseo.com --> <meta name="description" content="Logiciel Tirage Bingo Gratuits Les machines à sous Betfair jouent également le rôle de protagonistes absolus grâce à l'assortiment d'articles à jackpot, tous les gains qui incluent un symbole Méga qui multiplie tout ce qui est gagné dans ce tour par 5. Bien que vous puissiez utiliser cette méthode pour éviter d'être prévisible, il n'y" /> <meta name="robots" content="max-image-preview:large" /> <link rel="canonical" href="https://www.nemausus-duckrace.fr/logiciel-tirage-bingo-gratuits/" /> <meta name="generator" content="All in One SEO (AIOSEO) 4.8.3.2" /> <meta property="og:locale" content="fr_FR" /> <meta property="og:site_name" content="Duckrace à Nîmes - Adoptez le bon canard !" /> <meta property="og:type" content="article" /> <meta property="og:title" content="Logiciel Tirage Bingo Gratuits - Duckrace à Nîmes" /> <meta property="og:description" content="Logiciel Tirage Bingo Gratuits Les machines à sous Betfair jouent également le rôle de protagonistes absolus grâce à l'assortiment d'articles à jackpot, tous les gains qui incluent un symbole Méga qui multiplie tout ce qui est gagné dans ce tour par 5. Bien que vous puissiez utiliser cette méthode pour éviter d'être prévisible, il n'y" /> <meta property="og:url" content="https://www.nemausus-duckrace.fr/logiciel-tirage-bingo-gratuits/" /> <meta property="article:published_time" content="2024-06-03T09:22:01+00:00" /> <meta property="article:modified_time" content="-001-11-30T00:00:00+00:00" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:title" content="Logiciel Tirage Bingo Gratuits - Duckrace à Nîmes" /> <meta name="twitter:description" content="Logiciel Tirage Bingo Gratuits Les machines à sous Betfair jouent également le rôle de protagonistes absolus grâce à l'assortiment d'articles à jackpot, tous les gains qui incluent un symbole Méga qui multiplie tout ce qui est gagné dans ce tour par 5. Bien que vous puissiez utiliser cette méthode pour éviter d'être prévisible, il n'y" /> <script type="application/ld+json" class="aioseo-schema"> {"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.nemausus-duckrace.fr\/logiciel-tirage-bingo-gratuits\/#blogposting","name":"Logiciel Tirage Bingo Gratuits - Duckrace \u00e0 N\u00eemes","headline":"Logiciel Tirage Bingo Gratuits","author":{"@id":"https:\/\/www.nemausus-duckrace.fr\/author\/#author"},"publisher":{"@id":"https:\/\/www.nemausus-duckrace.fr\/#organization"},"datePublished":"2024-06-03T09:22:01+00:00","dateModified":"-0001-11-30T00:00:00+00:00","inLanguage":"fr-FR","mainEntityOfPage":{"@id":"https:\/\/www.nemausus-duckrace.fr\/logiciel-tirage-bingo-gratuits\/#webpage"},"isPartOf":{"@id":"https:\/\/www.nemausus-duckrace.fr\/logiciel-tirage-bingo-gratuits\/#webpage"}},{"@type":"BreadcrumbList","@id":"https:\/\/www.nemausus-duckrace.fr\/logiciel-tirage-bingo-gratuits\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.nemausus-duckrace.fr#listItem","position":1,"name":"Accueil","item":"https:\/\/www.nemausus-duckrace.fr","nextItem":{"@type":"ListItem","@id":"https:\/\/www.nemausus-duckrace.fr\/logiciel-tirage-bingo-gratuits\/#listItem","name":"Logiciel Tirage Bingo Gratuits"}},{"@type":"ListItem","@id":"https:\/\/www.nemausus-duckrace.fr\/logiciel-tirage-bingo-gratuits\/#listItem","position":2,"name":"Logiciel Tirage Bingo Gratuits","previousItem":{"@type":"ListItem","@id":"https:\/\/www.nemausus-duckrace.fr#listItem","name":"Accueil"}}]},{"@type":"Organization","@id":"https:\/\/www.nemausus-duckrace.fr\/#organization","name":"My Blog","description":"Adoptez le bon canard !","url":"https:\/\/www.nemausus-duckrace.fr\/"},{"@type":"Person","@id":"https:\/\/www.nemausus-duckrace.fr\/author\/#author","url":"https:\/\/www.nemausus-duckrace.fr\/author\/"},{"@type":"WebPage","@id":"https:\/\/www.nemausus-duckrace.fr\/logiciel-tirage-bingo-gratuits\/#webpage","url":"https:\/\/www.nemausus-duckrace.fr\/logiciel-tirage-bingo-gratuits\/","name":"Logiciel Tirage Bingo Gratuits - Duckrace \u00e0 N\u00eemes","description":"Logiciel Tirage Bingo Gratuits Les machines \u00e0 sous Betfair jouent \u00e9galement le r\u00f4le de protagonistes absolus gr\u00e2ce \u00e0 l'assortiment d'articles \u00e0 jackpot, tous les gains qui incluent un symbole M\u00e9ga qui multiplie tout ce qui est gagn\u00e9 dans ce tour par 5. Bien que vous puissiez utiliser cette m\u00e9thode pour \u00e9viter d'\u00eatre pr\u00e9visible, il n'y","inLanguage":"fr-FR","isPartOf":{"@id":"https:\/\/www.nemausus-duckrace.fr\/#website"},"breadcrumb":{"@id":"https:\/\/www.nemausus-duckrace.fr\/logiciel-tirage-bingo-gratuits\/#breadcrumblist"},"author":{"@id":"https:\/\/www.nemausus-duckrace.fr\/author\/#author"},"creator":{"@id":"https:\/\/www.nemausus-duckrace.fr\/author\/#author"},"datePublished":"2024-06-03T09:22:01+00:00","dateModified":"-0001-11-30T00:00:00+00:00"},{"@type":"WebSite","@id":"https:\/\/www.nemausus-duckrace.fr\/#website","url":"https:\/\/www.nemausus-duckrace.fr\/","name":"My Blog","description":"Adoptez le bon canard !","inLanguage":"fr-FR","publisher":{"@id":"https:\/\/www.nemausus-duckrace.fr\/#organization"}}]} </script> <!-- All in One SEO --> <link rel="alternate" title="oEmbed (JSON)" type="application/json+oembed" href="https://www.nemausus-duckrace.fr/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.nemausus-duckrace.fr%2Flogiciel-tirage-bingo-gratuits%2F" /> <link rel="alternate" title="oEmbed (XML)" type="text/xml+oembed" href="https://www.nemausus-duckrace.fr/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.nemausus-duckrace.fr%2Flogiciel-tirage-bingo-gratuits%2F&format=xml" /> <style id='wp-img-auto-sizes-contain-inline-css' type='text/css'> img:is([sizes=auto i],[sizes^="auto," i]){contain-intrinsic-size:3000px 1500px} /*# sourceURL=wp-img-auto-sizes-contain-inline-css */ </style> <link rel='stylesheet' id='formidable-css' href='https://www.nemausus-duckrace.fr/wp-content/plugins/formidable/css/formidableforms.css?ver=2161445' type='text/css' media='all' /> <style id='wp-emoji-styles-inline-css' type='text/css'> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 0.07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } /*# sourceURL=wp-emoji-styles-inline-css */ </style> <link rel='stylesheet' id='wp-block-library-css' href='https://www.nemausus-duckrace.fr/wp-includes/css/dist/block-library/style.min.css?ver=6.9.1' type='text/css' media='all' /> <style id='classic-theme-styles-inline-css' type='text/css'> /*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} /*# sourceURL=/wp-includes/css/classic-themes.min.css */ </style> <link rel='stylesheet' id='redux-extendify-styles-css' href='https://www.nemausus-duckrace.fr/wp-content/plugins/redux-framework/redux-core/assets/css/extendify-utilities.css?ver=4.4.13' type='text/css' media='all' /> <link rel='stylesheet' id='woocommerce-layout-css' href='https://www.nemausus-duckrace.fr/wp-content/plugins/woocommerce/assets/css/woocommerce-layout.css?ver=8.7.2' type='text/css' media='all' /> <link rel='stylesheet' id='woocommerce-smallscreen-css' href='https://www.nemausus-duckrace.fr/wp-content/plugins/woocommerce/assets/css/woocommerce-smallscreen.css?ver=8.7.2' type='text/css' media='only screen and (max-width: 768px)' /> <link rel='stylesheet' id='woocommerce-general-css' href='https://www.nemausus-duckrace.fr/wp-content/plugins/woocommerce/assets/css/woocommerce.css?ver=8.7.2' type='text/css' media='all' /> <style id='woocommerce-inline-inline-css' type='text/css'> .woocommerce form .form-row .required { visibility: visible; } /*# sourceURL=woocommerce-inline-inline-css */ </style> <link rel='stylesheet' id='cmplz-general-css' href='https://www.nemausus-duckrace.fr/wp-content/plugins/complianz-gdpr/assets/css/cookieblocker.min.css?ver=1710321042' type='text/css' media='all' /> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-includes/js/jquery/jquery.min.js?ver=3.7.1" id="jquery-core-js"></script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1" id="jquery-migrate-js"></script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/mas-addons/assets/js/slick.js?ver=6.9.1" id="slick-js"></script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/mas-addons/assets/js/owl.carousel.min.js?ver=6.9.1" id="owl-carousel-js"></script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/mas-addons/assets/js/isotope.pkgd.min.js?ver=6.9.1" id="isotope-js"></script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/mas-addons/assets/js/packery-mode.pkgd.min.js?ver=6.9.1" id="packery-js"></script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/mas-addons/assets/js/addon.js?ver=6.9.1" id="mas-addons-js"></script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/google-analytics-for-wordpress/assets/js/frontend-gtag.min.js?ver=10.0.1" id="monsterinsights-frontend-script-js" async="async" data-wp-strategy="async"></script> <script data-cfasync="false" data-wpfc-render="false" type="text/javascript" id='monsterinsights-frontend-script-js-extra'>/* <![CDATA[ */ var monsterinsights_frontend = {"js_events_tracking":"true","download_extensions":"doc,pdf,ppt,zip,xls,docx,pptx,xlsx","inbound_paths":"[{\"path\":\"\\\/go\\\/\",\"label\":\"affiliate\"},{\"path\":\"\\\/recommend\\\/\",\"label\":\"affiliate\"}]","home_url":"https:\/\/www.nemausus-duckrace.fr","hash_tracking":"false","v4_id":"G-HLJV9W5HDZ"};/* ]]> */ </script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/woocommerce/assets/js/jquery-blockui/jquery.blockUI.min.js?ver=2.7.0-wc.8.7.2" id="jquery-blockui-js" defer="defer" data-wp-strategy="defer"></script> <script type="text/javascript" id="wc-add-to-cart-js-extra"> /* <![CDATA[ */ var wc_add_to_cart_params = {"ajax_url":"/wp-admin/admin-ajax.php","wc_ajax_url":"/?wc-ajax=%%endpoint%%","i18n_view_cart":"View cart","cart_url":"https://www.nemausus-duckrace.fr/panier/","is_cart":"","cart_redirect_after_add":"no"}; //# sourceURL=wc-add-to-cart-js-extra /* ]]> */ </script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=8.7.2" id="wc-add-to-cart-js" defer="defer" data-wp-strategy="defer"></script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/woocommerce/assets/js/js-cookie/js.cookie.min.js?ver=2.1.4-wc.8.7.2" id="js-cookie-js" defer="defer" data-wp-strategy="defer"></script> <script type="text/javascript" id="woocommerce-js-extra"> /* <![CDATA[ */ var woocommerce_params = {"ajax_url":"/wp-admin/admin-ajax.php","wc_ajax_url":"/?wc-ajax=%%endpoint%%"}; //# sourceURL=woocommerce-js-extra /* ]]> */ </script> <script type="text/javascript" src="https://www.nemausus-duckrace.fr/wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.min.js?ver=8.7.2" id="woocommerce-js" defer="defer" data-wp-strategy="defer"></script> <script type="text/javascript" id="WCPAY_ASSETS-js-extra"> /* <![CDATA[ */ var wcpayAssets = {"url":"https://www.nemausus-duckrace.fr/wp-content/plugins/woocommerce-payments/dist/"}; //# sourceURL=WCPAY_ASSETS-js-extra /* ]]> */ </script> <link rel="https://api.w.org/" href="https://www.nemausus-duckrace.fr/wp-json/" /><link rel="alternate" title="JSON" type="application/json" href="https://www.nemausus-duckrace.fr/wp-json/wp/v2/posts/85282" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://www.nemausus-duckrace.fr/xmlrpc.php?rsd" /> <meta name="generator" content="WordPress 6.9.1" /> <meta name="generator" content="WooCommerce 8.7.2" /> <link rel='shortlink' href='https://www.nemausus-duckrace.fr/?p=85282' /> <meta name="generator" content="Redux 4.4.13" /> <noscript><style>.woocommerce-product-gallery{ opacity: 1 !important; }</style></noscript> <meta name="generator" content="Elementor 3.19.4; features: e_optimized_assets_loading, e_optimized_css_loading, additional_custom_breakpoints, block_editor_assets_optimize, e_image_loading_optimization; settings: css_print_method-external, google_font-enabled, font_display-swap"> <link rel="icon" href="https://www.nemausus-duckrace.fr/wp-content/uploads/2024/01/cropped-cropped-LOGO-32x32.png" sizes="32x32" /> <link rel="icon" href="https://www.nemausus-duckrace.fr/wp-content/uploads/2024/01/cropped-cropped-LOGO-192x192.png" sizes="192x192" /> <link rel="apple-touch-icon" href="https://www.nemausus-duckrace.fr/wp-content/uploads/2024/01/cropped-cropped-LOGO-180x180.png" /> <meta name="msapplication-TileImage" content="https://www.nemausus-duckrace.fr/wp-content/uploads/2024/01/cropped-cropped-LOGO-270x270.png" /> </head> <body class="wp-singular post-template-default single single-post postid-85282 single-format-standard wp-custom-logo wp-theme-xmoze theme-xmoze woocommerce-no-js elementor-default elementor-kit-52"> <!-- preloader -->