PHP Class EP_Config

Show file Open project: 10up/elasticpress Class Usage Examples

Public Properties

Property Type Description
$option_host boolean True if EP_HOST has been set via option or false.

Public Methods

Method Description
factory ( ) : EP_Config Get a singleton instance of the class
get_host ( ) : string | boolean Retrieve the appropriate host. Will default to EP_HOST constant if it exists
get_index_name ( integer $blog_id = null ) : string Generates the index name for the current site
get_indexable_post_status ( ) : array Return indexable post_status for the current site
get_indexable_post_types ( ) : mixed | void Returns indexable post types for the current site
get_network_alias ( ) : string Generate network index name for alias
host_by_option ( ) : boolean Determine if host is set in options rather than a constant
is_indexing ( ) : boolean Determine if ElasticPress is in the middle of an index
is_indexing_wpcli ( ) : boolean Check if wpcli indexing is occuring
is_network ( string $plugin ) : boolean Whether plugin is network activated

Method Details

factory() public static method

Get a singleton instance of the class
Since: 0.1.0
public static factory ( ) : EP_Config
return EP_Config

get_host() public method

Retrieve the appropriate host. Will default to EP_HOST constant if it exists
Since: 2.1
public get_host ( ) : string | boolean
return string | boolean

get_index_name() public method

Generates the index name for the current site
Since: 0.9
public get_index_name ( integer $blog_id = null ) : string
$blog_id integer (optional) Blog ID. Defaults to current blog.
return string

get_indexable_post_status() public method

Return indexable post_status for the current site
Since: 1.3
public get_indexable_post_status ( ) : array
return array

get_indexable_post_types() public method

Returns indexable post types for the current site
Since: 0.9
public get_indexable_post_types ( ) : mixed | void
return mixed | void

get_network_alias() public method

Generate network index name for alias
Since: 0.9
public get_network_alias ( ) : string
return string

host_by_option() public method

Determine if host is set in options rather than a constant
Since: 2.1
public host_by_option ( ) : boolean
return boolean

is_indexing() public method

Determine if ElasticPress is in the middle of an index
Since: 2.1
public is_indexing ( ) : boolean
return boolean

is_indexing_wpcli() public method

Check if wpcli indexing is occuring
Since: 2.1
public is_indexing_wpcli ( ) : boolean
return boolean

is_network() public method

Determines whether plugin is network activated or just on the local site.
Since: 1.8
public is_network ( string $plugin ) : boolean
$plugin string the plugin base name.
return boolean True if network activated or false

Property Details

$option_host public property

True if EP_HOST has been set via option or false.
Since: 1.8
public bool $option_host
return boolean