oxygen-conditions.php
Oxygen Builder Conditions
Provides conditional logic for Oxygen Builder based on post language settings.
Tags
Table of Contents
Functions
- jpkcom_simplelang_get_oxygen_language_options() : array<string, string>
- Get language options for Oxygen Builder
- jpkcom_simplelang_oxygen_post_language_is() : bool
- Oxygen condition callback: Post language is specific value
- jpkcom_simplelang_oxygen_has_custom_language() : bool
- Oxygen condition callback: Post has custom language
- jpkcom_simplelang_oxygen_uses_default_language() : bool
- Oxygen condition callback: Post uses default language
Functions
jpkcom_simplelang_get_oxygen_language_options()
Get language options for Oxygen Builder
jpkcom_simplelang_get_oxygen_language_options() : array<string, string>
Returns an array of available languages formatted for Oxygen Builder conditions.
Tags
Return values
array<string, string> —Array of language codes and names.
jpkcom_simplelang_oxygen_post_language_is()
Oxygen condition callback: Post language is specific value
jpkcom_simplelang_oxygen_post_language_is(string $value, string $operator) : bool
Checks if the post has a specific language set.
Parameters
- $value : string
-
The language code to check.
- $operator : string
-
The comparison operator (== or !=).
Tags
Return values
bool —True if the condition matches.
jpkcom_simplelang_oxygen_has_custom_language()
Oxygen condition callback: Post has custom language
jpkcom_simplelang_oxygen_has_custom_language(string $value, string $operator) : bool
Checks if the post has any custom language set (not using site default).
Parameters
- $value : string
-
The value to check ('true' or 'false').
- $operator : string
-
The comparison operator (always ==).
Tags
Return values
bool —True if the condition matches.
jpkcom_simplelang_oxygen_uses_default_language()
Oxygen condition callback: Post uses default language
jpkcom_simplelang_oxygen_uses_default_language(string $value, string $operator) : bool
Checks if the post is using the site default language (no custom language set).
Parameters
- $value : string
-
The value to check ('true' or 'false').
- $operator : string
-
The comparison operator (always ==).
Tags
Return values
bool —True if the condition matches.