I'm building Storefront child theme. I'm trying to add woocommerce shortcodes plugin into the my theme.

Button added but can't load translation file.

custom tinymce button

class-wc-shortcodes-admin.php file


Translation file load codes in class-wc-shortcodes.php

 * TinyMCE locales function.
 * @param  array $locales TinyMCE locales.
 * @return array
public function add_tinymce_locales( $locales ) {
    $locales['woocommerce_shortcodes'] = get_stylesheet_directory_uri() . '/inc/woocommerce-shortcodes/wc-shortcodes-editor-i18n.php';

    return $locales;
  • It looks as though this is pretty specific to WooCommerce so you might find it hard to get a good answer here. Officially plugin questions are off topic How to Ask Aug 10 '16 at 11:36

Changed get_stylesheet_directory_uri() to get_stylesheet_directory(), and it works.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.