function et_pb_save_layout() { if (!wp_verify_nonce($_POST['et_load_nonce'], 'et_load_nonce')) { die(-1); } if (empty($_POST['et_layout_name'])) { die; } $args = array('layout_type' => isset($_POST['et_layout_type']) ? $_POST['et_layout_type'] : 'layout', 'layout_selected_cats' => isset($_POST['et_layout_cats']) ? $_POST['et_layout_cats'] : '', 'built_for_post_type' => isset($_POST['et_post_type']) ? $_POST['et_post_type'] : 'page', 'layout_new_cat' => isset($_POST['et_layout_new_cat']) ? $_POST['et_layout_new_cat'] : '', 'columns_layout' => isset($_POST['et_columns_layout']) ? $_POST['et_columns_layout'] : '0', 'module_type' => isset($_POST['et_module_type']) ? $_POST['et_module_type'] : 'et_pb_unknown', 'layout_scope' => isset($_POST['et_layout_scope']) ? $_POST['et_layout_scope'] : 'not_global', 'module_width' => isset($_POST['et_module_width']) ? $_POST['et_module_width'] : 'regular', 'layout_content' => isset($_POST['et_layout_content']) ? $_POST['et_layout_content'] : '', 'layout_name' => isset($_POST['et_layout_name']) ? $_POST['et_layout_name'] : ''); $new_layout_meta = et_pb_submit_layout($args); die($new_layout_meta); }
function et_fb_save_layout() { if (!wp_verify_nonce($_POST['et_fb_save_library_modules_nonce'], 'et_fb_save_library_modules_nonce')) { die(-1); } if (!current_user_can('edit_posts')) { die(-1); } if (empty($_POST['et_layout_name'])) { die(-1); } $args = array('layout_type' => isset($_POST['et_layout_type']) ? sanitize_text_field($_POST['et_layout_type']) : 'layout', 'layout_selected_cats' => isset($_POST['et_layout_cats']) ? sanitize_text_field($_POST['et_layout_cats']) : '', 'built_for_post_type' => isset($_POST['et_post_type']) ? sanitize_text_field($_POST['et_post_type']) : 'page', 'layout_new_cat' => isset($_POST['et_layout_new_cat']) ? sanitize_text_field($_POST['et_layout_new_cat']) : '', 'columns_layout' => isset($_POST['et_columns_layout']) ? sanitize_text_field($_POST['et_columns_layout']) : '0', 'module_type' => isset($_POST['et_module_type']) ? sanitize_text_field($_POST['et_module_type']) : 'et_pb_unknown', 'layout_scope' => isset($_POST['et_layout_scope']) ? sanitize_text_field($_POST['et_layout_scope']) : 'not_global', 'module_width' => isset($_POST['et_module_width']) ? sanitize_text_field($_POST['et_module_width']) : 'regular', 'layout_content' => isset($_POST['et_layout_content']) ? et_fb_process_to_shortcode(json_decode(stripslashes($_POST['et_layout_content']), true)) : '', 'layout_name' => isset($_POST['et_layout_name']) ? sanitize_text_field($_POST['et_layout_name']) : ''); $new_layout_meta = et_pb_submit_layout($args); die($new_layout_meta); }