Risultati della ricerca per 'Wordpress custom script'

Stai vedendo 15 risultati - da 1 a 15 (di 48 totali)
    • Ciao,
      sto riscontrando un problema con WooCommerce riguardo l’invio delle email e la configurazione del campo “Email mittente”. Ecco una descrizione dettagliata del problema e le azioni già intraprese:

      Problema:

      1. Le email generate da WooCommerce, come quelle per “Nuovo account cliente”, non vengono inviate. Tuttavia:
        • Le email di test inviate tramite WP Mail SMTP funzionano correttamente.
        • Altre email del sito (es. recupero password di WordPress) vengono inviate correttamente.
      2. Il campo “Email mittente” nelle impostazioni delle email di WooCommerce rimane sempre vuoto, anche dopo aver inserito un indirizzo valido e salvato. Ad ogni aggiornamento, il valore sparisce.

      Azioni già intraprese:

      1. Reinstallazione di WooCommerce:
        Ho disattivato ed eliminato il plugin, poi l’ho reinstallato. Il problema persiste.
      2. Disattivazione di tutti i plugin:
        Ho disattivato tutti i plugin tranne WooCommerce e WP Mail SMTP per escludere conflitti, ma non è cambiato nulla.
      3. Cambio temporaneo di tema:
        Ho testato con un tema predefinito di WordPress (Twenty Twenty-Two), ma il problema si presenta ugualmente.
      4. Configurazione di WP Mail SMTP:
        • Le email di test funzionano perfettamente.
        • Ho verificato che il server SMTP sia configurato correttamente e funzioni.
      5. Log di WooCommerce:
        Non ci sono errori evidenti nei log delle email o negli strumenti diagnostici forniti da WooCommerce.

      Ulteriori Informazioni:

      • Il sito usa la versione più recente di WordPress e WooCommerce.
      • Ho provato anche a disabilitare temporaneamente la cache, senza risultati.

      Vi chiedo gentilmente di aiutarmi a identificare la causa di questo problema. Può essere legato a:

      • Una configurazione anomala nel database?
      • Un bug del plugin?
      • Un problema di compatibilità non rilevato?

      Allego il report dello stato del sistema per aiutarvi nella diagnosi.

      Grazie mille per l’aiuto!

      Stato del Sistema

      WordPress Environment<br><br>WordPress address (URL): https://www.anekecandles.com<br>Site address (URL): https://www.anekecandles.com<br>WC Version: 9.4.3<br>Legacy REST API Package Version: Il plugin API REST legacy non è installato in questo sito.<br>Action Scheduler Version: ✔ 3.8.2<br>Log Directory Writable: ✔<br>WP Version: 6.7.1<br>WP Multisite: –<br>WP Memory Limit: 1 GB<br>WP Debug Mode: –<br>WP Cron: ✔<br>Language: it_IT<br>External object cache: – Server Environment<br><br>Server Info: Apache<br>PHP Version: 8.0.30<br>PHP Post Max Size: 128 MB<br>PHP Time Limit: 900<br>PHP Max Input Vars: 3000<br>cURL Version: 7.68.0<br>OpenSSL/1.1.1f<br><br>SUHOSIN Installed: –<br>MySQL Version: 8.0.36-28<br>Max Upload Size: 128 MB<br>Default Timezone is UTC: ✔<br>fsockopen/cURL: ✔<br>SoapClient: Active Plugins (21)<br><br>Advanced Custom Fields: di WP Engine – 6.3.11<br>Akismet Anti-spam: Spam Protection: di Automattic – Squadra antispam – 5.3.5<br>Aruba HiSpeed Cache: di Aruba.it – 2.0.20<br>Backuply: di Softaculous – 1.4.1<br>Contact Form 7: di Takayuki Miyoshi – 6.0.1<br>Elementor Pro: di Elementor.com – 3.25.4<br>Elementor: di Elementor.com – 3.25.10<br>Essential Addons for Elementor: di WPDeveloper – 6.0.10<br>Flexible Checkout Fields: di WP Desk – 4.1.15<br>GetResponseOfficial: di GetResponse – 1.3.9<br>Ultimate Addons for Elementor Lite: di Brainstorm Force<br>Nikhil Chavan – 2.0.0<br><br>Health Check & Troubleshooting: di The WordPress.org community – 1.7.1<br>Jetpack: di Automattic – 14.0<br>Checkout Field Editor for WooCommerce: di ThemeHigh – 2.0.6<br>Widgets for WooCommerce Products on Elementor: di Themelocation – 2.0.4<br>WooCommerce: di Automattic – 9.4.3<br>ShopLentor – WooCommerce Builder for Elementor & Gutenberg: di HasThemes – 3.0.1<br>Yoast SEO: di Team Yoast – 23.9<br>WP Mail SMTP: di WP Mail SMTP – 4.3.0<br>WPForms Lite: di WPForms – 1.9.2.3<br>YayMail – WooCommerce Email Customizer: di YayCommerce – 3.5.7 Inactive Plugins (2)<br><br>Softaculous Pro: di Softaculous – 2.1.5<br>WP Login and Logout Redirect: di Aminur Islam – 3.0 Must Use Plugins (1)<br><br>Health Check Troubleshooting Mode: di – 1.9.2 Settings<br><br>Legacy API Enabled: –<br>Force SSL: –<br>Currency: EUR (€)<br>Currency Position: right_space<br>Thousand Separator: .<br>Decimal Separator: ,<br>Number of Decimals: 2<br>Taxonomies: Product Types: external (external)<br>grouped (grouped)<br>simple (simple)<br>variable (variable)<br><br>Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)<br>exclude-from-search (exclude-from-search)<br>featured (featured)<br>outofstock (outofstock)<br>rated-1 (rated-1)<br>rated-2 (rated-2)<br>rated-3 (rated-3)<br>rated-4 (rated-4)<br>rated-5 (rated-5)<br><br>Connected to WooCommerce.com: –<br>Enforce Approved Product Download Directories: ✔<br>HPOS feature enabled: ✔<br>Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore<br>HPOS data sync enabled: – Logging<br><br>Enabled: ✔<br>Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2<br>Retention period: 30 giorni<br>Level threshold: –<br>Log directory size: 553 KB WC Pages<br><br>Shop base: #79 – /negozio/<br>Carrello: #80 – /carrello/ – Contiene il blocco woocommerce/cart<br>Pagamento: ❌ La pagina non contiene lo shortcode [woocommerce_checkout] o il blocco woocommerce/checkout.<br>Il mio account: ❌ La pagina non contiene lo shortcode [woocommerce_my_account].<br>Termini e condizioni: ❌ La pagina non è impostata Theme<br><br>Name: Hello Elementor Child<br>Version: 2.0.0<br>Author URL: https://elementor.com/<br>Child Theme: ✔<br>Parent Theme Name: Hello Elementor<br>Parent Theme Version: 3.1.1 – 3.2.0 è disponibile<br>Parent Theme Author URL: https://elementor.com/?utm_source=wp-themes&utm_campaign=author-uri&utm_medium=wp-dash<br>WooCommerce Support: ✔ Templates<br><br>Overrides: – Admin<br><br>Enabled Features: activity-panels<br>analytics<br>product-block-editor<br>coupons<br>core-profiler<br>customize-store<br>customer-effort-score-tracks<br>import-products-task<br>experimental-fashion-sample-products<br>shipping-smart-defaults<br>shipping-setting-tour<br>homescreen<br>marketing<br>mobile-app-banner<br>navigation<br>onboarding<br>onboarding-tasks<br>pattern-toolkit-full-composability<br>product-custom-fields<br>remote-inbox-notifications<br>remote-free-extensions<br>payment-gateway-suggestions<br>printful<br>shipping-label-banner<br>subscriptions<br>store-alerts<br>transient-notices<br>woo-mobile-welcome<br>wc-pay-promotion<br>wc-pay-welcome-page<br>launch-your-store<br><br>Disabled Features: product-data-views<br>experimental-blocks<br>minified-js<br>product-pre-publish-modal<br>settings<br>async-product-editor-category-field<br>product-editor-template-system<br>blueprint<br>reactify-classic-payments-settings<br>use-wp-horizon<br><br>Daily Cron: ✔ Next scheduled: 2024-12-16 15:09:51 +00:00<br>Options: ✔<br>Notes: 64<br>Onboarding: completed Action Scheduler<br><br>Completato: 5.078<br>Oldest: 2024-11-21 15:10:01 +0000<br>Newest: 2024-12-16 10:12:33 +0000<br><br>Operazione non riuscita: 16<br>Oldest: 2024-11-21 15:15:52 +0000<br>Newest: 2024-12-15 22:05:04 +0000<br><br>In attesa: 7<br>Oldest: 2024-12-16 22:05:04 +0000<br>Newest: 2024-12-23 14:00:00 +0000 Status report information<br><br>Generated at: 2024-12-16 11:37:19 +00:00<br>

    • enricotv

      (@enricotv)


      Ciao a tutti,

      dopo i due più recenti aggiornamenti di wordpress non mi funziona più un plugin che genera post di una determinata categoria derivante dalla compilazione di moduli di CF7.
      L’ho controllato e ricontrollato eppure niente da fare, con il debug di wordpress mi esce il seguente errore:

      Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function “add_author_support_to_posts” not found or invalid function name in /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-includes/class-wp-hook.php:324

      Stack trace: 0 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 1 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-includes/plugin.php(517): WP_Hook->do_action() 2 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-settings.php(643): do_action() 3 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-config.php(82): require_once(‘…’) 4 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-load.php(50): require_once(‘…’) 5 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-blog-header.php(13): require_once(‘…’) 6 /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/index.php(17): require(‘…’) 7 {main} thrown in /var/www/virtual/mlnv.org/sportelodelsitadino/htdocs/wp-includes/class-wp-hook.php on line 324

      Questo di seguito alla fine è il codice php del plugin, so che è lunghetto ma se qualcuno gentilmente mi aiuta a trovar l’errore gliene sarei molto grato.
      Grazie infinite

      Enrico

      <?php
      
      if (!defined('ABSPATH')) {
          exit;
      }
      
      /**
       * Our main plugin class
       */
      class CF7_To_WP
      {
      
          /**
           * The single instance of cf7_to_wp.
           * @var     object
           */
          private static $_instance = null;
      
          /**
           * Settings class object
           * @var     object
           */
          public $settings = null;
      
          /**
           * The version number.
           * @var     string
           */
          public $_version;
      
          /**
           * The token.
           * @var     string
           */
          public $_token;
      
          /**
           * The main plugin file.
           * @var     string
           */
          public $file;
      
          /**
           * The main plugin directory.
           * @var     string
           */
          public $dir;
      
          /**
           * The plugin assets directory.
           * @var     string
           */
          public $assets_dir;
      
          /**
           * The plugin assets URL.
           * @var     string
           */
          public $assets_url;
      
          /**
           * Our post type slug.
           *
           * @var string
           */
          private $post_type = 'cf7_form_messages';
      
          /**
           * Constructor function.
           * @access  public
           */
          public function __construct($file = '', $version = '0.1')
          {
              $this->_version = $version;
              $this->_token = 'cf7_to_wp';
      
              // Load plugin environment variables
              $this->file = $file;
              $this->dir = dirname($this->file);
              $this->assets_dir = trailingslashit($this->dir) . 'assets';
              $this->assets_url = esc_url(trailingslashit(plugins_url('/assets/', $this->file)));
      
              // Handle localization
              $this->load_plugin_textdomain();
              add_action('init', array($this, 'load_localization'), 0);
          }
      
          /**
           * Initialize all the things!
           */
          public function init()
          {
              // Register Messages post type.
              add_action('init', array($this, 'register_form_msg_post_type'));
              add_filter('add_menu_classes', array($this, 'menu_msg_form_bubble'));
              add_filter('post_row_actions', array($this, 'action_row_for_msg_posts'), 10, 2);
              add_action('admin_init', [$this, 'maybe_mark_form_message_as_read']);
              add_filter('wpcf7_verify_nonce', '__return_true');
      
              // Hook into CF7 actions.
              add_filter('wpcf7_editor_panels', array($this, 'add_cf7_panel'));
              add_action('wpcf7_after_save', array($this, 'save_cf7_data'), 50, 1);
              add_action('wpcf7_mail_sent', array($this, 'create_post_on_form_submission'), 50, 1);
              add_action('wpcf7_mail_failed', array($this, 'create_post_on_form_submission'), 50, 1);
              add_action('init', 'add_author_support_to_posts');
              add_filter('wpcf7_verify_nonce', '__return_true');
          }
      
          /**
           * Load plugin localisation
           */
          public function load_localization()
          {
              load_plugin_textdomain('cf7_to_wp', false, dirname(plugin_basename($this->file)) . '/lang/');
          }
      
          /**
           * Load plugin textdomain
           */
          public function load_plugin_textdomain()
          {
              $domain = 'cf7_to_wp';
              $locale = apply_filters('plugin_locale', get_locale(), $domain);
              load_textdomain($domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo');
              load_plugin_textdomain($domain, false, dirname(plugin_basename($this->file)) . '/lang/');
          }
      
          /**
           * Register our post type to store messages.
           */
          public function register_form_msg_post_type()
          {
              register_post_type(
                  $this->post_type,
                  array(
                      'labels' => array(
                          'name' => __('Pratiche', 'cf7_to_wp'),
                          'singular_name' => __('Pratica', 'cf7_to_wp'),
                          'add_new' => __('Aggiungi nuova', 'cf7_to_wp'),
                          'add_new_item' => __('Aggiungi nuova pratica', 'cf7_to_wp'),
                          'edit' => __('Modifica', 'cf7_to_wp'),
                      ),
                      'description' => 'Pratiche e Servizi',
                      'has_archive' => true,
                      'publicly_queryable' => true,
                      'capability_type' => 'post',
                      'menu_position' => 32,
                      'show_ui' => true,
                      'show_in_menu' => true,
                      'public' => true,
                      'query_var' => true,
                      'menu_icon' => 'dashicons-buddicons-pm',
                      'taxonomies' => array('category'),
                      'supports' => array(
                          'author',
                          'title',
      					'category',
                          'editor',
                          'excerpt',
                          'trackbacks',
                          'page-attributes',
                          'custom-fields',
                          'thumbnail',
                          'sticky',
                      ),
                  )
              );
          }
      
          /**
           * Add bubble to admin menu
           *
           * @param array $menu
           * @return array $menu
           */
          public function menu_msg_form_bubble($menu)
          {
              $form_messages_count = wp_count_posts($this->post_type);
              $pending_count = $form_messages_count->draft + $form_messages_count->pending;
      
              foreach ($menu as $menu_key => $menu_data) {
                  if ("edit.php?post_type={$this->post_type}" !== $menu_data[2]) {
                      continue;
                  }
      
                  $menu[$menu_key][0] .= " <span class='update-plugins count-$pending_count'><span class='plugin-count'>" . number_format_i18n($pending_count) . '</span></span>';
              }
      
              return $menu;
          }
      
          /**
           * Add "Mark as read" action for our post type
           *
           * @param array $actions
           * @param WP_Post $post
           * @return array $actions
           */
          public function action_row_for_msg_posts($actions, $post)
          {
              if ($post->post_type === $this->post_type && $post->post_status !== 'publish') {
                  $actions['mark_as_read'] = sprintf(
                      '<a href="%s" class="aria-button-if-js" aria-label="%s">%s</a>',
                      wp_nonce_url("edit.php?post_type={$this->post_type}&action=mark_as_read&message_id={$post->ID}", "mark_message_as_read_{$post->ID}"),
                      esc_attr(__('Mark as read', 'cf7_to_wp')),
                      __('Mark as read', 'cf7_to_wp')
                  );
              }
      
              return $actions;
          }
      
          /**
           * Mark form message as read
           */
          public function maybe_mark_form_message_as_read()
          {
              if (isset($_GET['action']) && $_GET['action'] == 'mark_as_read' && isset($_GET['message_id'])) {
                  $message_id = (int) $_GET['message_id'];
      
                  if (isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], "mark_message_as_read_{$message_id}")) {
                      $updated_post = wp_update_post(
                          array(
                              'ID' => $message_id,
                              'post_status' => 'publish',
                          )
                      );
      
                      wp_redirect(wp_get_referer());
                      exit();
                  }
              }
          }
      
          /**
           * Add new panel to CF7 form settings
           *
           * @param array $panels
           * @return array
           */
          public function add_cf7_panel($panels)
          {
              $panels['cf7-to-wp'] = array(
                  'title' => __('Salva messaggi', 'cf7_to_wp'),
                  'callback' => array($this, 'cf7_to_wp_form_metabox'),
              );
      
              return $panels;
          }
      
          /**
           * Output the content of our panel/metabox
           *
           * @param WPCF7_ContactForm $post CF7 object
           */
          public function cf7_to_wp_form_metabox($post)
          {
              $id = $post->id();
              $cf7towp = get_post_meta($id, '_cf7towp', true);
              $cf7towp = wp_parse_args(
                  $cf7towp,
                  array(
                      'active' => 0,
                      'title' => '',
                      'content' => '',
                      'category' => 0,
                  )
              );?>
      
      		<p style="margin-bottom:1em; font-size:1.25em;">
      			<?php _e('Abilitando la casella sottostante ogni modulo inviato compilato verrà pubblicato come nuovo articolo "Pratiche" privato.', 'cf7_to_wp');?>
      		</p>
      
      		<div class="mail-field" style="margin-bottom:1em;">
      			<label for="cf7towp-active">
      				<input type="checkbox" id="cf7towp-active" name="wpcf7-cf7towp-active" value="1" <?php checked($cf7towp['active'], 1);?> />
      				<strong><?php echo esc_html(__('Salvare i moduli compilati come articoli "Pratiche"?', 'cf7_to_wp')); ?></strong>
      			</label>
      
      		</div>
      
      		<div class="pseudo-hr"></div>
      
      		<div class="mail-field">
      			<p class="description">
      				<label for="cf7towp-category"><?php echo esc_html(__('Categoria dell\'articolo', 'cf7_to_wp')); ?></label>
      				<select id="cf7towp-category" name="wpcf7-cf7towp-category">
      					<?php $this->get_category_options($id)?>
      				</select>
      			</p>
      		</div>
      
      		<div class="mail-field">
      			<p class="description">
      				<label for="cf7towp-title"><?php echo esc_html(__('Titolo dell\'articolo', 'cf7_to_wp')); ?></label>
      				<input type="text" id="cf7towp-title" name="wpcf7-cf7towp-title" class="large-text" value="<?php echo esc_attr($cf7towp['title']); ?>" />
      			</p>
      		</div>
      
      		<div class="mail-field">
      			<p class="description">
      				<label for="cf7towp-content"><?php echo esc_html(__('Contenuto dell\'articolo', 'cf7_to_wp')); ?></label>
      				<textarea id="cf7towp-content" name="wpcf7-cf7towp-content" cols="100" rows="10" class="large-text"><?php echo esc_attr($cf7towp['content']); ?></textarea>
      			</p>
      		</div>
      
      		<hr>
      
      		<p class="description" style="margin-top:.5em;">
      			<span style="float:left; width:60%;">
      				<?php _e('Usa i classici CF7 [mail-tag] per i contenuti dinamici nel titolo e nel contenuto (li trovi sulla tab Mail).', 'cf7_to_wp');?>
      			</span>
      			<span style="text-align:right; float:right; width:40%;">
      				<?php
      $credits_link = '<a target="_blank" href="https://github.com/psaikali/contact-form-to-wp-posts">Fonte</a>';
              printf(__('A Contact Form 7 addon by %1$s', 'cf7_to_wp'), $credits_link);
              ?>
      			</span>
      		</p>
      
      		<hr>
      	<?php }
      
          /**
           * Get category field data
           */
      
          public function get_category_options($id)
          {
      
              $cf7towp = get_post_meta($id, '_cf7towp', true);
              $cf7towp = wp_parse_args(
                  $cf7towp,
                  array(
                      'active' => 0,
                      'title' => '',
                      'content' => '',
                      'category' => 0,
                  )
              );
      
              $args = array(
                  'taxonomy' => 'category',
                  'hide_empty' => false,
              );
      
              $terms = get_terms($args);
      
              foreach ($terms as $term) {
                  $options .= '<option value="' . $term->term_id . '" ' . selected($cf7towp['category'], $term->term_id, true) . '>' . $term->name . '</option>';
              }
      
              echo $options;
      
          }
      
          /**
           * Save metabox/tab data when CF7 form settings page is saved.
           *
           * @param WPCF7_ContactForm $contact_form
           */
          public function save_cf7_data($contact_form)
          {
              global $user_id;
              $user_id = get_current_user_id();
              $id = $contact_form->id();
              $cf7towp = array();
              $cf7towp['active'] = (!empty($_POST['wpcf7-cf7towp-active']));
      
              if (isset($_POST['wpcf7-cf7towp-title'])) {
                  $cf7towp['title'] = sanitize_text_field($_POST['wpcf7-cf7towp-title']);
              }
      
              if (isset($_POST['wpcf7-cf7towp-content'])) {
                  $cf7towp['content'] = wp_kses_post($_POST['wpcf7-cf7towp-content']);
              }
      
              if (isset($_POST['wpcf7-cf7towp-category'])) {
                  $cf7towp['category'] = wp_kses_post($_POST['wpcf7-cf7towp-category']);
              }
      
              update_post_meta($id, '_cf7towp', $cf7towp);
          }
      
          /**
           * Create a Messages post when form is submitted
           *
           * @param WPCF7_ContactForm $contact_form
           */
      
          public function get_current_user_id()
          {
              if (class_exists('Jwt_Auth_Public')) {
                  $jwt = new \Jwt_Auth_Public('jwt-auth', '1.1.0');
                  $token = $jwt->validate_token(false);
                  if (\is_wp_error($token)) {
                      return false;
                  }
      
                  return $token->data->user->id;
              } else {
                  return false;
              }
          }
      
          public function create_post_on_form_submission($contact_form)
          {
      
              $form_post = $contact_form->id();
              $cf7towp_data = get_post_meta($form_post, '_cf7towp', true);
      
              if ($cf7towp_data['active'] === true) {
                  $submission = WPCF7_Submission::get_instance();
      
                  if ($submission) {
                      $meta = array();
                      $meta['ip'] = $submission->get_meta('remote_ip');
                      $meta['ua'] = $submission->get_meta('user_agent');
                      $meta['url'] = $submission->get_meta('url');
                      $meta['date'] = date_i18n(get_option('date_format'), $submission->get_meta('timestamp'));
                      $meta['time'] = date_i18n(get_option('time_format'), $submission->get_meta('timestamp'));
                  }
      
                  $post_title_template = $cf7towp_data['title'];
                  $post_content_template = $cf7towp_data['content'];
                  $post_category[] = $cf7towp_data['category'];
      
                  $post_title = wpcf7_mail_replace_tags(
                      $post_title_template,
                      array(
                          'html' => true,
                          'exclude_blank' => true,
                          'has_archive' => true,
                      )
                  );
      
                  $post_content = wpcf7_mail_replace_tags(
                      $post_content_template,
                      array(
                          'html' => true,
                          'exclude_blank' => true,
                          'has_archive' => true,
                      )
                  );
      
                  $new_form_msg = wp_insert_post(
      
                      array(
                          'post_type' => $this->post_type,
                          'post_title' => $post_title,
                          'post_content' => $post_content,
                          'post_author' => $current_user -> ID,
                          'post_status' => 'private',
                          'has_archive' => true,
                          'post_category' => $post_category,
                      )
                  );
      
                  if ($submission) {
                      update_post_meta($new_form_msg, 'cf7towp_meta', $meta, );
                  }
              }
          }
      
          /**
           * Main cf7_to_wp singleton instance
           *
           * Ensures only one instance of cf7_to_wp is loaded or can be loaded.
           *
           * @static
           * @see cf7_to_wp()
           * @return Main cf7_to_wp instance
           */
          public static function instance($file = '', $version = '0.1')
          {
              if (is_null(self::$_instance)) {
                  self::$_instance = new self($file, $version);
              }
              return self::$_instance;
          }
      
          /**
           * Cloning is forbidden.
           *
           */
          public function __clone()
          {
              _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?'), $this->_version);
          }
      
          /**
           * Unserializing instances of this class is forbidden.
           *
           */
          public function __wakeup()
          {
              _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?'), $this->_version);
          }
      }

    Hi @lsantaniello ,
    I don’t think WordPress has a feature to show alerts – but you can try to customize native javascript alerts following this tutorial:
    https://css-tricks.com/replace-javascript-dialogs-html-dialog-element/

    • I developed my custom plugin. I’d like to show simple alert but I don’t want to use native javascript alert. Is present in wordpress some feature to show the alert? I tried to import bootbox library but it is not compatible. It required bootstrap and jquery ($) and crashes.

      Support me please

    • Salve,
      ho un problema di aggiornamento che non riesco a risolvere.
      Sto cercando di aggiornare una inztallazione multisito portando la versione 5.8.6 a 6.1.1 ….. Spero che possiate mettermi sulla buona strada
      ——————————-
      Premetto che nel server ho altre installazioni e che ho appena portato a buon fine un’altro aggiornamento di un wirdpress multisito dalla 5.8 alla 6,1,1

      La versione del php è la 8.0

      tutti i plugin del network sono aggiornati e (pensando a possibili conflitti) li ho disattivati
      —————————————
      Quando provo ad aggiornare, questo è il risultato:

      Download dell'aggiornamento da https://downloads.wordpress.org/release/it_IT/wordpress-6.1.1.zip…
      
      L'autenticità di wordpress-6.1.1.zip non può essere verificata dato che non è stata trovata alcuna firma.
      
      Estrazione dell’aggiornamento in corso…
      
      Verifica dei file estratti in corso…
      
      Preparazione all’installazione dell'ultima versione in corso…
      
      The update cannot be installed because your site is unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/options-reading.php, wp-admin/edit-tags.php, wp-admin/link-manager.php, wp-admin/options-writing.php, wp-admin/widgets-form-blocks.php, wp-admin/my-sites.php, wp-admin/async-upload.php, wp-admin/link.php, wp-admin/privacy.php, wp-admin/options-general.php, wp-admin/comment.php, wp-admin/theme-editor.php, wp-admin/admin-ajax.php, wp-admin/update.php, wp-admin/install.php, wp-admin/erase-personal-data.php, wp-admin/plugin-editor.php, wp-admin/nav-menus.php, wp-admin/customize.php, wp-admin/update-core.php, wp-admin/options-permalink.php, wp-admin/site-health-info.php, wp-admin/freedoms.php, wp-admin/user-new.php, wp-admin/menu-header.php, wp-admin/index.php, wp-admin/link-add.php, wp-admin/plugins.php, wp-admin/post.php, wp-admin/themes.php, wp-admin/edit-comments.php, wp-admin/term.php, wp-admin/media.php, wp-admin/revision.php, wp-admin/admin.php, wp-admin/upload.php, wp-admin/edit-form-advanced.php, wp-admin/options.php, wp-admin/privacy-policy-guide.php, wp-admin/tools.php, wp-admin/import.php, wp-admin/widgets.php, wp-admin/options-media.php, wp-admin/edit-link-form.php, wp-admin/about.php, wp-admin/admin-post.php, wp-admin/theme-install.php, wp-admin/options-discussion.php, wp-admin/install-helper.php, wp-admin/site-health.php, wp-admin/edit-form-comment.php, wp-admin/authorize-application.php, wp-admin/export.php, wp-admin/load-scripts.php, wp-admin/load-styles.php, wp-admin/export-personal-data.php, wp-admin/admin-header.php, wp-admin/options-privacy.php
      
      Installazione fallita.

      —————–
      Ho controllato i permessi ma mi sembrano tutti a posto (del resto gli aggiornamenti hanno sempre funzionato da dieci anni)

      La pagina su cui ho bisogno di aiuto: [devi essere connesso per vedere il link]

    • Quando il cliente cerca di finalizzare il pagamento attraverso carta di credito, quindi dopo aver inserito tutti i dati gi appare questo messaggio che gli impedisce di proseguire con l’acquisto bloccando l’operazione.
      Questo è il messaggio che appare:
      “ITEM_TOTAL_MISMATCH Should equal sum of (unit_amount*quantity) across all items for a given purcase_unit.”

      Questo è il report di sistema del sito`
      ### WordPress Environment ###

      WordPress address (URL): https://www.ciminadolciaria.com
      Site address (URL): https://www.ciminadolciaria.com
      WC Version: 6.6.1
      REST API Version: ✔ 6.6.1
      WC Blocks Version: ✔ 7.6.2
      Action Scheduler Version: ✔ 3.4.0
      Log Directory Writable: ✔
      WP Version: ❌ 5.9.3 – È disponibile una versione più recente di WordPress (6.0.1)
      WP Multisite: –
      WP Memory Limit: 1 GB
      WP Debug Mode: –
      WP Cron: ✔
      Language: it_IT
      External object cache: –

      ### Server Environment ###

      Server Info: Apache
      PHP Version: 7.4.30
      PHP Post Max Size: 150 MB
      PHP Time Limit: 300
      PHP Max Input Vars: 12000
      cURL Version: 7.83.1
      OpenSSL/1.1.1o

      SUHOSIN Installed: –
      MySQL Version: 5.7.38-log
      Max Upload Size: 150 MB
      Default Timezone is UTC: ✔
      fsockopen/cURL: ✔
      SoapClient: ✔
      DOMDocument: ✔
      GZip: ✔
      Multibyte String: ✔
      Remote Post: ✔
      Remote Get: ✔

      ### Database ###

      WC Database Version: 6.6.1
      WC Database Prefix: wp_
      Dimensione totale database: 58.88MB
      Dimensione dati database: 47.10MB
      Dimensione indice database: 11.78MB
      wp_woocommerce_sessions: Dati: 0.09MB + indice: 0.02MB + motore InnoDB
      wp_woocommerce_api_keys: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_woocommerce_attribute_taxonomies: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_woocommerce_downloadable_product_permissions: Dati: 0.02MB + indice: 0.06MB + motore InnoDB
      wp_woocommerce_order_items: Dati: 0.17MB + indice: 0.08MB + motore InnoDB
      wp_woocommerce_order_itemmeta: Dati: 1.52MB + indice: 1.92MB + motore InnoDB
      wp_woocommerce_tax_rates: Dati: 0.02MB + indice: 0.06MB + motore InnoDB
      wp_woocommerce_tax_rate_locations: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_woocommerce_shipping_zones: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_woocommerce_shipping_zone_locations: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_woocommerce_shipping_zone_methods: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_woocommerce_payment_tokens: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_woocommerce_payment_tokenmeta: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_woocommerce_log: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_actionscheduler_actions: Dati: 1.02MB + indice: 0.16MB + motore InnoDB
      wp_actionscheduler_claims: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_actionscheduler_groups: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_actionscheduler_logs: Dati: 0.52MB + indice: 0.42MB + motore InnoDB
      wp_aioseo_cache: Dati: 0.16MB + indice: 0.03MB + motore InnoDB
      wp_aioseo_notifications: Dati: 0.02MB + indice: 0.06MB + motore InnoDB
      wp_aioseo_posts: Dati: 0.09MB + indice: 0.02MB + motore InnoDB
      wp_cmplz_cookiebanners: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_cmplz_cookies: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_cmplz_dnsmpd: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_cmplz_services: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_cmplz_statistics: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_commentmeta: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_comments: Dati: 0.16MB + indice: 0.09MB + motore InnoDB
      wp_e_events: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_links: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_options: Dati: 6.22MB + indice: 0.16MB + motore InnoDB
      wp_postmeta: Dati: 9.52MB + indice: 4.03MB + motore InnoDB
      wp_posts: Dati: 2.52MB + indice: 0.33MB + motore InnoDB
      wp_revslider_css: Dati: 0.13MB + indice: 0.00MB + motore InnoDB
      wp_revslider_css_bkp: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_revslider_layer_animations: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_revslider_layer_animations_bkp: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_revslider_navigations: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_revslider_navigations_bkp: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_revslider_sliders: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_revslider_sliders_bkp: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_revslider_slides: Dati: 0.11MB + indice: 0.00MB + motore InnoDB
      wp_revslider_slides_bkp: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_revslider_static_slides: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_revslider_static_slides_bkp: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_sbi_feeds: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_sbi_feed_caches: Dati: 0.14MB + indice: 0.02MB + motore InnoDB
      wp_sbi_instagram_feeds_posts: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_sbi_instagram_feed_locator: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_sbi_instagram_posts: Dati: 0.11MB + indice: 0.00MB + motore InnoDB
      wp_sbi_sources: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_termmeta: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_terms: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_term_relationships: Dati: 0.06MB + indice: 0.02MB + motore InnoDB
      wp_term_taxonomy: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_usermeta: Dati: 1.52MB + indice: 2.02MB + motore InnoDB
      wp_users: Dati: 0.08MB + indice: 0.05MB + motore InnoDB
      wp_wcpdf_invoice_number: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wcpdf_packing_slip_number: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wc_admin_notes: Dati: 0.08MB + indice: 0.00MB + motore InnoDB
      wp_wc_admin_note_actions: Dati: 0.05MB + indice: 0.02MB + motore InnoDB
      wp_wc_category_lookup: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wc_customer_lookup: Dati: 0.06MB + indice: 0.03MB + motore InnoDB
      wp_wc_download_log: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_wc_order_coupon_lookup: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_wc_order_product_lookup: Dati: 0.16MB + indice: 0.19MB + motore InnoDB
      wp_wc_order_stats: Dati: 0.06MB + indice: 0.05MB + motore InnoDB
      wp_wc_order_tax_lookup: Dati: 0.06MB + indice: 0.03MB + motore InnoDB
      wp_wc_product_attributes_lookup: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_wc_product_download_directories: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_wc_product_meta_lookup: Dati: 0.06MB + indice: 0.09MB + motore InnoDB
      wp_wc_rate_limits: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_wc_reserved_stock: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wc_tax_rate_classes: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_wc_webhooks: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_wfblockediplog: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wfblocks7: Dati: 0.02MB + indice: 0.05MB + motore InnoDB
      wp_wfconfig: Dati: 0.48MB + indice: 0.00MB + motore InnoDB
      wp_wfcrawlers: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wffilechanges: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wffilemods: Dati: 11.52MB + indice: 0.00MB + motore InnoDB
      wp_wfhits: Dati: 1.33MB + indice: 0.09MB + motore InnoDB
      wp_wfhoover: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_wfissues: Dati: 0.06MB + indice: 0.06MB + motore InnoDB
      wp_wfknownfilelist: Dati: 5.52MB + indice: 0.00MB + motore InnoDB
      wp_wflivetraffichuman: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_wflocs: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wflogins: Dati: 0.28MB + indice: 0.13MB + motore InnoDB
      wp_wfls_2fa_secrets: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_wfls_settings: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wfnotifications: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wfpendingissues: Dati: 0.02MB + indice: 0.06MB + motore InnoDB
      wp_wfreversecache: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wfsnipcache: Dati: 0.02MB + indice: 0.05MB + motore InnoDB
      wp_wfstatus: Dati: 0.13MB + indice: 0.11MB + motore InnoDB
      wp_wftrafficrates: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_wpfm_backup: Dati: 0.02MB + indice: 0.00MB + motore InnoDB
      wp_yith_wcwl: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_yith_wcwl_lists: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_yoast_indexable: Dati: 1.50MB + indice: 0.27MB + motore InnoDB
      wp_yoast_indexable_hierarchy: Dati: 0.06MB + indice: 0.05MB + motore InnoDB
      wp_yoast_migrations: Dati: 0.02MB + indice: 0.02MB + motore InnoDB
      wp_yoast_primary_term: Dati: 0.02MB + indice: 0.03MB + motore InnoDB
      wp_yoast_seo_links: Dati: 0.17MB + indice: 0.14MB + motore InnoDB

      ### Post Type Counts ###

      attachment: 309
      custom_css: 1
      dflip: 3
      elementor_font: 1
      elementor_icons: 1
      elementor_library: 4
      mc4wp-form: 1
      nav_menu_item: 146
      oembed_cache: 1
      ovic_footer: 1
      ovic_menu: 6
      page: 23
      post: 1
      product: 140
      product_variation: 44
      revision: 373
      shop_coupon: 5
      shop_order: 323
      shop_order_refund: 1
      viwec_template: 15
      wpcf7_contact_form: 4
      wp_global_styles: 1

      ### Security ###

      Secure connection (HTTPS): ✔
      Hide errors from visitors: ✔

      ### Active Plugins (32) ###

      3D FlipBook : Dflip Lite: by DearHive – 1.7.31
      FiboSearch – AJAX Search for WooCommerce: by FiboSearch Team – 1.18.1
      Akismet Anti-Spam: by Automattic – 4.2.4
      Click to Chat: by HoliThemes – 3.9.10
      Complianz Privacy Suite (GDPR/CCPA) premium: by Really Simple Plugins – 6.2.4
      Contact Form 7: by Takayuki Miyoshi – 5.6
      Elementor Pro: by Elementor.com – 3.1.0
      Elementor: by Elementor.com – 3.6.7
      Email Template Customizer for WooCommerce: by VillaTheme – 1.1.10
      Smash Balloon Instagram Feed: by Smash Balloon – 6.0.6
      Jetpack: by Automattic – 11.1
      Loco Translate: by Tim Whitlock – 2.6.2
      Ovic Addon Toolkit: by Ovic Team – 2.5.5
      Ovic: Import Demo: by Ovic Team – 1.5.9
      Ovic: Product Bundle: by Ovic Team – 1.1.1
      PW WooCommerce Bulk Edit: by Pimwick
      LLC – 2.103

      Slider Revolution: by ThemePunch – 6.2.23
      WooCommerce Smart COD: by woosmartcod.com – 1.6.1
      WebP Express: by Bjørn Rosell – 0.25.5
      Advanced Order Export For WooCommerce: by AlgolPlus – 3.3.1
      Variation Swatches for WooCommerce: by RadiusTheme – 2.1.1.8
      WooCommerce Satispay: by Satispay – 2.0.0
      WooCommerce PayPal Payments: by WooCommerce – 1.9.0
      WooCommerce PDF Invoices & Packing Slips: by WP Overnight – 3.0.0
      WooCommerce: by Automattic – 6.6.1 (aggiornamento alla versione 6.7.0 disponibile)
      Wordfence Security: by Wordfence – 7.5.11
      Yoast SEO: by Team Yoast – 19.2
      WP Fastest Cache: by Emre Vona – 1.0.2
      Gestore di file WP: by mndpsingh287 – 7.1.6
      YITH WooCommerce Compare: by YITH – 2.15.0
      YITH WooCommerce Quick View: by YITH – 1.17.0
      YITH WooCommerce Wishlist: by YITH – 3.10.0

      ### Inactive Plugins (0) ###

      ### Must Use Plugins (1) ###

      WordPress automation by Installatron: by –

      ### Settings ###

      API Enabled: ✔
      Force SSL: –
      Currency: EUR (€)
      Currency Position: left
      Thousand Separator: ,
      Decimal Separator: .
      Number of Decimals: 2
      Taxonomies: Product Types: external (external)
      grouped (grouped)
      simple (simple)
      variable (variable)

      Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
      exclude-from-search (exclude-from-search)
      featured (featured)
      outofstock (outofstock)
      rated-1 (rated-1)
      rated-2 (rated-2)
      rated-3 (rated-3)
      rated-4 (rated-4)
      rated-5 (rated-5)

      Connected to WooCommerce.com: –
      Enforce Approved Product Download Directories: –

      ### WC Pages ###

      Shop base: #11278 – /shop/
      Carrello: #11279 – /cart/
      Pagamento: #11280 – /checkout/
      Il mio account: #11 – /my-account/
      Termini e condizioni: ❌ La pagina non è impostata

      ### Theme ###

      Name: Armania Child
      Version: 1.1.5.1601989261
      Author URL: https://kutethemes.com/
      Child Theme: ✔
      Parent Theme Name: Armania
      Parent Theme Version: 1.2.2
      Parent Theme Author URL: https://kutethemes.com/
      WooCommerce Support: ✔

      ### Templates ###

      Overrides: armania/woocommerce/cart/cross-sells.php
      armania/woocommerce/content-product.php
      armania/woocommerce/content-single-product.php
      armania/woocommerce/global/quantity-input.php
      armania/woocommerce/global/wrapper-end.php
      armania/woocommerce/global/wrapper-start.php
      armania/woocommerce/loop/add-to-cart.php
      armania/woocommerce/loop/loop-end.php
      armania/woocommerce/loop/loop-start.php
      armania/woocommerce/loop/pagination.php
      armania/woocommerce/loop/sale-flash.php
      armania/woocommerce/single-product/meta.php
      armania/woocommerce/single-product/related.php
      armania/woocommerce/single-product/stock.php
      armania/woocommerce/single-product/tabs/tabs.php
      armania/woocommerce/single-product/up-sells.php

      ### WooCommerce PayPal Payments ###

      Onboarded: ✔
      Shop country code: IT
      WooCommerce currency supported: ✔
      PayPal card processing available in country: ✔
      Pay Later messaging available in country: ✔
      Webhook status: –
      Vault enabled: ✔
      Logging enabled: –
      Reference Transactions: –
      Used PayPal Checkout plugin: ✔

      ### Admin ###

      Enabled Features: activity-panels
      analytics
      coupons
      customer-effort-score-tracks
      experimental-products-task
      experimental-import-products-task
      experimental-fashion-sample-products
      homescreen
      marketing
      mobile-app-banner
      navigation
      onboarding
      onboarding-tasks
      remote-inbox-notifications
      remote-free-extensions
      payment-gateway-suggestions
      shipping-label-banner
      subscriptions
      store-alerts
      transient-notices
      wc-pay-promotion
      wc-pay-welcome-page
      wc-pay-subscriptions-page

      Disabled Features: minified-js
      settings

      Daily Cron: ✔ Next scheduled: 2022-07-15 12:41:38 +00:00
      Options: ✔
      Notes: 93
      Onboarding: completed

      ### Action Scheduler ###

      Completato: 261
      Oldest: 2022-06-14 07:43:52 +0000
      Newest: 2022-07-14 12:40:40 +0000

      In attesa: 1
      Oldest: 2022-07-15 10:15:32 +0000
      Newest: 2022-07-15 10:15:32 +0000

      ### Status report information ###

      Generated at: 2022-07-14 13:31:08 +00:00
      `

    • Ho creato un plugin custom per ospitare gli endpoint per la creazione di un processo di registrazione custom utilizzando dei tool di frontend come vue.js

      Il plugin l’ho creato nella cartella wp-content/plugin/custom-api-memofly, l’ultima cartella l’ho creata io per ospitare lo script del mio plugin.

      il codice contenuto nel mio script è il segunete:

      <?php
      
      /**
      
       *Plugin Name: Custom API per Memofly
      
       *Plugin URI: https://memofly.it
      
       *Description: Plugin che tiene in piedi tutte le interazioni con il lato WordPress di Memofly verso altri moduli del sito
       *             Es. le richieste di login e registrazione
      
       *Version: 1.0
      
       * Author: Mirco Serra (Flyip)
      
       *Author URI:  https://www.flyip.it/
      
       */
      
      add_action('rest-api-init', function (){
          register_rest_route('custom/v1', '/register',array(
              'methods' => 'POST',
              'callback' => 'api_register_new_user',
              'permission_callback' => function () {
                  return true;
              }
          ));
      });
      
      function api_register_new_user(WP_REST_Request $request): object
      {
          $response = (object)[] ;
          $body = $request.get_body();
          $body = json_encode($body);
          $user = register_new_user(body['username'],$body['password']);
          if(! is_wp_error($user)){
              $response->status = 200;
              $response->message = "OK";
              $response->data->user_id = $user;
          }else{
              $response->status = 501;
              $response->message = $user;
              $response->data->user_id = "";
          }
          return $response;
      }

      Lo script non registra nessun endpoint in quanto quando vado a chiamarlo “https://memofly.it/wp-json/custom/v1/register&#8221; mi risponde con il seguente errore

      {
          "code": "rest_no_route",
          "message": "Nessun percorso fornisce una corrispondenza tra l'URL ed il metodo richiesto.",
          "data": {
              "status": 404
          }
      }

      La pagina su cui ho bisogno di aiuto: [devi essere connesso per vedere il link]

    @matteospi

    ho lavorato a molte integrazioni crm->ecommerce (sono uno sviluppatore e sistemista e programmo da più 20 anni).
    Non so se anche tu hai questa esperienza.
    Purtroppo non sempre (anzi raramente) è possibile trovare un plugin che permetta di transitare i dati in coerenza con le necessità del proprietario dell’ecommerce (questo perchè c’è un’enorme variabilità nella topologia delle informazioni contenute nei vari datbase e perchè i CRM di destinazione anch’essi molti e soggetti ad updates).
    Inoltre, installare plugin un po’ a caso rischia di rendere fragile o addirittura vulnerabile il negozio on line, quindi prima di consigliare un plugin è bene conoscerne i limiti.
    Per quel che rigurda SAP conosco questo servizio di integrazione ([ Rimosso perchè prodotto commerciale] ) ma non so se sia quello che @aley2k chiedeva, inoltre questo sistema ha dei costi penso ricorrenti.
    Quindi, ribadisco, il metodo migliore è realizzare o acquistare uno script configurabile che esporti i dati necessari nel formato giusto.
    Questo è un exporter ([ Rimosso perchè prodotto commerciale] ) ma bisognerebbe capire esattamente se esporta tutti i campi richiesti.
    In alternativa si può partire anche da questo script ed adattarlo alle necessità : https://github.com/lafranceinsoumise/woocommerce-customer-order-csv-export

    Ciao @federicogb25,

    non è semplice dare una risposta non potendo “mettere le mani” sul problema, ma sto cercando di farmi un’idea.

    Inizio con qualche domanda banale:
    – la versione di PHP sul nuovo server è la stessa del vecchio server?
    – le impostazioni sui rispettivi php.ini sono uguali?
    – WordPress, temi e plugin sono tutti aggiornati?
    – quando dici che hai disabilitato plugin e temi intendi che ne hai rinominato fisicamente le cartelle per non farli “vedere” a WordPress?

    In sostanza c’è qualcosa che sta usando la funzione register_rest_route() in modo errato per estendere le REST-API di WordPress. Gli errori javascript che vedi potrebbero essere conseguenza della mancanza degli endpoint custom che non vengono creati per l’errore precedente.

    Se fai in modo che WP non veda più nè il tema nè i plugin, in teoria l’errore dovrebbe momentaneamente sparire. A quel punto si può procedere con la riattivazione progressiva di tutti gli elementi, fino ad individuare il colpevole.

    Quella funzione può essere utilizzata nei plugin oppure nel file functions.php del tema (potresti dare un’occhiata nel tema che stavi utilizzando).

    Resta comunque il mistero del perchè il problema si presenti solo sul nuovo server. Se l’errore è realmente sulla chiamata a quella funzione, doveva esserci già prima. Potrebbe essere apparso solo ora per qualche aggiornamento in WordPress o PHP del nuovo server.

    Facci sapere.
    Ciao.

    Chi ha creato la discussione danix14

    (@danix14)

    Ciao giuriani, si in effetti è risolvibile dalla dashboard di wordpress e poi andando sulle impostazioni del tema.

    Riporto qui un breve guida se dovesse servire (tema Traveltour di Goodlayers).

    Dashoboard -> Goodlayers -> Miscellaneous -> Custom Css/Js -> Additional Head Script ( without <script> tag ) ->

    window.onload = function () {
    var signupButton = document.querySelectorAll(“[data-tmlb=’signup’]”)[0];
    var newSignupButton = signupButton.cloneNode(true);
    signupButton.parentNode.replaceChild(newSignupButton, signupButton);
    newSignupButton.addEventListener(“click”, function(e) {
    e.stopPropagation();
    window.location.replace(“/noleggio-barche-conto-iscrizione/boat-rent/”);

    sostituire nell’ultimo rigo la descrizione della pagina che si vuol impostare.

    • Salve a tutti,
      sto creando una web app creando dei custom template e avrei bisogno di creare un form con le select concatenate però ho qualche problemino.
      La struttura è la seguente: page-template.php e function.php.
      Nella page-template ho gia creato il form con la prima select che mi tira giu i dati dal database, ora dovrei fare una seconda select che in base a quello che scelgo nella prima mi fa una query differente e mi da scelte diverse; ho gia fatto con la programmazione php senza cms lo stesso discorso utilizzando JQuery e AJAX.
      Su wordpress ho il problema che non riesco a capire cosa mettere nel file function.php e dove mettere lo script che mi prende la variabile e la riporta sulla page-template.php.
      O magari se ci fosse un altro sistema senza JQuery, ovviamente senza installare dei plugin aggiuntivi.
      Grazie.

    Ciao @aldobz ,
    conosco passabilmente Joomla e negli ultimi mesi ho fatto anche una certa familiarità con WordPress.
    I due cms sono molto diversi tra loro e bisogna armarsi con un pochino di pazienza per adoperarli al meglio. Penso.
    Comunque ci sono alcune differenze che vengono all’occhio subito: WordPress è mediamente più veloce di Joomla perché è più snello, ha una struttura più leggera.
    Nella pagina amministrativa c’è integrato un editor css di grande utilità. Joomla richiede un apposito file custom.css per fare la stessa cosa.
    L’editor a blocchi che ti lascia disorientato è una novità e permette una grande flessibilità nella stesura dell’articolo. Si può inserire facilmente html e anche javascript.
    Credo che anche Joomla si muoverà nella stessa direzione tra un po’.
    L’offerta di plugin di wordpress è significativamente più grande di quella di joomla.

    Chi ha creato la discussione mozza85

    (@mozza85)

    Ciao,
    ho provato a installare il plugin Health Check.

    Da questo check si può individuare qualche causa?

    ### WordPress ###

    Versione: 4.9.8
    Lingua: it_IT
    Struttura dei permalink: /%postname%/
    Questo sito utilizza HTTPS?: Sì
    Chiunque può registrarsi su questo sito?: No
    Stato predefinito per i commenti: open
    Questo è un multisito?: No
    Conteggio degli utenti: 1
    Comunicazione con WordPress.org: WordPress.org è raggiungibile
    Crea richieste di loopback: La richiesta di loopback al tuo sito è stata completata correttamente.

    ### Installation size ###

    Uploads Directory: 41,74 MB
    Themes Directory: 32,80 MB
    Plugins Directory: 72,44 MB
    Database size: 5,04 MB
    Whole WordPress Directory: 199,37 MB
    Total installation size: 204,41 MB

    ### Active Theme ###

    Nome: Divi-child
    Versione: 0.1.0
    Autore: Qui il vostro nome
    Sito web dell’autore: http://example.com/about/
    Tema genitore: Divi
    Funzioni del tema supportate: post-thumbnails, custom-background, automatic-feed-links, menus, title-tag, post-formats, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, customize-selective-refresh-widgets, editor-style, widgets

    ### Altri temi (1) ###

    Divi (Divi): Versione 3.15 di Elegant Themes ( Latest version: 3.17.2 )

    ### È necessario utilizzare i plugin (1) ###

    Health Check Troubleshooting Mode: Versione 1.5.0

    ### Plugin attivi (11) ###

    Coming Soon Page & Maintenance Mode by SeedProd: Versione 5.0.20 di SeedProd
    Divi Booster: Versione 2.7.9 di Dan Mossop
    Divi Builder: Versione 2.15 di Elegant Themes ( Latest version: 2.17.2 )
    Health Check & Troubleshooting: Versione 1.2.1 di The WordPress.org community
    Menu Icons: Versione 0.11.2 di ThemeIsle
    Really Simple SSL: Versione 3.1.1 di Rogier Lankhorst, Mark Wolters
    Regenerate Thumbnails: Versione 3.0.2 di Alex Mills (Viper007Bond)
    WC Product Builder For Divi: Versione 1.4.0 di AbdElfatah AboElgit
    WooCommerce: Versione 3.4.7 di Automattic
    WooCommerce Social Media Share Buttons: Versione 1.3.0 di Toastie Studio
    Yoast SEO: Versione 8.4 di Team Yoast

    ### Plugin disattivati (2) ###

    W3 Total Cache: Versione 0.9.7 di Frederick Townes

    ### Gestione media ###

    Editor attivo: WP_Image_Editor_GD
    Versione Modulo Imagick: Imagick not available
    Versione di ImageMagick: Imagick not available
    Versione di GD: bundled (2.1.0 compatible)
    Versione di Ghostscript: 8.70

    ### Server ###

    Architettura del server: Linux 2.6.32-773.26.1.lve1.4.43.el6.x86_64 x86_64
    Versione PHP: 5.6.37 (Supporta valori a 64bit)
    PHP SAPI: litespeed
    Variabile PHP max input: 1000
    Limite di tempo PHP: 400
    Limite di memoria PHP: 256M
    Max input time: -1
    Dimensione massima di upload dei file: 128M
    Dimensione massima del post PHP: 128M
    Versione cURL: 7.60.0 OpenSSL/1.0.2k
    SUHOSIN installato: No
    È disponibile la libreria Imagick: No
    htaccess rules: Custom rules have been added to your htaccess file

    ### Database ###

    Estensione: mysqli
    Versione del server: 5.6.36-cll-lve
    Versione del client: 5.6.40

    Chi ha creato la discussione specialworld83

    (@specialworld83)

    Buongiorno, ecco la lista dei plugin che uso sul mio portale, il tema è magbook. Tra l’altro ho cambiato con la skin attuale immaginando fosse un problema di skin grafica. Ho disabilitato adblok per consentirvi di visualizzare il sito.

    AddToAny Share Buttons
    Impostazioni | Disattiva
    I pulsanti di condivisione per le tue pagine, includono il pulsante di AddToAny di condivisione universale, Facebook, Twitter, Google+, Pinterest, WhatsApp e molti altri.
    
    Versione 1.7.28 | Di AddToAny | Visualizza i dettagli
    Seleziona Advanced Ads	
    Advanced Ads
    Componenti aggiuntivi | Supporto | Disattiva
    Gestisci e ottimizza i tuoi annunci in WordPress
    
    Versione 1.10.4 | Di Thomas Maier | Visualizza i dettagli
    Seleziona Akismet Anti-Spam	
    Akismet Anti-Spam
    Impostazioni | Disattiva
    Usato da milioni di persone, Akismet è probabilmente il miglior modo al mondo di proteggere il tuo blog dallo spam. Protegge il tuo sito anche mentre dormi. Per iniziare vai alla pagina delle Impostazioni di Akismet per impostare la tua chiave API.
    
    Versione 4.0.8 | Di Automattic | Visualizza i dettagli
    Seleziona Alligator Popup	
    Alligator Popup
    Disattiva
    Shortcode to open a link inside a popup browser window
    
    Versione 1.2.0 | Di cubecolour | Visualizza i dettagli |  |  |  | 
    Seleziona Aspose Doc Exporter	
    Aspose Doc Exporter
    Settings | Disattiva
    Aspose Doc Exporter is a plugin for exporting contents of posts into the doc / docx file.
    
    Versione 3.2.2 | Di Muhammad Sohail | Visualizza i dettagli
    Seleziona Auto Post Thumbnail	
    Auto Post Thumbnail
    Disattiva
    Automatically generate the Post Thumbnail (Featured Thumbnail) from the first image in post (or any custom post type) only if Post Thumbnail is not set manually.
    
    Versione 3.4.1 | Di Aditya Mooley , Tarique Sani | Visualizza i dettagli
    Seleziona Contact Form 7	
    Contact Form 7
    Impostazioni | Disattiva
    Solo un altro plugin per moduli di contatto. Semplice ma flessibile.
    
    Versione 5.0.4 | Di Takayuki Miyoshi | Visualizza i dettagli
    Seleziona Custom Login Page Customizer	
    Custom Login Page Customizer
    Disattiva | Rollback to v1.2.1
    Custom Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! Awesome, right?
    
    Versione 2.0.0 | Di Hardeep Asrani | Visualizza i dettagli
    Seleziona Deactivate User Accounts	
    Deactivate User Accounts
    Disattiva
    Gives you the ability to temporarily disable user accounts without having to delete them.
    
    Versione 1.0 | Di Kevin Ardy | Visualizza i dettagli
    Seleziona Default Thumbnail Plus	
    Default Thumbnail Plus
    Disattiva
    Add a default thumbnail image to post's with no post_thumbnail set.
    
    Versione 1.0.2.3 | Di Patrick Galbraith, gyrus | Visualizza i dettagli
    Seleziona Delete Duplicate Posts	
    Delete Duplicate Posts
    Settings | Opt In | Disattiva
    Remove duplicate blogposts on your blog! Searches and removes duplicate posts and their post meta tags. You can delete posts, pages and other Custom Post Types enabled on your website.
    
    Versione 4.1.9.4 | Di cleverplugins.com | Visualizza i dettagli
    Seleziona Detect AdBlock	
    Detect AdBlock
    Settings | Disattiva
    Detect AdBlock and prevent browsing using PHP Cookie and Session when the visitor has AdBlock in the browser. Easy to use, just install the plugin and activate it.
    
    Versione 1.0.0 | Di Alobaidi | Visualizza i dettagli | Explanation of Use | More Plugins | Elegant Themes | Bluehost
    Seleziona Disabilita Commenti	
    Disabilita Commenti
    Impostazioni | Strumenti | Disattiva
    Permetti agli amministratori di disabilitare globalmente i commenti sui loro siti. I commenti possono essere disabilitati in base alle tipologie di post.
    
    Versione 1.7.1 | Di Samir Shah | Visualizza i dettagli | GitHub
    Seleziona Duplicate Content Cure	
    Duplicate Content Cure
    Disattiva
    Duplicate content cure is a very simple, yet effective SEO plugin that prevents search engines from indexing WordPress pages that contain duplicate content, like archives and category pages.
    
    Versione 1.0 | Di Badi Jones | Visualizza i dettagli
    Seleziona Duplicate Title Checker	
    Duplicate Title Checker
    Disattiva
    This plugin provides alert message for duplicate post title and unique post title when adding new post.
    
    Versione 1.1 | Di Ketan Ajani | Visualizza i dettagli
    Seleziona Fancy Facebook Comments	
    Fancy Facebook Comments
    Settings | Disattiva | Add-Ons | Support Documentation
    Enable Facebook Comments at your website in the easiest possible way
    
    Versione 1.1.8 | Di Team Heateor | Visualizza i dettagli
    Seleziona Featured Image by URL	
    Featured Image by URL
    Disattiva
    This plugin allows to use an external URL Images as Featured Image for your post types. Includes support for Product Gallery (WooCommece).
    
    Versione 1.1.1 | Di Knawat Team | Visualizza i dettagli
    Seleziona Fix Duplicates	
    Fix Duplicates
    Settings | Disattiva
    Find and delete duplicates posts, specifying which one to keep (newest, oldest or manual selection). There is a premium extension that allows you to 301 redirect duplicates to the post you are keeping.
    
    Versione 1.0.4 | Di Stephen Cronin (Scratch99 Design) | Visualizza i dettagli
    Seleziona Google Analytics Dashboard per WP (GADWP)	
    Google Analytics Dashboard per WP (GADWP)
    Impostazioni | Disattiva
    Mostra le statistiche in tempo reale e i rapporti di Google Analytics nella tua bacheca. Inserisce automaticamente il codice di monitoraggio in ogni pagina del tuo sito.
    
    Versione 5.3.5 | Di ExactMetrics | Visualizza i dettagli
    Seleziona GP Back To Top	
    GP Back To Top
    Disattiva
    Create Back To Top Button Custom.
    
    Versione 3.0 | Di Mai Dong Giang (Peter Mai) | Visualizza i dettagli
    Seleziona Gwolle Guestbook	
    Gwolle Guestbook
    Disattiva | Impostazioni
    Gwolle Guestbook non è solo un altro libro degli ospiti per WordPress. L'obiettivo è fornire un modo semplice e leggero per integrare un libro degli ospiti nel tuo sito basato su WordPress. Non usare la sezione 'commenti' in modo sbagliato - installare Gwolle Guestbook vuol dire avere un vero e proprio libro degli ospiti.
    
    Versione 2.6.3 | Di Marcel Pol | Visualizza i dettagli
    Seleziona Importatore RSS	
    Importatore RSS
    Disattiva
    Importa articoli da un feed RSS.
    
    Versione 0.2 | Di wordpressdotorg | Visualizza i dettagli
    Seleziona Importatore Tumblr	
    Importatore Tumblr
    Disattiva
    Importa articoli da un blog di Tumblr
    
    Versione 0.8 | Di wordpressdotorg | Visualizza i dettagli
    Seleziona Intuitive Custom Post Order	
    Intuitive Custom Post Order
    Disattiva
    Intuitively, Order Items( Posts, Pages, ,Custom Post Types, Custom Taxonomies, Sites ) using a Drag and Drop Sortable JavaScript.
    
    Versione 3.1.1 | Di hijiri | Visualizza i dettagli
    Seleziona KIA Subtitle	
    KIA Subtitle
    Impostazioni | Disattiva
    Aggiunge un campo per il sottotitolo all'editor degli Articoli di WordPress
    
    Versione 1.6.8 | Di Kathy Darling | Visualizza i dettagli | Fai una donazione
    Seleziona PHP code snippets (Insert PHP)	
    PHP code snippets (Insert PHP)
    Disattiva
    Run PHP code inserted into WordPress posts and pages. An easy, clean and easy way to add code snippets to your site. You do not need to edit the functions.php file of your theme again!
    
    Versione 2.0.6 | Di Will Bontrager Software, LLC , Webcraftic | Visualizza i dettagli
    Seleziona Post Thumbnail From Url	
    Post Thumbnail From Url
    Settings | Disattiva
    Post Thumbnail From URL is a plugin to import images using a public URL straight in your media library from the featured Image metabox in post edit page
    
    Versione 1.0 | Di Michele Settembre | Visualizza i dettagli
    Seleziona Prevent XSS Vulnerability	
    Prevent XSS Vulnerability
    Settings | Disattiva
    Allow you to make your site prevent from the XSS Vulnerability.
    
    Versione 0.1 | Di Sami Ahmed Siddiqui | Visualizza i dettagli
    Seleziona Responsive Lightbox & Gallery	
    Responsive Lightbox & Gallery
    Settings | Disattiva | Add-ons
    Responsive Lightbox & Gallery allows users to create galleries and view larger versions of images, galleries and videos in a lightbox (overlay) effect optimized for mobile devices.
    
    Versione 2.0.5 | Di dFactory | Visualizza i dettagli | Support
    Seleziona RSS Feed Icon	
    RSS Feed Icon
    Settings | Disattiva
    Easily add the RSS feed icon in any place of your website. It will be responsive and compatible with all major browsers. It will work with any theme!
    
    Versione 2.23 | Di Space X-Chimp | Visualizza i dettagli |  Donate
    Seleziona Rss Post Importer	
    Rss Post Importer
    Settings | Disattiva
    This plugin lets you set up an import posts from one or several rss-feeds and save them as posts on your site, simple and flexible.
    
    Versione 2.5.2 | Di feedsapi | Visualizza i dettagli
    Seleziona Search Exclude	
    Search Exclude
    Disattiva
    Hide any page or post from the WordPress search results by checking off the checkbox.
    
    Versione 1.2.2 | Di Roman Pronskiy | Visualizza i dettagli
    Seleziona Set All First Images As Featured	
    Set All First Images As Featured
    Disattiva | Settings
    Sets the first image of your posts, pages or custom post types as the featured image.
    
    Versione 1.2.2 | Di Lucy Tomás | Visualizza i dettagli
    Seleziona Silverlight Media Player for WordPress	
    Silverlight Media Player for WordPress
    Disattiva
    A plugin for WordPress to host a Silverlight media player for regular or IIS Smooth Streaming video playback.
    
    Versione 1.1.1 | Di Tim Heuer | Visualizza i dettagli
    Seleziona SyntaxHighlighter Evolved	
    SyntaxHighlighter Evolved
    Disattiva | Impostazioni
    Easily post syntax-highlighted code to your site without having to modify the code at all. Uses Alex Gorbatchev's SyntaxHighlighter. TIP: Don't use the Visual editor if you don't want your code mangled. TinyMCE will "clean up" your HTML.
    
    Versione 3.2.1 | Di Alex Mills (Viper007Bond) | Visualizza i dettagli
    Seleziona TinyMCE Advanced	
    TinyMCE Advanced
    Parametri | Disattiva
    Abilita le caratteristiche avanzate ed i plugin in TinyMCE, l'editor visuale in WordPress.
    
    Versione 4.8.0 | Di Andrew Ozz | Visualizza i dettagli
    Seleziona User Access Shortcodes	
    User Access Shortcodes
    Disattiva
    "The most simple way of controlling who sees what in your posts/pages". This plugin adds a button to your post editor, allowing you to restrict content to logged in users only (or guests) with a simple shortcode. Find help and information on our support site.
    
    Versione 2.1.1 | Di WP Darko | Visualizza i dettagli
    Seleziona Visitors Traffic Real Time Statistics Free	
    Visitors Traffic Real Time Statistics Free
    Disattiva
    Hits counter that shows analytical numbers of your WordPress site visitors and hits. Dashboard | Upgrade to pro.
    
    Versione 1.6 | Di wp-buy | Visualizza i dettagli
    You are running visitors traffic free. To get more features, you can upgrade now or dismiss this message
    Seleziona Visual Editor Custom Buttons	
    Visual Editor Custom Buttons
    Disattiva
    Create custom buttons in WordPress Visual Editor.
    
    Versione 1.5.2.2 | Di Ola Eborn | Visualizza i dettagli
    Seleziona WonderPlugin Gallery	
    WonderPlugin Gallery
    Disattiva
    WordPress Photo Video Gallery Plugin
    
    Versione 11.4 | Di Magic Hills Pty Ltd | Visita il sito del plugin
    Seleziona WordPress Popular Posts	
    WordPress Popular Posts
    Disattiva | Impostazioni
    A highly customizable widget that displays the most popular posts on your blog.
    
    Versione 4.1.2 | Di Hector Cabrera | Visualizza i dettagli
    Seleziona Worth The Read	
    Worth The Read
    Disattiva
    Adds read length progress bar to single posts and pages, as well as an optional reading time commitment label to post titles.
    
    Versione 1.4 | Di Well Done Marketing | Visualizza i dettagli
    Seleziona WP Avatar Utente	
    WP Avatar Utente
    Disattiva | Impostazioni
    Usa qualsiasi immagine dalla Libreria di WordPress come un avatar utente personalizzato. Aggiungi il tuo avatar di default.
    
    Versione 2.1.5 | Di flippercode | Visualizza i dettagli | Forum di supporto
    Seleziona WP Content Copy Protection & No Right Click	
    WP Content Copy Protection & No Right Click
    Disattiva | Impostazioni
    This wp plugin protect the posts content from being copied by any other web site author , you dont want your content to spread without your permission!!
    
    Versione 1.6.2 | Di wp-buy | Visualizza i dettagli
    You are running WP Content Copy Protection & No Right Click (free). To get more features, you can Upgrade Now.
    Seleziona WP Custom Login Page Logo	
    WP Custom Login Page Logo
    Settings | Disattiva
    Customize the admin logo on /wp-admin login page.
    
    Versione 1.4.8.3 | Di Lars Ortlepp | Visualizza i dettagli
    Seleziona WP Maintenance Mode	
    WP Maintenance Mode
    Impotazioni | Disattiva
    Adds a splash page to your site that lets visitors know your site is down for maintenance. It's perfect for a coming soon page.
    
    Versione 2.2.1 | Di Designmodo | Visualizza i dettagli
    Seleziona WP-PostViews	
    WP-PostViews
    Disattiva
    Enables you to display how many times a post/page had been viewed.
    
    Versione 1.75 | Di Lester 'GaMerZ' Chan | Visualizza i dettagli
    Seleziona Yet Another Related Posts Plugin	
    Yet Another Related Posts Plugin
    Disattiva | Impostazioni
    Adds related posts to your site and in RSS feeds, based on a powerful, customizable algorithm.
    
    Versione 4.4 | Di Adknowledge | Visualizza i dettagli
    Seleziona Yoast SEO	
    Yoast SEO
    FAQ | Supporto Premium | Impostazioni | Disattiva
    La prima vera soluzione SEO tutto-in-uno per WordPress, compresa l’analisi dei contenuti su ogni pagina, sitemap XML e molto altro.
    
    Versione 8.1.2 | Di Team Yoast | Visualizza i dettagli
    • scaleretrattili

      (@scaleretrattili)


      Buongiorno a tutti.
      Ho creato una tassonomia personalizzata che ho chiamato provincia tramite il seguente codice inserito in functions.php tema storefront.

      
      function add_custom_taxonomies() {
        // Add new "Provincia" taxonomy to Posts
        register_taxonomy('provincia', 'product', array(
          // Hierarchical taxonomy (like categories)
          'hierarchical' => true,
          // This array of options controls the labels displayed in the WordPress Admin UI
          'labels' => array(
            'name' => _x( 'provincia', 'taxonomy general name' ),
            'singular_name' => _x( 'Provincia', 'taxonomy singular name' ),
            'search_items' =>  __( 'Search Provincia' ),
            'all_items' => __( 'All Provincia' ),
            'parent_item' => __( 'Parent Provincia' ),
            'parent_item_colon' => __( 'Parent Provincia:' ),
            'edit_item' => __( 'Edit Provincia' ),
            'update_item' => __( 'Update Provincia' ),
            'add_new_item' => __( 'Add New Provincia' ),
            'new_item_name' => __( 'New Provincia Name' ),
            'menu_name' => __( 'Provincia' ),
          ),
          // Control the slugs used for this taxonomy
          'rewrite' => array(
            'slug' => 'provincia', // This controls the base slug that will display before each term
            'with_front' => false, // Don't display the category base before "/locations/"
            'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
          ),
        ));
      }
      add_action( 'init', 'add_custom_taxonomies', 0 );
      

      Poi ho aggiunto un campo personalizzato dentro il vocabolario appena creato con questa funzione.

      
      function wcr_provincia_fields($term) {
          // we check the name of the action because we need to have different output
          // if you have other taxonomy name, replace category with the name of your taxonomy. ex: book_add_form_fields, book_edit_form_fields
          if (current_filter() == 'provincia_edit_form_fields') {
              $short_description = get_term_meta($term->term_id, 'short_description', true);
              $color_code = get_term_meta($term->term_id, 'color_code', true);
              ?>
              <tr class="form-field">
                  <th valign="top" scope="row"><label for="term_fields[short_description]"><?php _e('Short description'); ?></label></th>
                  <td>
                      <textarea class="large-text" cols="50" rows="5" id="term_fields[short_description]" name="term_fields[short_description]"><?php echo esc_textarea($short_description); ?></textarea><br/>
                      <span class="description"><?php _e('Please enter short description'); ?></span>
                  </td>
              </tr>
              <tr class="form-field">
                  <th valign="top" scope="row"><label for="term_fields[color_code]"><?php _e('Color code'); ?></label></th>
                  <td>
                      <input type="text" size="40" value="<?php echo esc_attr($color_code); ?>" id="term_fields[color_code]" name="term_fields[color_code]"><br/>
                      <span class="description"><?php _e('Please enter color hex code'); ?></span>
                  </td>
              </tr>   
      	<?php } elseif (current_filter() == 'provincia_add_form_fields') {
              ?>
              <div class="form-field">
                  <label for="term_fields[short_description]"><?php _e('Short description'); ?></label>
                  <textarea cols="40" rows="5" id="term_fields[short_description]" name="term_fields[short_description]"></textarea>
                  <p class="description"><?php _e('Please enter short description'); ?></p>
              </div>
              <div class="form-field">
                  <label for="term_fields[color_code]"><?php _e('Color code'); ?></label>
                  <input type="text" size="40" value="" id="term_fields[color_code]" name="term_fields[color_code]">
                  <p class="description"><?php _e('Please enter color hex code'); ?></p>
              </div>  
          <?php
          }
      }
      
      // Add the fields, using our callback function  
      // if you have other taxonomy name, replace provincia with the name of your taxonomy. ex: book_add_form_fields, book_edit_form_fields
      add_action('provincia_add_form_fields', 'wcr_provincia_fields', 10, 2);
      add_action('provincia_edit_form_fields', 'wcr_provincia_fields', 10, 2);
         
       
       
      // salva i dati
       
       
      function wcr_save_provincia_fields($term_id) {
          if (!isset($_POST['term_fields'])) {
              return;
          }
      
          foreach ($_POST['term_fields'] as $key => $value) {
              update_term_meta($term_id, $key, sanitize_text_field($value));
          }
      }
      
      // Save the fields values, using our callback function
      // if you have other taxonomy name, replace category with the name of your taxonomy. ex: edited_book, create_book
      add_action('edited_provincia', 'wcr_save_provincia_fields', 10, 2);
      add_action('create_provincia', 'wcr_save_provincia_fields', 10, 2);
      

      e tutto funziona bene. Il campo short_description si vede in edit del termina e si salva correttamente
      ho creato la cartella woocommercedentro il tema e creato il file taxonomy-provincia.php per personalizzare la visualizzazione dei prodotti associa ti al vocabolario.

      Ora, cio, premesso, come faccio a visualizzare il campo short_description a mezzo del file sovrascritto taxonomy-provincia.php?

      Grazie Francesco

      • Questo topic è stato modificato 7 anni, 9 mesi fa da Guido Scialfa. Motivo: Formattazione codice. Prova ad usare servizi per la formattazione del codice tipo paste bin
Stai vedendo 15 risultati - da 1 a 15 (di 48 totali)