is_add_new = $is_add_new; $this->slider_type = isset( $_REQUEST['rstype'] ) ? esc_html($_REQUEST['rstype']) : ''; $this->parsed_options = null; if(!$is_add_new && isset( $_REQUEST['id'] )) { global $wpdb; $this->slider_id = (int)$_REQUEST['id']; $table = NewRoyalSliderMain::get_sliders_table_name(); $this->res = $wpdb->get_results( $wpdb->prepare( " SELECT * FROM $table WHERE id=%d ", $this->slider_id ), ARRAY_A ); if( isset($this->res[0]) ) { $this->res = $this->res[0]; $this->parsed_options = json_decode($this->res['options'], ARRAY_A); } } $this->build_view(); } function get_slider_options() { require_once('NewRoyalSliderOptions.php'); NewRoyalSliderOptions::output_options( isset($this->res) ? $this->res['options'] : null, $this->slider_type); } function get_slider_items() { if(isset($this->res)) { if(!isset($this->res['slides']) ) { return; } $slides = json_decode($this->res['slides'], true); if(is_array($slides) ) { foreach ($slides as $slide) { echo NewRoyalSliderGallery::get_admin_slide_item($slide); } } } } function build_view() { ?>