id = 'searching'; $this->label = __( 'Searching', 'als' ); add_filter( 'als_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'als_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'als_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Get settings array. * * @return array */ public function get_settings() { $settings = apply_filters( 'als_searching_settings', array( array( 'title' => __( 'Search Autocomplete', 'als' ), 'type' => 'title', 'desc' => '', 'id' => 'autocomplete_options' ), array( 'title' => __( 'When a user types...', 'als' ), 'desc' =>'', 'id' => 'als_search_behavior', 'css' => '', 'default' => 'live', 'type' => 'radio', 'options' => array( 'live' => 'Display live search results', 'suggest' => 'Suggest search terms', 'none' => 'Do nothing', ), 'desc_tip' => true, ), array( 'title' => __( 'Post Types to Search', 'als' ), 'id' => 'als_post_types', 'css' => '', 'default' => als_post_types(), 'type' => 'textarea', 'desc_tip' => true, ), array( 'type' => 'sectionend', 'id' => 'searching_options' ), array( 'title' => __( 'Ranking', 'als' ), 'type' => 'title', 'desc' => '', 'id' => 'ranking_options' ), array( 'title' => __( 'Title Weight', 'als' ), 'desc' =>'', 'id' => 'als_title_weight', 'css' => 'width: 48px;', 'default' => '15', 'type' => 'text', 'desc_tip' => true, ), array( 'title' => __( 'Content Weight', 'als' ), 'desc' =>'', 'id' => 'als_content_weight', 'css' => 'width: 48px;', 'default' => '1', 'type' => 'text', 'desc_tip' => true, ), array( 'type' => 'sectionend', 'id' => 'ranking_options' ) ) ); return apply_filters( 'als_get_settings_' . $this->id, $settings ); } /** * Save settings. */ public function save() { $settings = $this->get_settings(); Als_Admin_Settings::save_fields( $settings ); } } return new Als_Settings_searching();