예제 #1
0
 function cs_meta_woo_post_save($post_id)
 {
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     if (empty($_POST["sub_title"])) {
         $_POST["sub_title"] = "";
     }
     if (empty($_POST["switch_footer_widgets"])) {
         $_POST["switch_footer_widgets"] = "";
     }
     $sxe = new SimpleXMLElement("<cs_meta_post></cs_meta_post>");
     $sxe->addChild('sub_title', $_POST['sub_title']);
     $sxe = save_layout_xml($sxe);
     update_post_meta($post_id, 'product', $sxe->asXML());
 }
예제 #2
0
 function cs_meta_cause_save($post_id)
 {
     $payment_gross = 0;
     $sxe = new SimpleXMLElement("<cause></cause>");
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     if (empty($_POST["cause_social_share"])) {
         $_POST["cause_social_share"] = "";
     }
     if (empty($_POST["cause_goal_amount"])) {
         $_POST["cause_goal_amount"] = "";
     }
     if (empty($_POST["cause_end_date"])) {
         $_POST["cause_end_date"] = "";
     }
     if (empty($_POST["cause_raised_amount"])) {
         $_POST["cause_raised_amount"] = "";
     }
     if (empty($_POST["cause_paypal_email"])) {
         $_POST["cause_paypal_email"] = "";
     }
     if (empty($_POST["cs_donations_show"])) {
         $_POST["cs_donations_show"] = "";
     }
     if (empty($_POST["post_author_info_show"])) {
         $_POST["post_author_info_show"] = "";
     }
     if (empty($_POST["post_tags_show"])) {
         $_POST["post_tags_show"] = "";
     }
     if (empty($_POST["post_pagination_show"])) {
         $_POST["post_pagination_show"] = "";
     }
     $sxe = save_layout_xml($sxe);
     $sxe->addChild('cause_social_share', htmlspecialchars($_POST['cause_social_share']));
     $sxe->addChild('post_author_info_show', htmlspecialchars($_POST['post_author_info_show']));
     $sxe->addChild('cause_goal_amount', htmlspecialchars($_POST['cause_goal_amount']));
     $sxe->addChild('cause_end_date', htmlspecialchars($_POST['cause_end_date']));
     $sxe->addChild('cause_paypal_email', htmlspecialchars($_POST['cause_paypal_email']));
     $sxe->addChild('cs_donations_show', htmlspecialchars($_POST['cs_donations_show']));
     $sxe->addChild('post_tags_show', htmlspecialchars($_POST['post_tags_show']));
     $sxe->addChild('post_pagination_show', htmlspecialchars($_POST['post_pagination_show']));
     $cs_counter = 0;
     if (isset($_POST['address_name'])) {
         $tran = new SimpleXMLElement("<cause_transaction></cause_transaction>");
         foreach ($_POST['address_name'] as $count) {
             $payment_gross = $payment_gross + $_POST['payment_gross'][$cs_counter];
             $trans = $tran->addChild('transaction');
             $trans->addChild('txn_id', htmlspecialchars($_POST['txn_id'][$cs_counter]));
             $trans->addChild('payment_date', htmlspecialchars($_POST['payment_date'][$cs_counter]));
             $trans->addChild('payer_email', htmlspecialchars($_POST['payer_email'][$cs_counter]));
             $trans->addChild('payment_gross', htmlspecialchars($_POST['payment_gross'][$cs_counter]));
             $trans->addChild('address_name', htmlspecialchars($_POST['address_name'][$cs_counter]));
             $cs_counter++;
         }
         update_post_meta($post_id, 'cs_cause_transaction_meta', $tran->asXML());
     }
     $percentage_amount = $payment_gross / htmlspecialchars($_POST['cause_goal_amount']) * 100;
     if ($percentage_amount >= 100) {
         $percentage_amount = 100;
     }
     update_post_meta($post_id, 'cs_cause_percentage_amount', (int) $percentage_amount);
     update_post_meta($post_id, 'cs_cause_goal_amount', htmlspecialchars($_POST['cause_goal_amount']));
     update_post_meta($post_id, 'cs_cause_raised_amount', $payment_gross);
     update_post_meta($post_id, 'cause_end_date', htmlspecialchars($_POST['cause_end_date']));
     update_post_meta($post_id, 'cs_cause_meta', $sxe->asXML());
 }
