Best way to filter featured image text for a custom post type?

Regardless if you go the PHP or jQuery route, I suggest you set up your filters or enqueue your Javascript in the admin_head-post[-new].php or admin_print_scripts-post[-new].php hook. There you can be sure that the global variable $post_type is set, and can check whether it is slide. Since the post thumbnail code is called after these hooks, … Read more

Titles in my sidebar widget appear in all languages – with qtranslate

Hi Will also try this: Add this to your functions.php function get_qTrans_TitleText($text) { $language=qtrans_getLanguage(); preg_match(‘/<!–:’.$language.’–>(.*?)<!–:–>/’, $text, $matches); return strip_tags($matches[0]); } And then: <?php echo get_qTrans_TitleText($text); ?> Have no Idea what version of qTranslate and WP you have so you may even use __() to get the correct title or _e() to echo it.

Can’t set proper WooCommerce language translation [closed]

After installing WordPress version 4.6.1 and WooCommerce version 2.6.6, both with the default enabled language, English (United States), I followed the steps below and had the translation successfully installed and working: Set a language for your WordPress installation Click on the General sub-menu item under Settings from the Dashboard of your WordPress installation, and scroll … Read more

How to prevent text modified using gettext filter being stomped (presumably) by updateText() js function within a CPT’s edit screen

First, you have nasty typo in __contsruct. 🙂 Second, your hook timing is wrong. Related WP JavaScript is localized via postL10n object (you can see it echoed in page’s source), that gets put together on init hook – way earlier then admin_head and your filter is not in place yet. From quick test this should … Read more

How to concatenate inside the _e() function the right way?

the_search_query() echoes itself, so by putting it into another echo function (what _e() is) you’ll get result as in second example. It isn’t recommended to use variables or function inside l18n functions, because they can’t be translated, for more information see Otto’s: Internationalization: You’re probably doing it wrong. So you should use code like this: … Read more

Unknown language json files

what are these language files for? (I guess it is for localizing javascript?) You guessed right. The JSONs are for use specifically with the new wp_set_script_translations function in WordPress 5. is it necessary to add/commit/push them to the live server? They are used at runtime, just like .mo files are. So yes, add them to … Read more

Cache WordPress translations

I answered a similar question on Stack Overflow recently. Don’t forget that the profiler itself adds a big overhead. If your page loads are still really slow with XDebug disabled then I don’t think your problems are limited to translation files and you should look at caching entire pages. You can eliminate MO file loading … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)