Sync
in package
Language specific action and filters to sync them language-wide. The earliest time you can instance this class is `plugins_loaded`.
Table of Contents
Properties
- $compLanguage : AbstractSyncPlugin
- Abstract language implementation.
- $currentlySyncing : mixed
- $enabled : mixed
- $lastCreatedId : int|false
- The last created term or post id.
- $posts : mixed
- $taxonomies : mixed
Methods
- __construct() : mixed
- C'tor.
- compInstance() : mixed
- Get compatibility language instance.
- created_term() : mixed
- A term in a taxonomy got created, create duplicates for each language.
- disable() : mixed
- Disable the sync mechanism.
- enable() : mixed
- Enable the sync mechanism.
- getLastCreatedId() : mixed
- Getter.
- getPostsConfiguration() : mixed
- Get posts configuration passed via C'tor.
- getTaxonomies() : mixed
- Get taxonomies configuration passed via C'tor.
- isCurrentlySyncing() : bool
- Is it currently syncing (e.g. copies a term or post to another language)?
- isEnabled() : bool
- Is the syncing mechanism enabled?
- rest_api_init() : mixed
- Initialize `POST wp/v2/${taxonomy_or_post_type}/copy` REST API endpoints, which allows to copy posts and taxonomies to other languages.
- save_post() : mixed
- A post was saved, create duplicates for other languages, or sync meta and column if update.
- startCopyProcess() : mixed
- Create an instance of `CopyContent`.
- updated_postmeta() : mixed
- Sync a set of copyable metas to other languages for defined post types.
- updated_term_meta() : mixed
- Sync a set of copyable metas to other languages for defined taxonomies.
- hooks() : mixed
- Create sync hooks.
Properties
$compLanguage
Abstract language implementation.
private
AbstractSyncPlugin
$compLanguage
$currentlySyncing
private
mixed
$currentlySyncing
= false
$enabled
private
mixed
$enabled
$lastCreatedId
The last created term or post id.
private
int|false
$lastCreatedId
= false
$posts
private
mixed
$posts
$taxonomies
private
mixed
$taxonomies
Methods
__construct()
C'tor.
public
__construct(array<string|int, mixed> $posts, array<string|int, mixed> $taxonomies, AbstractSyncPlugin $compLanguage) : mixed
Parameters
- $posts : array<string|int, mixed>
- $taxonomies : array<string|int, mixed>
- $compLanguage : AbstractSyncPlugin
Tags
compInstance()
Get compatibility language instance.
public
compInstance() : mixed
created_term()
A term in a taxonomy got created, create duplicates for each language.
public
created_term(int $term_id, int $tt_id, string $taxonomy) : mixed
Parameters
- $term_id : int
- $tt_id : int
- $taxonomy : string
disable()
Disable the sync mechanism.
public
disable() : mixed
enable()
Enable the sync mechanism.
public
enable() : mixed
getLastCreatedId()
Getter.
public
getLastCreatedId() : mixed
getPostsConfiguration()
Get posts configuration passed via C'tor.
public
getPostsConfiguration() : mixed
Tags
getTaxonomies()
Get taxonomies configuration passed via C'tor.
public
getTaxonomies() : mixed
Tags
isCurrentlySyncing()
Is it currently syncing (e.g. copies a term or post to another language)?
public
isCurrentlySyncing() : bool
Tags
Return values
boolisEnabled()
Is the syncing mechanism enabled?
public
isEnabled() : bool
Tags
Return values
boolrest_api_init()
Initialize `POST wp/v2/${taxonomy_or_post_type}/copy` REST API endpoints, which allows to copy posts and taxonomies to other languages.
public
rest_api_init() : mixed
save_post()
A post was saved, create duplicates for other languages, or sync meta and column if update.
public
save_post(int $postId, WP_Post $post, bool $update) : mixed
Parameters
- $postId : int
- $post : WP_Post
- $update : bool
startCopyProcess()
Create an instance of `CopyContent`.
public
startCopyProcess() : mixed
updated_postmeta()
Sync a set of copyable metas to other languages for defined post types.
public
updated_postmeta(int $meta_id, int $post_id, string $meta_key, mixed $meta_value) : mixed
Parameters
- $meta_id : int
-
ID of updated metadata entry.
- $post_id : int
-
Post ID.
- $meta_key : string
-
Metadata key.
- $meta_value : mixed
-
Metadata value. This will be a PHP-serialized string representation of the value if the value is an array, an object, or itself a PHP-serialized string.
updated_term_meta()
Sync a set of copyable metas to other languages for defined taxonomies.
public
updated_term_meta(int $meta_id, int $term_id, string $meta_key, mixed $meta_value) : mixed
Parameters
- $meta_id : int
-
ID of updated metadata entry.
- $term_id : int
-
Term ID.
- $meta_key : string
-
Metadata key.
- $meta_value : mixed
-
Metadata value. This will be a PHP-serialized string representation of the value if the value is an array, an object, or itself a PHP-serialized string.
hooks()
Create sync hooks.
protected
hooks() : mixed