prepare("delete from ".$wpdb->prefix."advps_optionset where id = %d",$_POST['optset-id']); if($wpdb->query($q_del)){ delete_option('optset'.$_POST['optset-id']); $stsMgs = "Deleted successfully."; } } if(isset($_POST['advps_submit'])){ if($_POST['advps_submit'] == 'Add new option set'){ if ( !isset($_POST['advps_wpnonce']) || !wp_verify_nonce($_POST['advps_wpnonce'],'advps-checkauthnonce') ) { print 'Sorry, your nonce did not verify.'; exit; } $all_field = $_POST; $tem_list = array('one','two','three'); $template = sanitize_text_field($_POST['template']); if( ! in_array( $template, $tem_list )){ exit; } global $advpsPlist; global $advpsQuery; global $advpsSlide; //global $advpsSlide2; global $advpsCaroTicker; global $advpsContainer; global $advpsContainer2; global $advpsContainer3; global $advpsContent; global $advpsContent2; global $advpsNavigation; if( $template == 'one'){ $q_add = $wpdb->prepare("insert into ".$wpdb->prefix."advps_optionset (template,plist,query,slider,caro_ticker,container,content,navigation) values(%s,%s,%s,%s,%s,%s,%s,%s)",$template,serialize($advpsPlist),serialize($advpsQuery),serialize($advpsSlide),serialize($advpsCaroTicker),serialize($advpsContainer),serialize($advpsContent),serialize($advpsNavigation)); } elseif( $template == 'two'){ $q_add = $wpdb->prepare("insert into ".$wpdb->prefix."advps_optionset (template,plist,query,slider,caro_ticker,container,navigation) values(%s,%s,%s,%s,%s,%s,%s)",$template,serialize($advpsPlist),serialize($advpsQuery),serialize($advpsSlide),serialize($advpsCaroTicker),serialize($advpsContainer2),serialize($advpsNavigation)); } elseif($template == 'three'){ $q_add = $wpdb->prepare("insert into ".$wpdb->prefix."advps_optionset (template,plist,query,slider,caro_ticker,container,content,navigation) values(%s,%s,%s,%s,%s,%s,%s,%s)",$template,serialize($advpsPlist),serialize($advpsQuery),serialize($advpsSlide),serialize($advpsCaroTicker),serialize($advpsContainer3),serialize($advpsContent2),serialize($advpsNavigation)); } if($wpdb->query($q_add)){ update_option('advpssmethod'.$_POST['nextoptid'],'plist'); $stsMgs = "Added successfully."; } } } if(isset($_POST['advps_add_thumb'])){ if($_POST['advps_add_thumb'] == 'Add'){ if ( !isset($_POST['advps_wpnonce']) || !wp_verify_nonce($_POST['advps_wpnonce'],'advps-checkauthnonce') ) { print 'Sorry, your nonce did not verify.'; exit; } $thumb_name = sanitize_text_field($_POST['advps_thumb_name']); $width = sanitize_text_field($_POST['advps_thumb_width']); $height = sanitize_text_field($_POST['advps_thumb_height']); $crop = sanitize_text_field($_POST['advps_crop']); $q = $wpdb->prepare("insert into ".$wpdb->prefix."advps_thumbnail (thumb_name,width,height,crop) values(%s,%d,%d,%s)",$thumb_name,$width,$height,$crop); if($wpdb->query($q)){ $stsMgs = "Added successfully."; } } } if(isset($_POST['update_thumb'])){ if ( !isset($_POST['advps_wpnonce']) || !wp_verify_nonce($_POST['advps_wpnonce'],'advps-checkauthnonce') ) { print 'Sorry, your nonce did not verify.'; exit; } $thumb_id = sanitize_text_field($_POST['thumb_id']); $thumb_name = sanitize_text_field($_POST['advps_thumb_name']); $width = sanitize_text_field($_POST['advps_thumb_width']); $height = sanitize_text_field($_POST['advps_thumb_height']); $crop = sanitize_text_field($_POST['advps_crop']); $q = $wpdb->prepare("update ".$wpdb->prefix."advps_thumbnail set thumb_name = '%s',width = %d, height = %d, crop = '%s' where id = %d",$thumb_name,$width,$height,$crop,$thumb_id); if($wpdb->query($q)){ $stsMgs = "Updated successfully."; } } $q1 = "select * from ".$wpdb->prefix."advps_optionset where template = 'one'"; $q2 = "select * from ".$wpdb->prefix."advps_optionset where template = 'two'"; $q3 = "select * from ".$wpdb->prefix."advps_optionset where template = 'three'"; $res1 = $wpdb->get_results($q1); $res2 = $wpdb->get_results($q2); $res3 = $wpdb->get_results($q3); $q_thumb = "select * from ".$wpdb->prefix."advps_thumbnail"; $res_thumb = $wpdb->get_results($q_thumb); $catList = get_categories(); $customPostTypes = get_post_types(array('public' => true, '_builtin' => false)); ?>

Thumbnail settings

Name  Width  px   Height  px Crop 

N.B. From version 2 you dont need to re-generate your existing post thumbnail after creating a new thumbnail size or changing dimensions of existing advps thumbnail size.

Add thumbnail

Name  Width  px   Height  px Crop