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:
- Best collection of code for your 'functions.php' file [closed]
- Tips for using WordPress as a CMS? [closed]
- Using WordPress as a CMS: Developer preferences for custom vs existing plugins
- is_plugin_active() returning false on active plugin
- Unable to check if plugin is active
- Preserve custom URL parameter on more pages
- Sort plugins by rating
- How to Delete All regenerated thumbnails but keep the original ones?
- Why do I get this “plugin does not have a valid header” error?
- if plugin is active? check if plugin is enabled or not?
- How to upload image with simple form?
- WordPress Capabilities: edit_user vs edit_users
- Passing .pem and .key files in cURL doesn’t work in WordPress
- Is there a limit on the size of a WP page?
- A Blog’s changelog
- Adding a widget programmatically
- How do I create a custom wordpress slideshow plugin?
- Updating a WordPress plugins breaks SVN
- Seeking clarification on page request life-cycle
- Modify the_content after the more tag
- Template plugin for blog posts? [closed]
- How is the ” wp_get_update_data ” function used?
- woocommerce hook publish product
- Are contributed plugin translations automatically installed in WordPress?
- Why would WP-CLI and WP Admin show different list of plugins with updates?
- How do you install the automattic developer plugin under localhost for mamp when there is an error, deprecated?
- Translating plugin inside the theme [closed]
- Admin Dashboard with Custom Tab for Client
- reorder plugin menu position
- How can I serve a text file at a custom URL
- How to add custom link to menu in wordpress programmatically?
- Plugin not saving values when placed in a folder within /wp-content/plugins
- How to integrate plugin in WordPress theme
- Set WordPress TinyMCE Editor To Readonly
- Getting a List of Categories for Use in a Plugin?
- UnWanted Custom field added in the wp page edit area
- WordPress download manager plugin showing attached file is missing/deleted?
- Display update notification messages like ‘What’s New’
- Gutenberg block can’t save richtext
- How can I make 2 plugins that include different versions of a framework to both use the latest version?
- Add Plugin options as subpage to Theme options page
- Changing page URL and connect newsletter to MailChip
- Git Hosting for WordPress SVN Plugin Repository [closed]
- How to enable AMP for custom single template with custom database
- Is there a directory my plugin can write files to that cannot be viewed via the browser/url?
- How to exclude certain files from the plugin editor?
- WordPress and a secondary database?
- How do I apply style to each category of a list?
- add_action does not call the function
- how to force tag page layout to use same as search layout?
- a href adds default URL with the given echo URL
- Disabling Wp_is_mobile from backend?
- Gutenberg Block Style CSS Class Is Not Applying on Backend
- WordPress Users authentication with Java Application
- Replacing global wp_query
- How to create a plugin that includes all the other plugins?
- how to make wordpress plugin from PersianWebToolkit? [closed]
- ACF – How to set the menu order for the relationship field
- wp_get_http has been deprecated. Use WP_Http instead
- Custom search search does not work?
- Add custom PHP and HTML to the_content()
- Add an action based on custom post meta field
- How to hide an option from dropdown in filter module
- Adding an item to an anonymous array inside a filter?
- add menu page not showing Icon
- $wpdb not working wordpress plugin ajax call
- how to create user profile pages and display them based on users roles
- One quantity for group of variations
- Securing a plugin pop-up window
- Woocommerce – Change variations output
- Is admin section completely customizable in terms of styling?
- how do i fixe Page Builder on a custom page?
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- What’s a good way to default behavior if a plugin is inactive?
- How do I add languages?
- wp_enqueue_scrpts seems not to get called
- Which Membership Plugin? [closed]
- Adding featured image to post display widget
- How to Create Custom Dashboard for my Laundry Website?
- Warning: Illegal offset type in /var/www/html/wp-includes/option.php on line 1924
- How to create a WordPress sandbox on a live server for website development?
- pluggable function in theme, to be overridden by plugin
- Restrict my pages from public
- Migrating site from stage to production server without particular dev. plugins?
- Using “excerpt_more” filter for a specific post type
- w3 total cache and post__not_in
- Plugin: Unable to Save the Image Alignment Option to Display in the Widget in the Sidebar
- Remove action plugin
- Plugin programming: Uploading a file to a specific folder
- Conditional statements using category and Tags
- Issue with custom plugin
- How to link that “logged in” in “you must be logged in to post a comment” with custom login page on WordPress?
- Get value of a key from a Plugin Serialized array
- Get post id in Post Page within Wp-admin
- Simple WordPress function / plugin to redirect a site
- How to insert current “login” page to certain page?
- Infinite scroll for text in post with url page change
- claim a permalink and all sublinks in plugin
- Play an animated character video on click of a button or radio button selection only
- Vanilla javascript in custom gutenberg block not working