'.__('Upgrade to PRO', 'accordion-and-accordion-slider').'', 'manage_options', 'wp-aas-premium', array($this, 'wp_aas_premium_page') ); // Register plugin hire us page add_submenu_page( 'edit.php?post_type='.WP_AAS_POST_TYPE, __('Hire Us', 'accordion-and-accordion-slider'), ''.__('Hire Us', 'accordion-and-accordion-slider').'', 'manage_options', 'wp-aas-hireus', array($this, 'wp_aas_hireus_page') ); } /** * Getting Started Page Html * * @package Accordion and Accordion Slider * @since 1.0.0 */ function wp_aas_premium_page() { include_once( WP_AAS_DIR . '/includes/admin/settings/premium.php' ); } /** * Hire Us Page Html * * @package Accordion and Accordion Slider * @since 1.0.0 */ function wp_aas_hireus_page() { include_once( WP_AAS_DIR . '/includes/admin/settings/hire-us.php' ); } /** * Post Settings Metabox * * @package accordion-and-accordion-slider * @since 1.0.0 */ function wp_aas_post_sett_metabox() { // Getting all post types $all_post_types = array(WP_AAS_POST_TYPE); add_meta_box( 'wp-aas-post-sett', __( 'Settings', 'accordion-and-accordion-slider' ), array($this, 'wp_aas_post_sett_mb_content'), $all_post_types, 'normal', 'high' ); add_meta_box( 'wp-aas-post-slider-sett', __( 'Accordion Parameter', 'accordion-and-accordion-slider' ), array($this, 'wp_aas_post_slider_sett_mb_content'), $all_post_types, 'normal', 'default' ); } /** * Post Settings Metabox HTML * * @package accordion-and-accordion-slider * @since 1.0.0 */ function wp_aas_post_sett_mb_content() { include_once( WP_AAS_DIR .'/includes/admin/metabox/wp-aas-sett-metabox.php'); } /** * Post Settings Metabox HTML * * @package accordion-and-accordion-slider * @since 1.0.0 */ function wp_aas_post_slider_sett_mb_content() { include_once( WP_AAS_DIR .'/includes/admin/metabox/wp-aas-slider-parameter.php'); } /** * Function to save metabox values * * @package accordion-and-accordion-slider * @since 1.0.0 */ function wp_aas_save_metabox_value( $post_id ) { global $post_type; $registered_posts = array(WP_AAS_POST_TYPE); // Getting registered post types if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) // Check Autosave || ( ! isset( $_POST['post_ID'] ) || $post_id != $_POST['post_ID'] ) // Check Revision || ( !current_user_can('edit_post', $post_id) ) // Check if user can edit the post. || ( !in_array($post_type, $registered_posts) ) ) // Check if user can edit the post. { return $post_id; } $prefix = WP_AAS_META_PREFIX; // Taking metabox prefix // Taking variables $gallery_imgs = isset($_POST['wp_aas_img']) ? wp_aas_slashes_deep($_POST['wp_aas_img']) : ''; // Getting Carousel Variables $width = isset($_POST[$prefix.'width']) ? wp_aas_slashes_deep($_POST[$prefix.'width']) : ''; $height = isset($_POST[$prefix.'height']) ? wp_aas_slashes_deep($_POST[$prefix.'height']) : ''; $visible_panels = isset($_POST[$prefix.'visible_panels']) ? wp_aas_slashes_deep($_POST[$prefix.'visible_panels']) : ''; $orientation = isset($_POST[$prefix.'orientation']) ? wp_aas_slashes_deep($_POST[$prefix.'orientation']) : 'horizontal'; $panel_distance = isset($_POST[$prefix.'panel_distance']) ? wp_aas_slashes_deep($_POST[$prefix.'panel_distance']) : ''; $max_openedaccordion_size = isset($_POST[$prefix.'max_openedaccordion_size']) ? wp_aas_slashes_deep($_POST[$prefix.'max_openedaccordion_size']) : ''; $open_panel_on = isset($_POST[$prefix.'open_panel_on']) ? wp_aas_slashes_deep($_POST[$prefix.'open_panel_on']) : 'hover'; $autoplay = isset($_POST[$prefix.'autoplay']) ? wp_aas_slashes_deep($_POST[$prefix.'autoplay']) : 'true'; $mouse_wheel = isset($_POST[$prefix.'mouse_wheel']) ? wp_aas_slashes_deep($_POST[$prefix.'mouse_wheel']) : 'false'; $shadow = isset($_POST[$prefix.'shadow']) ? wp_aas_slashes_deep($_POST[$prefix.'shadow']) : 'true'; // Style option update update_post_meta($post_id, $prefix.'gallery_id', $gallery_imgs); // Updating Carousel settings update_post_meta($post_id, $prefix.'width', $width); update_post_meta($post_id, $prefix.'height', $height); update_post_meta($post_id, $prefix.'visible_panels', $visible_panels); update_post_meta($post_id, $prefix.'shadow', $shadow); update_post_meta($post_id, $prefix.'orientation', $orientation); update_post_meta($post_id, $prefix.'panel_distance', $panel_distance); update_post_meta($post_id, $prefix.'max_openedaccordion_size', $max_openedaccordion_size); update_post_meta($post_id, $prefix.'open_panel_on', $open_panel_on); update_post_meta($post_id, $prefix.'autoplay', $autoplay); update_post_meta($post_id, $prefix.'mouse_wheel', $mouse_wheel); } /** * Add custom column to Post listing page * * @package accordion-and-accordion-slider * @since 1.0.0 */ function wp_aas_posts_columns( $columns ) { $new_columns['wp_aas_shortcode'] = __('Shortcode', 'accordion-and-accordion-slider'); $new_columns['wp_aas_photos'] = __('Number of Photos', 'accordion-and-accordion-slider'); $columns = wp_aas_add_array( $columns, $new_columns, 1, true ); return $columns; } /** * Add custom column data to Post listing page * * @package accordion-and-accordion-slider * @since 1.0.0 */ function wp_aas_post_columns_data( $column, $post_id ) { global $post; // Taking some variables $prefix = WP_AAS_META_PREFIX; switch ($column) { case 'wp_aas_shortcode': echo '