Uname: Linux p3plzcpnl499967.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Software: Apache
PHP version: 8.2.30 [ PHP INFO ] PHP os: Linux
Server Ip: 208.109.40.231
Your Ip: 216.73.216.26
User: nayff91c5tsx (10005085) | Group: nayff91c5tsx (10005085)
Safe Mode: OFF
Disable Function:
NONE

name : manager.php
<?php
/**
 * Search sources manager
 */
namespace Jet_Search\Search_Sources;

if ( ! defined( 'WPINC' ) ) {
	die;
}

class Manager {

	private $_sources = array();

	public function __construct() {
		add_action( 'init', array( $this, 'register_search_sources' ), 99 );
	}

	public function register_search_sources() {

		require $this->component_path( 'base.php' );
		require $this->component_path( 'source-terms.php' );
		require $this->component_path( 'source-users.php' );

		$this->register_source( new Terms() );
		$this->register_source( new Users() );

		do_action( 'jet-search/sources/register', $this );
	}

    public function component_path( $relative_path = '' ) {
		return Jet_Search()->plugin_path( 'includes/search-sources/' . $relative_path );
	}

    /**
	 * Register search sources
	 *
	 * @param  [type] $instance [description]
	 * @return [type]           [description]
	 */
	public function register_source( $instance ) {
		$this->_sources[ $instance->get_name() ] = $instance;
	}

    public function get_sources() {
		return $this->_sources;
	}

	public function get_source( $source_name ) {
		return isset( $this->_sources[ $source_name ] ) ? $this->_sources[ $source_name ] : false;
	}
}
© 2026 GrazzMean