Astra_Polylang_Compatibility::block_display_condition_sync( array $metas, bool $sync, int $from, int $to, string $lang )
Block display condition metas from syncing between translated hooks.
Description
This prevents display conditions from syncing between translated hooks.
Parameters
- $metas
-
(array) (Required) Meta keys to sync.
- $sync
-
(bool) (Required) Whether to sync.
- $from
-
(int) (Required) Source post ID.
- $to
-
(int) (Required) Target post ID.
- $lang
-
(string) (Required) Language code.
Return
(array) Modified meta keys list.
Source
File: compatibility/class-astra-polylang-compatibility.php
public function block_display_condition_sync( $metas, $sync, $from, $to, $lang ) {
if ( 'astra-advanced-hook' === get_post_type( $from ) || 'astra-advanced-hook' === get_post_type( $to ) ) {
$blocked_metas = array(
'ast-advanced-hook-location',
'ast-advanced-hook-exclusion',
);
$metas = array_diff( $metas, $blocked_metas );
}
return $metas;
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 4.12.0 | Introduced. |