/** * * * @update 1.1.3 * */ function __construct() { add_action('init', array($this, 'init_post_type')); if (!st_check_service_available($this->post_type)) { return; } // Check class init if (self::$_is_inited) { return; } self::$_is_inited = TRUE; //Add metabox add_action('init', array($this, 'init_metabox')); add_filter('manage_st_activity_posts_columns', array($this, 'add_col_header'), 10); add_action('manage_st_activity_posts_custom_column', array($this, 'add_col_content'), 10, 2); //=============================================================== self::$booking_page = admin_url('edit.php?post_type=st_activity&page=st_activity_booking'); add_action('admin_menu', array($this, 'add_menu_page')); //Check booking edit and redirect if (self::is_booking_page()) { add_action('admin_enqueue_scripts', array(__CLASS__, 'add_edit_scripts')); add_action('admin_init', array($this, '_do_save_booking')); } if (isset($_GET['send_mail']) and $_GET['send_mail'] == 'success') { self::set_message(__('Email sent', ST_TEXTDOMAIN), 'updated'); } add_action('wp_ajax_st_room_select_ajax', array(__CLASS__, 'st_room_select_ajax')); add_action('save_post', array($this, 'meta_update_sale_price'), 10, 4); parent::__construct(); add_action('save_post', array($this, '_update_list_location'), 50, 2); add_action('save_post', array($this, '_update_duplicate_data'), 50, 2); add_action('before_delete_post', array($this, '_delete_data'), 50); add_action('wp_ajax_st_getInfoActivity', array(__CLASS__, '_getInfoActivity'), 9999); }
/** * * * @update 1.1.3 * */ function __construct() { add_action('init', array($this, 'init_post_type')); if (!st_check_service_available($this->post_type)) { return; } // Check class init if (self::$_is_inited) { return; } self::$_is_inited = TRUE; //Add metabox add_action('init', array($this, 'init_metabox')); // add_action( 'save_post', array($this,'activity_update_location') ); add_filter('manage_st_activity_posts_columns', array($this, 'add_col_header'), 10); add_action('manage_st_activity_posts_custom_column', array($this, 'add_col_content'), 10, 2); //=============================================================== self::$booking_page = admin_url('edit.php?post_type=st_activity&page=st_activity_booking'); add_action('admin_menu', array($this, 'add_menu_page')); //Check booking edit and redirect if (self::is_booking_page()) { add_action('admin_enqueue_scripts', array(__CLASS__, 'add_edit_scripts')); $section = isset($_GET['section']) ? $_GET['section'] : FALSE; switch ($section) { case "edit_order_item": $this->is_able_edit(); break; case "add_booking": if (isset($_POST['submit']) and $_POST['submit']) { $this->_add_booking(); } break; case 'resend_email_activity': add_action('init', array($this, '_resend_mail')); //$this->_resend_mail(); break; } } if (isset($_GET['send_mail']) and $_GET['send_mail'] == 'success') { self::set_message(__('Email sent', ST_TEXTDOMAIN), 'updated'); } add_action('wp_ajax_st_room_select_ajax', array(__CLASS__, 'st_room_select_ajax')); add_action('save_post', array($this, 'meta_update_sale_price'), 10, 4); parent::__construct(); }