예제 #3
0
 function cs_meta_team_save($cs_post_id)
 {
     $sxe = new SimpleXMLElement("<team></team>");
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     if (empty($_POST["var_cp_expertise"])) {
         $_POST["var_cp_expertise"] = "";
     }
     if (empty($_POST["var_cp_email"])) {
         $_POST["var_cp_email"] = "";
     }
     if (empty($_POST["facebook"])) {
         $_POST["facebook"] = "";
     }
     if (empty($_POST["twitter"])) {
         $_POST["twitter"] = "";
     }
     if (empty($_POST["linkedin"])) {
         $_POST["linkedin"] = "";
     }
     if (empty($_POST["google_plus"])) {
         $_POST["google_plus"] = "";
     }
     if (empty($_POST["team_social_sharing"])) {
         $_POST["team_social_sharing"] = "";
     }
     $sxe = save_layout_xml($sxe);
     $sxe->addChild('var_cp_expertise', $_POST['var_cp_expertise']);
     $sxe->addChild('var_cp_email', $_POST['var_cp_email']);
     $sxe->addChild('facebook', $_POST['facebook']);
     $sxe->addChild('twitter', $_POST['twitter']);
     $sxe->addChild('linkedin', $_POST['linkedin']);
     $sxe->addChild('google_plus', $_POST['google_plus']);
     $sxe->addChild('team_social_sharing', $_POST['team_social_sharing']);
     $counter = 0;
     if (isset($_POST['var_cp_title'])) {
         foreach ($_POST['var_cp_title'] as $count) {
             $track = $sxe->addChild('social');
             $track->addChild('var_cp_title', htmlspecialchars($_POST['var_cp_title'][$counter]));
             $track->addChild('var_cp_image_url', htmlspecialchars($_POST['var_cp_image_url'][$counter]));
             $track->addChild('var_cp_team_text', $_POST['var_cp_team_text'][$counter]);
             $counter++;
         }
     }
     update_post_meta($cs_post_id, 'cs_team', $sxe->asXML());
 }
