New to Translating WordPress? Read through our Translator Handbook to get started. Hide
| Prio | Original string | Translation | — |
|---|---|---|---|
| ↑ | Widget Logic lets you control on which pages widgets appear using WP's conditional tags. | You have to log in to add a translation. | Details |
Original untranslated
Widget Logic lets you control on which pages widgets appear using WP's conditional tags.
You have to log in to edit this translation. |
|||
| ↑ | Widget Logic | Widget Logic | Details |
Original current |
|||
| }` | You have to log in to add a translation. | Details | |
Original untranslated |
|||
| <strong>Good approach (in functions.php):</strong> | You have to log in to add a translation. | Details | |
Original untranslated
<strong>Good approach (in functions.php):</strong>
CommentFound in description paragraph. You have to log in to edit this translation. |
|||
| function my_allowed_functions($functions) {↵ $functions[] = 'is_special_page';↵ $functions[] = 'is_user_verified';↵ $functions[] = 'get_sidebar_title';↵ return $functions;↵ }` | You have to log in to add a translation. | Details | |
Original untranslated
function my_allowed_functions($functions) {↵
$functions[] = 'is_special_page';↵
$functions[] = 'is_user_verified';↵
$functions[] = 'get_sidebar_title';↵
return $functions;↵
}`
CommentFound in description paragraph. You have to log in to edit this translation. |
|||
| You can add multiple functions by using one wrapper function: | You have to log in to add a translation. | Details | |
Original untranslated
You can add multiple functions by using one wrapper function:
CommentFound in description paragraph. You have to log in to edit this translation. |
|||
| function my_allowed_functions($functions) {↵ $functions[] = '<em>my_custom_function_name</em>';↵ return $functions;↵ }` | You have to log in to add a translation. | Details | |
Original untranslated
function my_allowed_functions($functions) {↵
$functions[] = '<em>my_custom_function_name</em>';↵
return $functions;↵
}`
CommentFound in description paragraph. You have to log in to edit this translation. |
|||
| To add a custom function, add the following code to your theme's <code>functions.php</code> file: | You have to log in to add a translation. | Details | |
Original untranslated
To add a custom function, add the following code to your theme's <code>functions.php</code> file:
CommentFound in description paragraph. You have to log in to edit this translation. |
|||
| <code>custom_function_from_functions_php_to_check_the_page_child_of(13)</code> -- home page OR the page that's a child of page 13 | You have to log in to add a translation. | Details | |
Original untranslated
<code>custom_function_from_functions_php_to_check_the_page_child_of(13)</code> -- home page OR the page that's a child of page 13
CommentFound in description list item. You have to log in to edit this translation. |
|||
| <code>custom_function_from_functions_php_to_check_the_page()</code> -- WP page that is a child of page 77 | You have to log in to add a translation. | Details | |
Original untranslated
<code>custom_function_from_functions_php_to_check_the_page()</code> -- WP page that is a child of page 77
CommentFound in description list item. You have to log in to edit this translation. |
|||
| <code>is_category() && custom_function_to_check_the_category()</code> -- category page that's a descendent of category 5 | You have to log in to add a translation. | Details | |
Original untranslated
<code>is_category() && custom_function_to_check_the_category()</code> -- category page that's a descendent of category 5
CommentFound in description list item. You have to log in to edit this translation. |
|||
| <strong>Less ideal approach (in Widget Logic field):</strong>↵ Avoid putting complex logic directly in the Widget Logic field. Keep it simple and let your custom function handle the complexity. This keeps your widget settings clean and maintainable. | You have to log in to add a translation. | Details | |
Original untranslated
<strong>Less ideal approach (in Widget Logic field):</strong>↵
Avoid putting complex logic directly in the Widget Logic field. Keep it simple and let your custom function handle the complexity. This keeps your widget settings clean and maintainable.
CommentFound in description paragraph. You have to log in to edit this translation. |
|||
| Then in Widget Logic field, simply use: <code>is_special_page()</code> | You have to log in to add a translation. | Details | |
Original untranslated
Then in Widget Logic field, simply use: <code>is_special_page()</code>
CommentFound in description paragraph. You have to log in to edit this translation. |
|||
| <strong>IMPORTANT NOTE ON VARIABLES:</strong> Widget Logic is designed to work with simple data types (strings, numbers, booleans). If you need to use complex variables, global state, or conditional logic that depends on many factors, create a custom function in your theme's <code>functions.php</code> file and call it from Widget Logic: | You have to log in to add a translation. | Details | |
Original untranslated
<strong>IMPORTANT NOTE ON VARIABLES:</strong> Widget Logic is designed to work with simple data types (strings, numbers, booleans). If you need to use complex variables, global state, or conditional logic that depends on many factors, create a custom function in your theme's <code>functions.php</code> file and call it from Widget Logic:
CommentFound in description paragraph. You have to log in to edit this translation. |
|||
| Custom PHP Functions -- From v.6.0.6 you can use the <code>widget_logic_allowed_functions</code> filter to add custom PHP functions that will be allowed in Widget Logic fields. By default, only WordPress conditional tags and a whitelist of safe functions are available. This filter allows you to extend the functionality and use your own custom functions. | You have to log in to add a translation. | Details | |
Original untranslated
Custom PHP Functions -- From v.6.0.6 you can use the <code>widget_logic_allowed_functions</code> filter to add custom PHP functions that will be allowed in Widget Logic fields. By default, only WordPress conditional tags and a whitelist of safe functions are available. This filter allows you to extend the functionality and use your own custom functions.
CommentFound in description paragraph. You have to log in to edit this translation. |
|||
Export as
Comment
Short description.