$task(); } $this->display(); } public function display() { require_once WD_BWG_DIR . "/admin/models/BWGModelBWGShortcode.php"; $model = new BWGModelBWGShortcode(); require_once WD_BWG_DIR . "/admin/views/BWGViewBWGShortcode.php"; $view = new BWGViewBWGShortcode($model); $view->display(); } public function save() { global $wpdb; $tagtext = ((isset($_POST['tagtext'])) ? stripslashes($_POST['tagtext']) : ''); if ($tagtext) { $id = ((isset($_POST['currrent_id'])) ? (int) esc_html(stripslashes($_POST['currrent_id'])) : 0); $insert = ((isset($_POST['bwg_insert'])) ? (int) esc_html(stripslashes($_POST['bwg_insert'])) : 0); if (!$insert) { $save = $wpdb->update($wpdb->prefix . 'bwg_shortcode', array( 'tagtext' => $tagtext ), array('id' => $id)); } else { $save = $wpdb->insert($wpdb->prefix . 'bwg_shortcode', array( 'id' => $id, 'tagtext' => $tagtext ), array( '%d', '%s' )); } } } //////////////////////////////////////////////////////////////////////////////////////// // Getters & Setters // //////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////// // Private Methods // //////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////// // Listeners // //////////////////////////////////////////////////////////////////////////////////////// }