Viktor Szépe
Forum Replies Created
-
Forum: Plugins
In reply to: [Firelight Lightbox] Please consider not printing scriptsYou shouldn’t put strings in a variable by ob_start + echo + ob_end_flush.
Simply add all those strings to an array
$script[] = "var a = 0";
then feed them to wp_add_inline_script byimplode( "\n", $script );Be aware that wp_add_inline_script() is available from WP 4.5.0 only.
All the best to you!
Forum: Plugins
In reply to: [Custom Content Shortcode] Shortcake UIAlso there could be a Meta Shortcodes-displaying shortcake:
[meta-shortcode id=”115″]
with one UI field: a post_select.
Off: I am working on a Shortcake-based solution when Meta Shortcodes CPT is called “Content Blokk”. They cannot be accessed by a shortcode=post title, but only be the above described blokk-displaying shortcode called
[blokk]and its UI.Forum: Plugins
In reply to: [Custom Content Shortcode] Shortcake UIIt is really user friendly.
You may
– select a shortcode from a list
– edit attributes on a proper UI
– see!! the output on the backend tooForum: Plugins
In reply to: [Polylang] Theme options pageThank you very much.
I think the translation will be done in Strings Translation.
Forum: Plugins
In reply to: [Polylang] Theme options pageThank you.
If the original value (the base of translation) changes, should we re-translate to all languages?
How could I handle ‘my_option’ as it is a big associative (hierarchical) array?
Forum: Plugins
In reply to: [Polylang] Theme options pageThank you for your help.
I think there’s a confusion. These values from the “theme’s Option Page” are not translation of something.
/** *Build a Translation_Entry from original string and translation strings, */ function &make_entry($original, $translation)Think of it like a field called: Label of call to action button = “Buy now” in English
= “Acheter maintenant” in French, but there is no original value which could be the base of the translation, it is a free input field.Or am I misunderstanding something?
Forum: Plugins
In reply to: [HTML Editor Syntax Highlighter] Mention CodeMirrorThanks.
Forum: Plugins
In reply to: [Polylang] Theme options pageThank you!
I’d like to repeat that my project is a Theme Options Page maker.
So all data may change any time.
It is not the fixed hard-coded string -> translated string relation.Let’s say there are few inputs. Currently these are stored in an option as an associative/hierarchical array.
So you’re saying that I should store every individual field in a PLL_MO object?ps. These fields can be select-s or checkboxes which are not strings but could be different in different languages.
Forum: Plugins
In reply to: [Polylang] Theme options pageIf your theme if for public release
Actually this is an options page maker for themes.
Forum: Plugins
In reply to: [Polylang] Theme options pageCould you help me use PLL_MO objects?
Here I am: https://github.com/polylang/polylang/search?utf8=%E2%9C%93&q=PLL_MO
Forum: Plugins
In reply to: [Polylang] Theme options pageThank you.
My problem is these are dynamic options, not hard-coded strings.
So if you strings-translate them and the original string changes, you would have to retranslate it to every language.I use option names like OPTION-NAME + current_language()
It is one class only, and is ultra minimalist
https://github.com/szepeviktor/wordpress-plugin-construction/tree/master/theme-options-page/includesForum: Plugins
In reply to: [Polylang] $this by referenceOK.
Forum: Plugins
In reply to: [Polylang] Theme options pageI am thinking about one option per language.
For example: option names aretheme_option1_en_USandtheme_option1_jp_JPetc.function current_language() { if ( function_exists( 'pll_current_language' ) ) { $current_language = pll_current_language( 'locale' ); if ( false === $current_language ) { $current_language = pll_default_language( 'locale' ); } } else { $current_language = get_locale(); } return $current_language; }Your advise is welcome.
Forum: Plugins
In reply to: [Polylang] Theme options pageSorry! The most important:
I’d like the user to input translations on the theme options page, not in strings translation.Forum: Plugins
In reply to: [Polylang] Theme options page…it can have only one page (one tab) and several sections and different options.
Basically the option’s value will be an array:array ( 'one_theme_text_field_0' => 'Some apples are red.', 'one_theme_text_field_u' => '', 'one_theme_text_field_t' => 'This is a read-only but selectable field', 'one_theme_checkbox_field_1' => '1', 'one_theme_checkbox_field_1m' => array ( 0 => '1', 1 => '1', 2 => '1', ), 'one_theme_select_clientnum' => 9223372036854775807, 'one_theme_select_pwd' => '55545z%!Z 4;5 zpoiz', 'one_theme_select_field_3' => '-- Please select --', 'one_theme_textarea_field_4' => '', )