You have slight timing issues because you generate title first (in constructor call), but postpone text domain load to later (init
at default priority). Text domain mus be loaded for __()
to translate correctly. Those are not “lazy”, they generate and return strings right where they are called.
Text domain should be loaded very early, Codex recommends at plugins_loaded
for plugins.
Probably your class shouldn’t be trying to be both valid widget and plugin loader, separate it out.
Related Posts:
- Fire on widgets_init only on dashboard
- Hooking action once but called twice
- Can the qTranslateX-Plugin translate non-article text? [closed]
- Preset Widgets ONLY after site is initially created
- Where is the content of widgets stored in mysql table
- How to get a translated string from a language other than the current one?
- How to refresh Theme Customizer after change color inside wpColorPicker?
- How to Remove All Widgets from Dashboard?
- Determining a Widget Instance and Sidebar Location?
- Randomize widgets displayed in my sidebar [duplicate]
- Calling static method in the Widget Class
- Remove […] from RSS feed?
- What is the best way to include a widget in a Page?
- Custom shortcode in widget forced to top of widget
- Modifying recent post widget to include icons for post titles
- Unfiltered html in widget title not working
- How to process content in a widget? [duplicate]
- How to retrive widget title/data
- Separate backend “Widgets” page for each language
- How do I embed in a text widget?
- Where (what direcory) are the default WordPress Widget Codes stored?
- Why use dynamic_sidebar() conditionally?
- WordPress Widget multiple use
- Contact Form in sidebar [closed]
- Display the date before the post title in recent posts widget
- More flexible sidebar and widget management
- Why won’t my custom widget stay in the sidebar after a reload?
- How to “pair” two widgets side by side in one sidebar [closed]
- Can I remove a widget area without editing code?
- Custom dashboard widget search box
- Notice: Undefined index: filter in …wp-includes/default-widgets.php on line 382
- Need some help understanding widgets
- Cannot save widgets in custom sidebars
- Disable widgets on specific posts
- How to determine the number of widgets contained in a sidebar via customizer JS
- WordPress Plugins won’t save
- for class wp_widget, in what order are the member functions called?
- Add field to dashboard to update embedded URL on homepage?
- unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘)’ in widget [closed]
- widgetlogic and permalinks
- allow user to style widget backgound per widget
- I’m trying to find a basic plugin for displaying images in a widget [closed]
- A form in a custom widget
- Block-based Widgets Editor – how to enable a title
- Widgets in home.php redirect to index.php
- How to make a can’t hide widget?
- WordPress Tag Cloud args (font-size) not working since wp update 4.9
- How to track whether the user has changed the value of the field in the widget or not?
- WordPress: How to embed a widget on a separate website?
- Widget on the right side of the page overlaps with the left side [closed]
- Making tags appear as an Unordered list instead of a ‘cloud’
- Shortcode not working in widget
- How to get options of all active widgets ?
- wordpress widget missing jquery
- Display a widget on a specific type of archive
- Add a specific css to a widget
- Is there a simple way to have a new sidebar for each page?
- Add class to on sidebar widget
- Save button is not working on custom widget
- WordPress Edit Button not appearing for widget in customizer
- WordPress database error – quick review
- Select two value from meta key and post meta
- Removing widget from home page when coming from specific landing page
- In which folder can we find the core wordpress Widgets such as Menu Widget
- How do I insert an amazon search widget into posts or pages?
- How to remove Help tab and the Dashboard widget area’s empty border
- How to add a text widget on the posts admin page?
- latest posts-widget displays all posts on archive page but works great anywhere else
- looping widgets to organize bootstrap grids
- Widget : html 2 dimensional array doesn’t work
- call widget from within shortcode
- How to get class from widget area
- How to change widget’s form color in admin?
- In widget, the value of select field doesn’t get updated, changes after saving
- Removing widget without using unregister_widget
- Text Widget to Show database fields based on post
- Editing Help Section
- SELECT field options disappear when saving widget
- WordPress text filed input only inter value?
- Need to delete the sidebar widget area and have the page a full page rather than just have a blank widget area
- Searching for a one page overview widget
- Adding pagination to my theme [closed]
- How do I add after the tag in WordPress widget?
- Creating a simple button inside of a widget
- The WP_Widget class seems to run many times on a page load
- Adding translation files to a child theme
- Stop ‘extends WP_Widget’ displaying the (backend) form, frontend?
- How to check widget-cpt meta and display its custom css in the head?
- How to add WooCommerce Add to Cart button in widget?
- How to call theme default widget in custom template?
- How to place a widget beside a div/text so that they display as a continuous line
- Editor Widget Role
- How to Activate WordPress Widgets
- WordPress wiget admin panel
- Filter “widget_comments_args” won’t work
- How to output built-in widgets with number in range as class?
- How to hide sidebar widgets in all pages except Hompage?
- How can I create my own widgets in WordPress? [closed]
- Unable to add options on dashboard widget ?
- is it possible to create custom widgets page in admin?