# propertyhive/2.2.4/includes/admin/settings/class-ph-settings-page.php

Property Hive, version 2.2.4. 94 lines.

- Page: https://pluginprobe.com/plugins/propertyhive/2.2.4/code/includes/admin/settings/class-ph-settings-page.php
- Raw: https://pluginprobe.com/plugins/propertyhive/2.2.4/raw/includes/admin/settings/class-ph-settings-page.php
- Modified: 2025-05-13T08:38:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/propertyhive/2.2.4/code/includes/admin/settings/class-ph-settings-page.php#L10-L20`.

```php
<?php
/**
 * PropertyHive Settings Page/Tab
 *
 * @author 		PropertyHive
 * @category 	Admin
 * @package 	PropertyHive/Admin
 * @version     1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

if ( ! class_exists( 'PH_Settings_Page' ) ) :

/**
 * PH_Settings_Page
 */
class PH_Settings_Page {

	protected $id    = '';
	protected $label = '';

	/**
	 * Add this page to settings
	 */
	public function add_settings_page( $pages ) {
		$pages[ $this->id ] = $this->label;

		return $pages;
	}

	/**
	 * Get settings array
	 *
	 * @return array
	 */
	public function get_settings() {
		return array();
	}

	/**
	 * Get sections
	 *
	 * @return array
	 */
	public function get_sections() {
		return array();
	}

	/**
	 * Output sections
	 */
	public function output_sections() {
		global $current_section;

		$sections = $this->get_sections();

		if ( empty( $sections ) )
			return;

		echo '<ul class="subsubsub">';

		$array_keys = array_keys( $sections );

		foreach ( $sections as $id => $label )
			echo '<li>&nbsp;<a href="' . esc_url(admin_url( 'admin.php?page=ph-settings&tab=' . $this->id . '&section=' . sanitize_title( $id ) ) ) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . esc_html($label) . '</a> ' . ( end( $array_keys ) == $id ? '' : '| ' ) . ' </li>';

		echo '</ul><br class="clear" />';
	}

	/**
	 * Output the settings
	 */
	public function output() {
		$settings = $this->get_settings();

		PH_Admin_Settings::output_fields( $settings );
	}

	/**
	 * Save settings
	 */
	public function save() {
		global $current_section;

		$settings = $this->get_settings();
		PH_Admin_Settings::save_fields( $settings );

		 if ( $current_section )
	    	do_action( 'propertyhive_update_options_' . $this->id . '_' . $current_section );
	}
}

endif;
```
