PHP Class EP_Sync_Manager

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

Public Properties

Property Type Description
$sync_post_queue array Save posts for indexing later

Public Methods

Method Description
__construct ( ) Placeholder method
action_delete_blog_from_index ( $blog_id ) Remove blog from index when a site is deleted, archived, or deactivated
action_delete_post ( integer $post_id ) Delete ES post when WP post is deleted
action_index_sync_queue ( ) Sync queued posts on shutdown. We do this in case a post is updated multiple times.
action_queue_meta_sync ( integer $meta_id, integer $object_id, string $meta_key, string $meta_value ) When whitelisted meta is updated, queue the post for reindex
action_sync_on_update ( $post_ID ) Sync ES index with what happened to the post being saved
destroy ( ) Remove actions and filters
factory ( ) : EP_Sync_Manager Return a singleton instance of the current class
setup ( ) Setup actions and filters
sync_post ( integer $post_id, boolean $blocking = true ) : boolean | array Sync a post for a specific site or globally.

Method Details

__construct() public method

Placeholder method
Since: 0.1.0
public __construct ( )

action_delete_blog_from_index() public method

Remove blog from index when a site is deleted, archived, or deactivated
public action_delete_blog_from_index ( $blog_id )
$blog_id

action_delete_post() public method

Delete ES post when WP post is deleted
Since: 0.1.0
public action_delete_post ( integer $post_id )
$post_id integer

action_index_sync_queue() public method

Sync queued posts on shutdown. We do this in case a post is updated multiple times.
Since: 2.0

action_queue_meta_sync() public method

When whitelisted meta is updated, queue the post for reindex
Since: 2.0
public action_queue_meta_sync ( integer $meta_id, integer $object_id, string $meta_key, string $meta_value )
$meta_id integer
$object_id integer
$meta_key string
$meta_value string

action_sync_on_update() public method

Sync ES index with what happened to the post being saved
Since: 0.1.0
public action_sync_on_update ( $post_ID )
$post_ID

destroy() public method

Remove actions and filters
Since: 1.4
public destroy ( )

factory() public static method

Return a singleton instance of the current class
Since: 0.1.0
public static factory ( ) : EP_Sync_Manager
return EP_Sync_Manager

setup() public method

Setup actions and filters
Since: 0.1.2
public setup ( )

sync_post() public method

Sync a post for a specific site or globally.
Since: 0.1.0
public sync_post ( integer $post_id, boolean $blocking = true ) : boolean | array
$post_id integer
$blocking boolean
return boolean | array

Property Details

$sync_post_queue public_oe property

Save posts for indexing later
Since: 2.0
public array $sync_post_queue
return array