id = 'features'; $this->label = __( 'Features', 'propertyhive' ); add_filter( 'propertyhive_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'propertyhive_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'propertyhive_admin_field_pro_features', array( $this, 'pro_features_setting' ) ); } public function get_settings() { $settings = array( array( 'title' => __( 'Active Features', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'pro_active_features_settings' ) ); $settings[] = array( 'type' => 'pro_features', ); $settings[] = array( 'type' => 'sectionend', 'id' => 'pro_active_features_settings'); return $settings; } public function pro_features_setting() { $features = get_ph_pro_features(); echo '
'; // filters $categories = array( '' => 'All', 'import' => 'Property Import', 'export' => 'Portal Feeds', 'website' => 'Website Tools', 'crm' => 'CRM Tools', 'data-bridges' => 'Data Bridges', 'free' => 'Free', ); // Read-only category selection: no settings are changed by this query parameter. // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Publicly linkable display filter only; no state mutation. $requested_category = isset( $_GET['profilter'] ) && is_string( $_GET['profilter'] ) ? sanitize_text_field( wp_unslash( $_GET['profilter'] ) ) : ''; $selected_category = array_key_exists( $requested_category, $categories ) ? $requested_category : ''; echo '
'; echo ''; echo '
'; // Check if AI Property Search is in list. If not, it can't have been launched yet and to show promo instead /*$ai_property_search_found = false; foreach ( $features as $feature ) { $slug = explode("/", $feature['wordpress_plugin_file']); $slug = $slug[0]; if ( strpos($slug, 'propertyhive-ai-property-search') !== false ) { $ai_property_search_found = true; break; } }*/ // list of features echo '
'; echo '
'; echo '
'; } /** * Output the settings */ public function output() { global $current_section, $hide_save_button; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Shared admin settings-view state; this global is intentionally used to control the common settings template and is not an arbitrary application global. $hide_save_button = true; $settings = $this->get_settings(); PH_Admin_Settings::output_fields( $settings ); } } endif; return new PH_Settings_Features();