ID, 'accordions_id', true); $accordions_tab_title = get_post_meta($post->ID, 'accordions_tab_title', true); //var_dump($accordions_id); ?>
post_type == 'product' && in_array('woocommerce/woocommerce.php', (array) $active_plugins)) { /* * We need to verify this came from the our screen and with proper authorization, * because save_post can be triggered at other times. */ // Check if our nonce is set. if (! isset($_POST['meta_boxes_accordions_wc_input_nonce'])) return $post_id; $nonce = sanitize_text_field(wp_unslash($_POST['meta_boxes_accordions_wc_input_nonce'])); // Verify that the nonce is valid. if (! wp_verify_nonce($nonce, 'meta_boxes_accordions_wc_input')) return $post_id; // If this is an autosave, our form has not been submitted, so we don't want to do anything. if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id; /* OK, its safe for us to save the data now. */ // Sanitize user input. $accordions_id = isset($_POST['accordions_id']) ? sanitize_text_field(wp_unslash($_POST['accordions_id'])) : ''; $accordions_tab_title = isset($_POST['accordions_tab_title']) ? sanitize_text_field(wp_unslash($_POST['accordions_tab_title'])) : ''; update_post_meta($post_id, 'accordions_id', $accordions_id); update_post_meta($post_id, 'accordions_tab_title', $accordions_tab_title); } } } new class_accordions_post_meta_product();