settings_api = new HTBuilder_Settings_API(); add_action( 'admin_init', [ $this, 'admin_init' ] ); add_action( 'admin_menu', [ $this, 'admin_menu' ], 220 ); add_action('admin_enqueue_scripts', [ $this, 'enqueue_admin_scripts' ] ); add_action( 'wsa_form_bottom_htbuilder_general_tabs', [ $this, 'html_general_tabs' ] ); add_action( 'wsa_form_top_htbuilder_element_tabs', [ $this, 'html_popup_box' ] ); } // Admin Initialize function admin_init() { //set the settings $this->settings_api->set_sections( $this->admin_get_settings_sections() ); $this->settings_api->set_fields( $this->admin_fields_settings() ); //initialize settings $this->settings_api->admin_init(); } // Plugins menu Register function admin_menu() { add_menu_page( __( 'HT Builder', 'ht-builder' ), __( 'HT Builder', 'ht-builder' ), 'manage_options', 'htbuilder', array ( $this, 'plugin_page' ), 'dashicons-text-page', 100 ); } // Admin Scripts public function enqueue_admin_scripts(){ // wp core styles wp_enqueue_style( 'wp-jquery-ui-dialog' ); // wp core scripts wp_enqueue_script( 'jquery-ui-dialog' ); wp_enqueue_style( 'htbuilder-admin', HTBUILDER_PL_URL . 'includes/admin/assets/css/admin_optionspanel.css', FALSE, HTBUILDER_VERSION ); wp_enqueue_script( 'htbuilder-admin', HTBUILDER_PL_URL . 'includes/admin/assets/js/admin_scripts.js', array('jquery'), HTBUILDER_VERSION, TRUE ); } // Options page Section register function admin_get_settings_sections() { $sections = array( array( 'id' => 'htbuilder_general_tabs', 'title' => esc_html__( 'General', 'ht-builder' ) ), array( 'id' => 'htbuilder_templatebuilder_tabs', 'title' => esc_html__( 'Template Builder', 'ht-builder' ) ), array( 'id' => 'htbuilder_element_tabs', 'title' => esc_html__( 'Elements', 'ht-builder' ) ), ); return $sections; } // Options page field register protected function admin_fields_settings() { $settings_fields = array( 'htbuilder_general_tabs' => array(), 'htbuilder_templatebuilder_tabs' => array( array( 'name' => 'enablecustomtemplate', 'label' => __( 'Enable Custom template Layout', 'ht-builder' ), 'desc' => __( 'Enable', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'single_blog_page', 'label' => __( 'Single Blog Template.', 'ht-builder' ), 'desc' => __( 'You can select Single blog page from here.', 'ht-builder' ), 'type' => 'select', 'default' => '0', 'options' => htbuilder_elementor_template() ), array( 'name' => 'archive_blog_page', 'label' => __( 'Blog Template.', 'ht-builder' ), 'desc' => __( 'You can select blog page from here.', 'ht-builder' ), 'type' => 'select', 'default' => '0', 'options' => htbuilder_elementor_template() ), array( 'name' => 'header_page', 'label' => __( 'Header Template.', 'ht-builder' ), 'desc' => __( 'You can select header template from here.', 'ht-builder' ), 'type' => 'select', 'default' => '0', 'options' => htbuilder_elementor_template() ), array( 'name' => 'footer_page', 'label' => __( 'Footer Template.', 'ht-builder' ), 'desc' => __( 'You can select footer template from here.', 'ht-builder' ), 'type' => 'select', 'default' => '0', 'options' => htbuilder_elementor_template() ), array( 'name' => 'search_pagep', 'label' => __( 'Search Page Template.', 'ht-builder' ), 'desc' => __( 'You can select search page from here. ( Pro )', 'ht-builder' ), 'type' => 'select', 'default' => 'select', 'options' => array( 'select'=>'Select Template', ), 'class'=>'htproelement', ), array( 'name' => 'error_pagep', 'label' => __( '404 Page Template.', 'ht-builder-pro' ), 'desc' => __( 'You can select 404 page from here. ( Pro )', 'ht-builder-pro' ), 'type' => 'select', 'default' => '0', 'options' => array( 'select'=>'Select Template', ), 'class' =>'htproelement', ), array( 'name' => 'coming_soon_pagep', 'label' => __( 'Coming Soon Page Template.', 'ht-builder-pro' ), 'desc' => __( 'You can select coming soon page from here. ( Pro )', 'ht-builder-pro' ), 'type' => 'select', 'default' => '0', 'options' => array( 'select'=>'Select Template', ), 'class' =>'htproelement', ), ), 'htbuilder_element_tabs'=>array( array( 'name' => 'bl_post_title', 'label' => __( 'Post Title', 'ht-builder' ), 'desc' => __( 'Post Title', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_post_featured_image', 'label' => __( 'Post Featured Image', 'ht-builder' ), 'desc' => __( 'Post Featured Image', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_post_meta_info', 'label' => __( 'Post Meta Info', 'ht-builder' ), 'desc' => __( 'Post Meta Info', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_post_excerpt', 'label' => __( 'Post Excerpt', 'ht-builder' ), 'desc' => __( 'Post Excerpt', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_post_content', 'label' => __( 'Post Content', 'ht-builder' ), 'desc' => __( 'Post Content', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_post_comments', 'label' => __( 'Post Comments', 'ht-builder' ), 'desc' => __( 'Post Comments', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_post_search_form', 'label' => __( 'Post Search Form', 'ht-builder' ), 'desc' => __( 'Post Search Form', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_post_archive', 'label' => __( 'Archive Posts', 'ht-builder' ), 'desc' => __( 'Archive Posts', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_post_archive_title', 'label' => __( 'Archive Title', 'ht-builder' ), 'desc' => __( 'Archive Title', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_page_title', 'label' => __( 'Page Title', 'ht-builder' ), 'desc' => __( 'Page Title', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_site_title', 'label' => __( 'Site Title', 'ht-builder' ), 'desc' => __( 'Site Title', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_site_logo', 'label' => __( 'Site Logo', 'ht-builder' ), 'desc' => __( 'Site Logo', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_nav_menu', 'label' => __( 'Nav Menu', 'ht-builder' ), 'desc' => __( 'Nav Menu', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_post_author_info', 'label' => __( 'Author Info', 'ht-builder' ), 'desc' => __( 'Author Info', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'on', 'class'=>'htbuilder_table_row', ), array( 'name' => 'bl_social_sharep', 'label' => __( 'Social Share ( Pro )', 'ht-builder' ), 'desc' => __( 'Social share', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'off', 'class'=>'htbuilder_table_row pro', ), array( 'name' => 'bl_print_pagep', 'label' => __( 'Print Page ( Pro )', 'ht-builder' ), 'desc' => __( 'Print Page', 'ht-builder' ), 'type' => 'checkbox', 'default' => 'off', 'class'=>'htbuilder_table_row pro', ), array( 'name' => 'bl_view_counterp', 'label' => __( 'View Counter ( Pro )', 'ht-builder' ), 'desc' => __( 'View Counter', 'ht-builder-pro' ), 'type' => 'checkbox', 'default' => 'off', 'class'=>'htbuilder_table_row pro', ), array( 'name' => 'bl_post_navigationp', 'label' => __( 'Post Navigation ( Pro )', 'ht-builder-pro' ), 'desc' => __( 'Post Navigation', 'ht-builder-pro' ), 'type' => 'checkbox', 'default' => 'off', 'class'=>'htbuilder_table_row pro', ), array( 'name' => 'bl_related_postp', 'label' => __( 'Related Post ( Pro )', 'ht-builder-pro' ), 'desc' => __( 'Related Post', 'ht-builder-pro' ), 'type' => 'checkbox', 'default' => 'off', 'class'=>'htbuilder_table_row pro', ), array( 'name' => 'bl_popular_postp', 'label' => __( 'Popular Post ( Pro )', 'ht-builder-pro' ), 'desc' => __( 'Popular Post', 'ht-builder-pro' ), 'type' => 'checkbox', 'default' => 'off', 'class'=>'htbuilder_table_row pro', ), ), ); return array_merge( $settings_fields ); } // Admin Menu Page Render function plugin_page() { echo '