settings_api = new Bs_Fb_Like_Popup(); add_action( 'admin_init', array($this, 'admin_init') ); add_action( 'admin_menu', array($this, 'admin_menu') ); } public function admin_init() { //set the settings $this->settings_api->set_sections( $this->get_settings_sections() ); $this->settings_api->set_fields( $this->get_settings_fields() ); //initialize settings $this->settings_api->admin_init(); } public function admin_menu() { //$this->base=Bs_Ins_Shortcode_Builder::bs_get_instance(); add_menu_page('FB Popup', 'Fb Popup','manage_options','fb-popup-setting',array($this, 'bs_plugin_page')); //add_submenu_page('instagram-setting', 'Shortcode Builder', 'Shortcode Builder', 'manage_options', 'instagram-setting-builder', array($this->base,'builder_form')); } public function get_settings_sections() { $sections = array( array( 'id' => 'bs_fb_popup_basic', 'title' => __( 'Basic Settings', 'bs_fb_popup' ), ), ); return $sections; } /** * Returns all the settings fields * * @return array settings fields */ public function get_settings_fields() { $settings_fields = array( 'bs_fb_popup_basic' => array( array( 'name' => 'bs_fb_popup_like', 'label' => __( 'Page Url', 'bs_fb_popup' ), 'desc' => __( 'Enter Your Fb Page Url', 'bs_fb_popup' ), 'type' => 'text', 'default' => 'https://www.facebook.com/Dresserie-Boutique-Tailoring-692711967471901/' ), array( 'name' => 'bs_fb_popup_width', 'label' => __( 'Width', 'bs_fb_popup' ), //'desc' => __( 'Enter Your Fb Page Url', 'bs_fb_popup' ), 'type' => 'number', 'default' => 500 ), array( 'name' => 'bs_fb_popup_height', 'label' => __( 'Height', 'bs_fb_popup' ), //'desc' => __( 'Enter Your Fb Page Url', 'bs_fb_popup' ), 'type' => 'number', 'default' => '' ), array( 'name' => 'bs_fb_popup_header', 'label' => __( 'Use Samll Header', 'bs_fb_popup' ), 'type' => 'radio', 'options'=>array( 'true'=>'YES', 'false' =>'NO' ), 'default'=>'false' ), array( 'name' => 'bs_fb_popup_face', 'label' => __( 'Show Friend Faces', 'bs_fb_popup' ), 'type' => 'radio', 'options'=>array( 'true'=>'YES', 'false' =>'NO' ), 'default'=>'true' ), array( 'name' => 'bs_fb_popup_timeline', 'label' => __( 'Show Timeline', 'bs_fb_popup' ), 'type' => 'radio', 'options'=>array( 'timeline'=>'YES', 'false' =>'NO' ), 'default'=>'false' ), array( 'name' => 'bs_fb_popup_pages', 'label' => __( 'Show Popup', 'bs_fb_popup' ), //'desc' => __( 'Enter Your User ID', 'bs_fb_popup' ), 'type' => 'radio', 'options' => array( 'ps_home'=> 'HOME', 'ps_all_pages'=>'All PAGES' ), 'default' => 'ps_home' ), ), ); return $settings_fields; } public function bs_plugin_page() { echo '
'; // Load the base class object. $this->base = new Bs_Fb_Like_Popup(); $this->settings_api->show_navigation(); $this->settings_api->show_forms(); echo '
'; } /** * Get all the pages * * @return array page names with key value pairs */ public function get_pages() { $pages = get_pages(); $pages_options = array(); if ( $pages ) { foreach ($pages as $page) { $pages_options[$page->ID] = $page->post_title; } } return $pages_options; } /** * * Get Option Value * */ public function bs_get_option( $option, $section, $default = '' ) { $options = get_option( $section ); if ( isset( $options[$option] ) ) { return $options[$option]; } return $default; } /** * The ultimate_portfolio Setting Object. * * @since 1.0 * */ public static function bs_get_instance(){ if(!isset($_instance)){ self::$_instance=new Bs_Fb_Popup_Setting(); } return self::$_instance; } } $Bs_Fb_Popup_Setting =Bs_Fb_Popup_Setting::bs_get_instance(); endif;