예제 #4
0
 function save_page_builder($post_id)
 {
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     if (isset($_POST['cs_orderby'])) {
         //creating xml page builder start
         $sxe = new SimpleXMLElement("<pagebuilder></pagebuilder>");
         $sxe->addChild('page_content', $_POST['page_content']);
         $sxe = save_layout_xml($sxe);
         if (isset($_POST['cs_orderby'])) {
             $cs_counter = 0;
             $cs_counter_gal = 0;
             $cs_counter_port = 0;
             $cs_counter_event = 0;
             $counter_team = 0;
             $cs_counter_slider = 0;
             $cs_counter_blog = 0;
             $cs_counter_cause = 0;
             $cs_counter_news = 0;
             $cs_counter_contact = 0;
             $cs_counter_course = 0;
             $cs_counter_testimonial = 0;
             $cs_counter_column = 0;
             $cs_counter_mb = 0;
             $cs_counter_image = 0;
             $cs_counter_map = 0;
             $cs_counter_services_node = 0;
             $cs_counter_services = 0;
             $cs_counter_tabs_node = 0;
             $cs_counter_accordion_node = 0;
             $cs_counter_testimonial = 0;
             $cs_counter_testimonial_node = 0;
             $cs_counter_team = 0;
             $cs_counter_team_node = 0;
             $counter_quote = 0;
             $counter_video = 0;
             $counter_quote = 0;
             $counter_services = 0;
             $counter_services_node = 0;
             $counter_tabs = 0;
             $counter_tabs_node = 0;
             $counter_accordion = 0;
             $counter_accordion_node = 0;
             $cs_counter_parallax = 0;
             foreach ($_POST['cs_orderby'] as $count) {
                 if ($_POST['cs_orderby'][$cs_counter] == "gallery") {
                     $gallery = $sxe->addChild('gallery');
                     $gallery->addChild('header_title', $_POST['cs_gal_header_title'][$cs_counter_gal]);
                     $gallery->addChild('layout', $_POST['cs_gal_layout'][$cs_counter_gal]);
                     $gallery->addChild('album', $_POST['cs_gal_album'][$cs_counter_gal]);
                     $gallery->addChild('pagination', $_POST['cs_gal_pagination'][$cs_counter_gal]);
                     $gallery->addChild('media_per_page', $_POST['cs_gal_media_per_page'][$cs_counter_gal]);
                     $gallery->addChild('gallery_element_size', $_POST['gallery_element_size'][$cs_counter_gal]);
                     $cs_counter_gal++;
                 } else {
                     if ($_POST['cs_orderby'][$cs_counter] == "slider") {
                         $slider = $sxe->addChild('slider');
                         $slider->addChild('slider_header_title', $_POST['cs_slider_header_title'][$cs_counter_slider]);
                         $slider->addChild('slider_type', $_POST['cs_slider_type'][$cs_counter_slider]);
                         $slider->addChild('slider', $_POST['cs_slider'][$cs_counter_slider]);
                         $slider->addChild('slider_view', $_POST['slider_view'][$cs_counter_slider]);
                         $slider->addChild('slider_id', htmlspecialchars($_POST['cs_slider_id'][$cs_counter_slider]));
                         $slider->addChild('slider_element_size', $_POST['slider_element_size'][$cs_counter_slider]);
                         $cs_counter_slider++;
                     } else {
                         if ($_POST['cs_orderby'][$cs_counter] == "video") {
                             $divider = $sxe->addChild('video');
                             $divider->addChild('video_element_size', htmlspecialchars($_POST['video_element_size'][$counter_video]));
                             $divider->addChild('video_url', htmlspecialchars($_POST['video_url'][$counter_video]));
                             $divider->addChild('video_width', htmlspecialchars($_POST['video_width'][$counter_video]));
                             $divider->addChild('video_height', htmlspecialchars($_POST['video_height'][$counter_video]));
                             $counter_video++;
                         } else {
                             if ($_POST['cs_orderby'][$cs_counter] == "quote") {
                                 $divider = $sxe->addChild('quote');
                                 $divider->addChild('quote_element_size', htmlspecialchars($_POST['quote_element_size'][$counter_quote]));
                                 $divider->addChild('quote_text_color', htmlspecialchars($_POST['quote_text_color'][$counter_quote]));
                                 $divider->addChild('quote_align', htmlspecialchars($_POST['quote_align'][$counter_quote]));
                                 $divider->addChild('quote_content', htmlspecialchars($_POST['quote_content'][$counter_quote]));
                                 $counter_quote++;
                             } else {
                                 if ($_POST['cs_orderby'][$cs_counter] == "blog") {
                                     $blog = $sxe->addChild('blog');
                                     $blog->addChild('cs_blog_title', htmlspecialchars($_POST['cs_blog_title'][$cs_counter_blog]));
                                     $blog->addChild('cs_blog_view', $_POST['cs_blog_view'][$cs_counter_blog]);
                                     $blog->addChild('cs_blog_cat', $_POST['cs_blog_cat'][$cs_counter_blog]);
                                     $blog->addChild('cs_blog_excerpt', $_POST['cs_blog_excerpt'][$cs_counter_blog]);
                                     $blog->addChild('cs_blog_num_post', $_POST['cs_blog_num_post'][$cs_counter_blog]);
                                     $blog->addChild('cs_blog_pagination', $_POST['cs_blog_pagination'][$cs_counter_blog]);
                                     $blog->addChild('cs_blog_description', $_POST['cs_blog_description'][$cs_counter_blog]);
                                     $blog->addChild('cs_blog_orderby', $_POST['cs_blog_orderby'][$cs_counter_blog]);
                                     $blog->addChild('blog_element_size', $_POST['blog_element_size'][$cs_counter_blog]);
                                     $cs_counter_blog++;
                                 } else {
                                     if ($_POST['cs_orderby'][$cs_counter] == "cause") {
                                         $cause_menus = $sxe->addChild('cause');
                                         $cause_menus->addChild('cause_element_size', htmlspecialchars($_POST['cause_element_size'][$cs_counter_cause]));
                                         $cause_menus->addChild('cause_title', htmlspecialchars($_POST['cause_title'][$cs_counter_cause]));
                                         $cause_menus->addChild('cause_cat', $_POST['cause_cat'][$cs_counter_cause]);
                                         $cause_menus->addChild('cause_view', $_POST['cause_view'][$cs_counter_cause]);
                                         $cause_menus->addChild('cause_type', $_POST['cause_type'][$cs_counter_cause]);
                                         $cause_menus->addChild('cause_pagination', $_POST['cause_pagination'][$cs_counter_cause]);
                                         $cause_menus->addChild('cs_cause_last_miles_percentage', $_POST['cs_cause_last_miles_percentage'][$cs_counter_cause]);
                                         $cause_menus->addChild('cause_per_page', $_POST['cause_per_page'][$cs_counter_cause]);
                                         $cause_menus->addChild('cs_cause_excerpt', $_POST['cs_cause_excerpt'][$cs_counter_cause]);
                                         $cs_counter_cause++;
                                     } else {
                                         if ($_POST['cs_orderby'][$cs_counter] == "services") {
                                             $services = $sxe->addChild('services');
                                             $services->addChild('services_element_size', htmlspecialchars($_POST['services_element_size'][$cs_counter_services]));
                                             for ($i = 1; $i <= $_POST['services_num'][$cs_counter_services]; $i++) {
                                                 $service = $services->addChild('service');
                                                 $service->addChild('service_title', htmlspecialchars($_POST['service_title'][$cs_counter_services_node]));
                                                 $service->addChild('service_type', htmlspecialchars($_POST['service_type'][$cs_counter_services_node]));
                                                 $service->addChild('service_icon', htmlspecialchars($_POST['service_icon'][$cs_counter_services_node]));
                                                 $service->addChild('service_bg_image', htmlspecialchars($_POST['service_bg_image'][$cs_counter_services_node]));
                                                 $service->addChild('service_link_url', htmlspecialchars($_POST['service_link_url'][$cs_counter_services_node]));
                                                 $service->addChild('service_text', htmlspecialchars($_POST['service_text'][$cs_counter_services_node]));
                                                 $cs_counter_services_node++;
                                             }
                                             $cs_counter_services++;
                                         } else {
                                             if ($_POST['cs_orderby'][$cs_counter] == "staff") {
                                                 $album = $sxe->addChild('team');
                                                 $album->addChild('var_pb_team_title', htmlspecialchars($_POST['var_pb_team_title'][$counter_team]));
                                                 $album->addChild('var_pb_team_cat', $_POST['var_pb_team_cat'][$counter_team]);
                                                 $album->addChild('var_pb_team_view', $_POST['var_pb_team_view'][$counter_team]);
                                                 $album->addChild('var_pb_team_pagination', $_POST['var_pb_team_pagination'][$counter_team]);
                                                 $album->addChild('var_pb_team_per_page', $_POST['var_pb_team_per_page'][$counter_team]);
                                                 $album->addChild('cs_team_orderby', $_POST['cs_team_orderby'][$counter_team]);
                                                 $album->addChild('cs_team_excerpt', $_POST['cs_team_excerpt'][$counter_team]);
                                                 $album->addChild('var_pb_team_element_size', $_POST['var_pb_team_element_size'][$counter_team]);
                                                 $counter_team++;
                                             } else {
                                                 if ($_POST['cs_orderby'][$cs_counter] == "event") {
                                                     $event = $sxe->addChild('event');
                                                     $event->addChild('cs_event_title', htmlspecialchars($_POST['cs_event_title'][$cs_counter_event]));
                                                     $event->addChild('cs_event_type', $_POST['cs_event_type'][$cs_counter_event]);
                                                     $event->addChild('cs_event_category', $_POST['cs_event_category'][$cs_counter_event]);
                                                     $event->addChild('cs_event_featured_category', $_POST['cs_event_featured_category'][$cs_counter_event]);
                                                     $event->addChild('cs_event_view', $_POST['cs_event_view'][$cs_counter_event]);
                                                     $event->addChild('cs_event_excerpt', $_POST['cs_event_excerpt'][$cs_counter_event]);
                                                     $event->addChild('cs_event_view_all_link', $_POST['cs_event_view_all_link'][$cs_counter_event]);
                                                     $event->addChild('cs_event_time', $_POST['cs_event_time'][$cs_counter_event]);
                                                     $event->addChild('cs_event_filterables', $_POST['cs_event_filterables'][$cs_counter_event]);
                                                     $event->addChild('cs_event_pagination', $_POST['cs_event_pagination'][$cs_counter_event]);
                                                     $event->addChild('cs_event_per_page', $_POST['cs_event_per_page'][$cs_counter_event]);
                                                     $event->addChild('cs_event_thumbnail', $_POST['cs_event_thumbnail'][$cs_counter_event]);
                                                     $event->addChild('event_element_size', $_POST['event_element_size'][$cs_counter_event]);
                                                     $cs_counter_event++;
                                                 } else {
                                                     if ($_POST['cs_orderby'][$cs_counter] == "contact") {
                                                         $contact = $sxe->addChild('contact');
                                                         $contact->addChild('cs_contact_email', $_POST['cs_contact_email'][$cs_counter_contact]);
                                                         $contact->addChild('cs_contact_succ_msg', htmlspecialchars($_POST['cs_contact_succ_msg'][$cs_counter_contact]));
                                                         $contact->addChild('contact_element_size', $_POST['contact_element_size'][$cs_counter_contact]);
                                                         $cs_counter_contact++;
                                                     } else {
                                                         if ($_POST['cs_orderby'][$cs_counter] == "column") {
                                                             $column = $sxe->addChild('column');
                                                             $column->addChild('column_element_size', htmlspecialchars($_POST['column_element_size'][$cs_counter_column]));
                                                             $column->addChild('column_text', htmlspecialchars($_POST['column_text'][$cs_counter_column]));
                                                             $cs_counter_column++;
                                                         } else {
                                                             if ($_POST['cs_orderby'][$cs_counter] == "accordions") {
                                                                 $accordions = $sxe->addChild('accordions');
                                                                 $accordions->addChild('accordion_element_size', htmlspecialchars($_POST['accordion_element_size'][$counter_accordion]));
                                                                 for ($i = 1; $i <= $_POST['accordion_num'][$counter_accordion]; $i++) {
                                                                     $accordion = $accordions->addChild('accordion');
                                                                     $accordion->addChild('accordion_title', htmlspecialchars($_POST['accordion_title'][$counter_accordion_node]));
                                                                     $accordion->addChild('accordion_text', htmlspecialchars($_POST['accordion_text'][$counter_accordion_node]));
                                                                     $accordion->addChild('accordion_title_icon', htmlspecialchars($_POST['accordion_title_icon'][$counter_accordion_node]));
                                                                     $accordion->addChild('accordion_active', htmlspecialchars($_POST['accordion_active'][$counter_accordion_node]));
                                                                     $counter_accordion_node++;
                                                                 }
                                                                 $counter_accordion++;
                                                             } else {
                                                                 if ($_POST['cs_orderby'][$cs_counter] == "tabs") {
                                                                     $tabs = $sxe->addChild('tabs');
                                                                     $tabs->addChild('tabs_element_size', htmlspecialchars($_POST['tabs_element_size'][$counter_tabs]));
                                                                     for ($i = 1; $i <= $_POST['tabs_num'][$counter_tabs]; $i++) {
                                                                         $tab = $tabs->addChild('tab');
                                                                         $tab->addChild('tab_title', htmlspecialchars($_POST['tab_title'][$counter_tabs_node]));
                                                                         $tab->addChild('tab_text', htmlspecialchars($_POST['tab_text'][$counter_tabs_node]));
                                                                         $tab->addChild('tab_title_icon', htmlspecialchars($_POST['tab_title_icon'][$counter_tabs_node]));
                                                                         $tab->addChild('tab_active', htmlspecialchars($_POST['tab_active'][$counter_tabs_node]));
                                                                         $counter_tabs_node++;
                                                                     }
                                                                     $counter_tabs++;
                                                                 } else {
                                                                     if ($_POST['cs_orderby'][$cs_counter] == "video") {
                                                                         $divider = $sxe->addChild('video');
                                                                         $divider->addChild('video_element_size', htmlspecialchars($_POST['video_element_size'][$counter_video]));
                                                                         $divider->addChild('video_url', htmlspecialchars($_POST['video_url'][$counter_video]));
                                                                         $divider->addChild('video_width', htmlspecialchars($_POST['video_width'][$counter_video]));
                                                                         $divider->addChild('video_height', htmlspecialchars($_POST['video_height'][$counter_video]));
                                                                         $counter_video++;
                                                                     } else {
                                                                         if ($_POST['cs_orderby'][$cs_counter] == "quote") {
                                                                             $divider = $sxe->addChild('quote');
                                                                             $divider->addChild('quote_element_size', htmlspecialchars($_POST['quote_element_size'][$counter_quote]));
                                                                             $divider->addChild('quote_text_color', htmlspecialchars($_POST['quote_text_color'][$counter_quote]));
                                                                             $divider->addChild('quote_align', htmlspecialchars($_POST['quote_align'][$counter_quote]));
                                                                             $divider->addChild('quote_content', htmlspecialchars($_POST['quote_content'][$counter_quote]));
                                                                             $counter_quote++;
                                                                         } else {
                                                                             if ($_POST['cs_orderby'][$cs_counter] == "map") {
                                                                                 $divider = $sxe->addChild('map');
                                                                                 $divider->addChild('map_element_size', htmlspecialchars($_POST['map_element_size'][$cs_counter_map]));
                                                                                 $divider->addChild('map_title', htmlspecialchars($_POST['map_title'][$cs_counter_map]));
                                                                                 $divider->addChild('map_height', htmlspecialchars($_POST['map_height'][$cs_counter_map]));
                                                                                 $divider->addChild('map_lat', htmlspecialchars($_POST['map_lat'][$cs_counter_map]));
                                                                                 $divider->addChild('map_lon', htmlspecialchars($_POST['map_lon'][$cs_counter_map]));
                                                                                 $divider->addChild('map_zoom', htmlspecialchars($_POST['map_zoom'][$cs_counter_map]));
                                                                                 $divider->addChild('map_type', htmlspecialchars($_POST['map_type'][$cs_counter_map]));
                                                                                 $divider->addChild('map_info', $_POST['map_info'][$cs_counter_map]);
                                                                                 $divider->addChild('map_info_width', $_POST['map_info_width'][$cs_counter_map]);
                                                                                 $divider->addChild('map_info_height', $_POST['map_info_height'][$cs_counter_map]);
                                                                                 $divider->addChild('map_marker_icon', $_POST['map_marker_icon'][$cs_counter_map]);
                                                                                 $divider->addChild('map_show_marker', $_POST['map_show_marker'][$cs_counter_map]);
                                                                                 $divider->addChild('map_controls', $_POST['map_controls'][$cs_counter_map]);
                                                                                 $divider->addChild('map_draggable', htmlspecialchars($_POST['map_draggable'][$cs_counter_map]));
                                                                                 $divider->addChild('map_scrollwheel', htmlspecialchars($_POST['map_scrollwheel'][$cs_counter_map]));
                                                                                 $divider->addChild('map_view', htmlspecialchars($_POST['map_view'][$cs_counter_map]));
                                                                                 $cs_counter_map++;
                                                                             } else {
                                                                                 if ($_POST['cs_orderby'][$cs_counter] == "parallax") {
                                                                                     $parallax = $sxe->addChild('parallax');
                                                                                     $parallax->addChild('parallax_element_size', $_POST['parallax_element_size'][$cs_counter_parallax]);
                                                                                     $parallax->addChild('parallax_title', $_POST['parallax_title'][$cs_counter_parallax]);
                                                                                     $parallax->addChild('parallax_height', $_POST['parallax_height'][$cs_counter_parallax]);
                                                                                     $parallax->addChild('parallax_padding_top', $_POST['parallax_padding_top'][$cs_counter_parallax]);
                                                                                     $parallax->addChild('parallax_padding_bottom', $_POST['parallax_padding_bottom'][$cs_counter_parallax]);
                                                                                     $parallax->addChild('parallax_margin_top', $_POST['parallax_margin_top'][$cs_counter_parallax]);
                                                                                     $parallax->addChild('parallax_margin_bottom', $_POST['parallax_margin_bottom'][$cs_counter_parallax]);
                                                                                     $parallax->addChild('parallax_custom_text', htmlspecialchars($_POST['parallax_custom_text'][$cs_counter_parallax]));
                                                                                     $parallax->addChild('parallax_custom_img', htmlspecialchars($_POST['parallax_custom_img'][$cs_counter_parallax]));
                                                                                     $parallax->addChild('parallax_custom_bgcolor', htmlspecialchars($_POST['parallax_custom_bgcolor'][$cs_counter_parallax]));
                                                                                     $cs_counter_parallax++;
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
                 $cs_counter++;
             }
         }
         update_post_meta($post_id, 'cs_page_builder', $sxe->asXML());
         //creating xml page builder end
     }
 }
예제 #5
0
 function cs_meta_post_save($post_id)
 {
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     if (empty($_POST['post_social_sharing'])) {
         $_POST['post_social_sharing'] = "";
     }
     if (empty($_POST["post_thumb_view"])) {
         $_POST["post_thumb_view"] = "";
     }
     if (empty($_POST["post_featured_image_as_thumbnail"])) {
         $_POST["post_featured_image_as_thumbnail"] = "";
     }
     if (empty($_POST["post_thumb_audio"])) {
         $_POST["post_thumb_audio"] = "";
     }
     if (empty($_POST["post_thumb_video"])) {
         $_POST["post_thumb_video"] = "";
     }
     if (empty($_POST["post_thumb_slider"])) {
         $_POST["post_thumb_slider"] = "";
     }
     if (empty($_POST["post_thumb_slider_type"])) {
         $_POST["post_thumb_slider_type"] = "";
     }
     if (empty($_POST["inside_post_thumb_view"])) {
         $_POST["inside_post_thumb_view"] = "";
     }
     if (empty($_POST["inside_post_featured_image_as_thumbnail"])) {
         $_POST["inside_post_featured_image_as_thumbnail"] = "";
     }
     if (empty($_POST["inside_post_thumb_audio"])) {
         $_POST["inside_post_thumb_audio"] = "";
     }
     if (empty($_POST["inside_post_thumb_video"])) {
         $_POST["inside_post_thumb_video"] = "";
     }
     if (empty($_POST["inside_post_thumb_slider"])) {
         $_POST["inside_post_thumb_slider"] = "";
     }
     if (empty($_POST["inside_post_thumb_slider_type"])) {
         $_POST["inside_post_thumb_slider_type"] = "";
     }
     if (empty($_POST["post_social_sharing"])) {
         $_POST["post_social_sharing"] = "";
     }
     if (empty($_POST["post_author_info_show"])) {
         $_POST["post_author_info_show"] = "";
     }
     if (empty($_POST["post_tags_show"])) {
         $_POST["post_tags_show"] = "";
     }
     if (empty($_POST["post_pagination_show"])) {
         $_POST["post_pagination_show"] = "";
     }
     $sxe = new SimpleXMLElement("<cs_meta_post></cs_meta_post>");
     $sxe->addChild('post_thumb_view', $_POST['post_thumb_view']);
     $sxe->addChild('post_featured_image_as_thumbnail', $_POST['post_featured_image_as_thumbnail']);
     $sxe->addChild('post_thumb_audio', $_POST['post_thumb_audio']);
     $sxe->addChild('post_thumb_video', $_POST['post_thumb_video']);
     $sxe->addChild('post_thumb_slider', $_POST['post_thumb_slider']);
     $sxe->addChild('post_thumb_slider_type', $_POST['post_thumb_slider_type']);
     $sxe->addChild('inside_post_thumb_view', $_POST['inside_post_thumb_view']);
     $sxe->addChild('inside_post_featured_image_as_thumbnail', $_POST['inside_post_featured_image_as_thumbnail']);
     $sxe->addChild('inside_post_thumb_audio', $_POST['inside_post_thumb_audio']);
     $sxe->addChild('inside_post_thumb_video', $_POST['inside_post_thumb_video']);
     $sxe->addChild('inside_post_thumb_slider', $_POST['inside_post_thumb_slider']);
     $sxe->addChild('inside_post_thumb_slider_type', $_POST['inside_post_thumb_slider_type']);
     $sxe->addChild('post_social_sharing', $_POST['post_social_sharing']);
     $sxe->addChild('post_author_info_show', $_POST['post_author_info_show']);
     $sxe->addChild('post_tags_show', htmlspecialchars($_POST['post_tags_show']));
     $sxe->addChild('post_pagination_show', htmlspecialchars($_POST['post_pagination_show']));
     $sxe = save_layout_xml($sxe);
     update_post_meta($post_id, 'post', $sxe->asXML());
 }
예제 #6
0
function events_meta_save($post_id)
{
    global $wpdb;
    //event_calendar, event_pagination, event_tags
    if (empty($_POST["sub_title"])) {
        $_POST["sub_title"] = "";
    }
    if (empty($_POST["event_thumb_view"])) {
        $_POST["event_thumb_view"] = "";
    }
    if (empty($_POST["event_social_sharing"])) {
        $_POST["event_social_sharing"] = "";
    }
    if (empty($_POST["event_buy_now"])) {
        $_POST["event_buy_now"] = "";
    }
    if (empty($_POST["event_start_time"])) {
        $_POST["event_start_time"] = "";
    }
    if (empty($_POST["event_end_time"])) {
        $_POST["event_end_time"] = "";
    }
    if (empty($_POST["event_all_day"])) {
        $_POST["event_all_day"] = "";
    }
    if (empty($_POST["event_address"])) {
        $_POST["event_address"] = "";
    }
    if (empty($_POST["event_ticket_options"])) {
        $_POST["event_ticket_options"] = "";
    }
    if (empty($_POST["event_map"])) {
        $_POST["event_map"] = "";
    }
    if (empty($_POST["event_ticket_price"])) {
        $_POST["event_ticket_price"] = "";
    }
    if (empty($_POST["event_ticket_color"])) {
        $_POST["event_ticket_color"] = "";
    }
    if (empty($_POST["post_author_info_show"])) {
        $_POST["post_author_info_show"] = "";
    }
    if (empty($_POST["event_calendar"])) {
        $_POST["event_calendar"] = "";
    }
    if (empty($_POST["event_pagination"])) {
        $_POST["event_pagination"] = "";
    }
    if (empty($_POST["event_tags"])) {
        $_POST["event_tags"] = "";
    }
    if (empty($_POST["event_like"])) {
        $_POST["event_like"] = "";
    }
    $sxe = new SimpleXMLElement("<event></event>");
    $sxe->addChild('event_thumb_view', $_POST['event_thumb_view']);
    $sxe->addChild('event_social_sharing', $_POST["event_social_sharing"]);
    $sxe->addChild('event_buy_now', $_POST["event_buy_now"]);
    $sxe->addChild('event_start_time', $_POST["event_start_time"]);
    $sxe->addChild('event_end_time', $_POST["event_end_time"]);
    $sxe->addChild('event_ticket_color', $_POST["event_ticket_color"]);
    $sxe->addChild('event_all_day', $_POST["event_all_day"]);
    $sxe->addChild('event_ticket_options', $_POST["event_ticket_options"]);
    $sxe->addChild('event_ticket_color', $_POST["event_ticket_color"]);
    $sxe->addChild('event_address', $_POST["event_address"]);
    $sxe->addChild('event_map', $_POST["event_map"]);
    $sxe->addChild('event_calendar', $_POST["event_calendar"]);
    $sxe->addChild('event_like', $_POST["event_like"]);
    $sxe->addChild('event_pagination', $_POST["event_pagination"]);
    $sxe->addChild('event_tags', $_POST["event_tags"]);
    $sxe->addChild('post_author_info_show', $_POST["post_author_info_show"]);
    $sxe = save_layout_xml($sxe);
    update_post_meta($post_id, 'cs_event_meta', $sxe->asXML());
}