The filter comes with the text domain as second argument. So you could do this:
function wpdev_170138_plugin_locale( $locale, $domain ) {
if ( $domain === 'myplugin' ) {
return get_option( 'jezik' );
}
return $locale;
}
add_filter( 'plugin_locale', 'wpdev_170138_plugin_locale', 10, 2 );
Now only your plugin’s locale is changed.
Related Posts:
- Implementing a CrunchBase.com Clone using WordPress?
- wp.media.view.ImageDetails – Save settings as HTML5 data-* attributes for image
- How to share category taxonomy with custom post type (The Event Calendar plugin)
- Are drop-in plugins a product of design
- How can I make it so the Add New Post page has Visibility set to Private by default?
- Use a plugin to handle custom post types?
- How does WordPress handle MySQL row lock errors?
- Right approach for plugin output styling/template
- When do I need to use esc_attr when using WordPress internal functions
- Generate custom output for page/URL in a plugin
- How to select featured images for 1500 posts?
- Store post in raw markdown format, no html?
- Translating wordpress plugin
- Why would WordPress request FTP information when it can write to the file server?
- Extending WP’s upload/insert media functionality
- Strip HTML comments from plugins in header/footer
- How to expire all wordpress user passwords instantly?
- locate_template with multiple categories?
- Hardcode a Plugin into theme
- Change words on ‘Log in’ and ‘Register’ buttons on Woocommerce
- How to Include a Loop Template File in a Plugin
- How to show Categories and Sub-categories using WooCommerce
- My plugin wants to update another plugin
- Executing Javascript when a New Post is Published
- Use gutenberg block editor on plugin page (outside of a post)
- Using SVN to upload plugin created with gutenberg blocks
- Custom WPBakery elements not displaying in WP admin
- Set featured image using javascript in post editor
- Display encrypted content on my website
- Force quit running background job
- Plugin developer automated documentation
- Ajax with plugins returns 0
- All sites themes functions.php have been changed
- Remove a custom options name/value pair
- Loading a purchased jquery plugin in a wordpress theme
- Media Upload Tab reload and change $_GET
- Filtering get_permalink in Jetpack / ShareDaddy
- Fullscreen Video/GIF Intro
- How to define constant before plugin [duplicate]
- Check if plugin exists/active “class_exists()” does not work on plugin territory
- Widget’s container?
- Customizing Titles on the Fly with Code
- Is it possible not to load theme on a specific page in wordpress?
- How to change shortcode’s default theme?
- How do I get the Payzone WooCommerce payment gateway plugin to show up in the settings? [closed]
- How do I localize admin-ajax.php that is used in Ajax Load More – Infinite Scroll?
- WordPress Widget Not Saving Instance
- Issue with wp_handle_upload
- wp_insert_post() inside save_post(): force WP to not update global post object?
- WordPress truncate posts question (plugin related)
- Microsoft Word documents to WordPress pages adding paragraph tags
- Different registration form for different roles
- My plugin does not install correctly if a previous version is still installed
- Preserve Search engine index while shifting to new Domain
- WordPress ping spam issue with Ping services?
- 404 errors when updating options in admin dashboard
- cannot find cforms action handler page
- Display WordPress comments before the plugins?
- Mobilepress fails to translate short codes
- Drag and drop widget always inserts image
- Slideout submenu in mobile
- How to solve conflict with scripts?
- wp_insert_post not inserting post from XML
- Admin Custom Plugin List Files in admin Table
- Access “wp site health info” data from plugin
- How to run flush_rewrite_rules on activation after i register my custom post type using WordPress Boilerplate Plugin
- WordPress Frontend Page using Plugin
- Website always load twice on start
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- Is there a way to display multiple authors on a post?
- custom sidebar plugin issue
- WPML – Hook when language is switched (change user language)
- Install/Enable/Activate plugin on multisite without access to master site
- Product catalogue in WordPress
- How to get bulk actions handler to display simple “Hello World”?
- one admin for 2 wordpress websites
- Get input form data posted by users
- Number format in thousands on highcharts in wpdatatable plugin
- Disqus comment system – change comments number before “load more” button
- Specific plugin script not working on subdomain
- What Are the Advantages of Using an mu-plugin
- wp_verify_nonce fails always
- Custom Plugin: Point to `template_directory`
- How to keep edited plugins updated?
- Theme specific plugin, how?
- Validating values using Settings API?
- Share common libraries across multiple themes/plugins
- How to programatically create a simple HTML page using the permalink of a WordPress post?
- Does Google detect files in the WordPress plugin directory
- Is there any simple wordpress search template that works with existing searchforms?
- WordPress ReAuth =1 Loop with wpCAS
- WP e-commerce sales-view
- Facebook Feed Grabber Cache Relative to Dev Machine, not Server Install
- Global Handle to Class unavailable in Plugin?
- How to display multiple images in the before and after plugin?
- woocommerce buy button [closed]
- How to pull wordpress posts from one blog to an external blog?
- Take Elementor For Email FIeld Check if user is registered. IF not registered then register on woocommerece
- Redirect a specific User role not admins automatically to view the post that they just updated
- Rewrite Rule in htaccess convert query string into slashes