WPML
in package
implements
IOverrideWPML
Uses
WPML, UtilsProvider
This class handles the compatibility for WPML.
Table of Contents
Interfaces
Properties
- $me : mixed
- $previousFolderId : mixed
- Avoid duplicate call of move action.
- $previousIds : mixed
- Avoid duplicate call of move action.
Methods
- _dbDeltaCountCache() : mixed
- Create the icl_count table.
- dbDeltaCountCache() : mixed
- Create a count cache table with dbDelta functionality.
- getActiveLanguages() : array<string|int, string>
- Get active WPML language codes.
- getDefaultId() : int
- Get the default id for an attachment.
- getInstance() : WPML
- Get instance.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- getSingleCountSql() : string
- Get the single SQL for the subquery of count getter.
- html_options_move() : mixed
- Option to move files also when a translation gets moved.
- init() : mixed
- Initialize actions and filters.
- isActive() : mixed
- Check if WPML plugin is active.
- isDefaultLanguage() : bool
- Check if current active language is default.
- item_move_finished() : mixed
- A file is moved (not copied) and then move also all the translations.
- localize() : array<string|int, mixed>
- Localize frontend.
- options_register() : mixed
- Register option for PolyLang.
- overrideInit() : mixed
- resetCountCache() : mixed
- Reset the count cache for WPML regarding the active languages.
- scripts_skip() : mixed
- Skip RML scripts in String Translations as it leads to conflicts with `antd`.
- sortable_ids() : mixed
- sqlstatement_join() : array<string|int, string>
- Add a JOIN to the WPML count cache table.
- sqlstatement_order() : mixed
- sqlstatement_select_fields() : array<string|int, string>
- Load the cnt from the WPML count cache table.
- updateCountCache() : mixed
- Update the count cache for WPML regarding the active languages.
- wpml_count_attachments() : int
- Count attachments through WPML tables.
- wpml_media_create_duplicate_attachment() : mixed
- New translation created => synchronize with original post.
- wpml_update_active_languages() : mixed
- Fired when wpml language gets activated.
- __construct() : mixed
- C'tor.
Properties
$me
private
static mixed
$me
= null
$previousFolderId
Avoid duplicate call of move action.
private
mixed
$previousFolderId
= null
$previousIds
Avoid duplicate call of move action.
private
mixed
$previousIds
= null
Methods
_dbDeltaCountCache()
Create the icl_count table.
public
_dbDeltaCountCache() : mixed
dbDeltaCountCache()
Create a count cache table with dbDelta functionality.
public
dbDeltaCountCache() : mixed
getActiveLanguages()
Get active WPML language codes.
public
getActiveLanguages() : array<string|int, string>
Return values
array<string|int, string>getDefaultId()
Get the default id for an attachment.
public
getDefaultId(int $attachment) : int
Parameters
- $attachment : int
Return values
intgetInstance()
Get instance.
public
static getInstance() : WPML
Return values
WPMLgetPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringgetSingleCountSql()
Get the single SQL for the subquery of count getter.
public
getSingleCountSql(string $code[, string $fieldId = 'tn.fid' ]) : string
Parameters
- $code : string
- $fieldId : string = 'tn.fid'
Return values
stringhtml_options_move()
Option to move files also when a translation gets moved.
public
html_options_move() : mixed
init()
Initialize actions and filters.
public
init() : mixed
isActive()
Check if WPML plugin is active.
public
isActive() : mixed
isDefaultLanguage()
Check if current active language is default.
public
isDefaultLanguage() : bool
Return values
boolitem_move_finished()
A file is moved (not copied) and then move also all the translations.
public
item_move_finished(int $folderId, array<string|int, int> $ids, IFolder $folder, bool $isShortcut) : mixed
Parameters
- $folderId : int
- $ids : array<string|int, int>
- $folder : IFolder
- $isShortcut : bool
localize()
Localize frontend.
public
localize(array<string|int, mixed> $arr) : array<string|int, mixed>
Parameters
- $arr : array<string|int, mixed>
Return values
array<string|int, mixed>options_register()
Register option for PolyLang.
public
options_register() : mixed
overrideInit()
public
overrideInit() : mixed
resetCountCache()
Reset the count cache for WPML regarding the active languages.
public
resetCountCache(int $folderId) : mixed
Parameters
- $folderId : int
scripts_skip()
Skip RML scripts in String Translations as it leads to conflicts with `antd`.
public
scripts_skip(bool $skip, string $type, string $hook_suffix) : mixed
Parameters
- $skip : bool
-
True for skip and false for load
- $type : string
-
The context type
- $hook_suffix : string
-
The current admin page
sortable_ids()
public
sortable_ids(mixed $ids) : mixed
Parameters
- $ids : mixed
sqlstatement_join()
Add a JOIN to the WPML count cache table.
public
sqlstatement_join(array<string|int, string> $joins) : array<string|int, string>
Parameters
- $joins : array<string|int, string>
Return values
array<string|int, string>sqlstatement_order()
public
sqlstatement_order(mixed $pieces, mixed $query, mixed $folder) : mixed
Parameters
- $pieces : mixed
- $query : mixed
- $folder : mixed
sqlstatement_select_fields()
Load the cnt from the WPML count cache table.
public
sqlstatement_select_fields(array<string|int, string> $fields) : array<string|int, string>
Parameters
- $fields : array<string|int, string>
Return values
array<string|int, string>updateCountCache()
Update the count cache for WPML regarding the active languages.
public
updateCountCache(array<string|int, int> $folders, array<string|int, int> $attachments, string $where) : mixed
Parameters
- $folders : array<string|int, int>
- $attachments : array<string|int, int>
- $where : string
wpml_count_attachments()
Count attachments through WPML tables.
public
wpml_count_attachments(int $count) : int
Parameters
- $count : int
Tags
Return values
intwpml_media_create_duplicate_attachment()
New translation created => synchronize with original post.
public
wpml_media_create_duplicate_attachment(int $post_id, int $tr_id) : mixed
Then reset the count cache for the unorganized folder.
Parameters
- $post_id : int
- $tr_id : int
wpml_update_active_languages()
Fired when wpml language gets activated.
public
wpml_update_active_languages() : mixed
__construct()
C'tor.
private
__construct() : mixed