I didn’t see this happening on your site, but I think you could probably remove the variable declaration in front of setcookie(). I didn’t see result called used any where in this code. Which makes me wonder if the value is being set because since the variable isn’t used.
<?php
add_filter( 'init', 'aws_set_language_cookie', 999 );
function aws_set_language_cookie() {
global $TRP_LANGUAGE;
if ( isset( $TRP_LANGUAGE ) ) {
setcookie( 'language', $TRP_LANGUAGE, time() + ( 30 * DAY_IN_SECONDS ), "/", "" , true, true );
}
}
?>
I hope this helps, sorry if it doesn’t 🙂
Related Posts:
- Keep one user logged for a year?
- Customizing subject in comment notification e-mails
- How to Loop Plugin Option Field Set?
- Saving Plugin settings to the database
- HELP: Integrating WP with raw PHP code once published button is hit
- I would like to use create a function in my custom plugin to tell WP to use a different header
- Scope for PHP Variables Assigned in functions.php or a plugin
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- wordpress plugin is not activating from widget
- Edit Yoast SEO breadcrumbs output [closed]
- Conditional attributes and logic per product category
- WordPress get_avatar function not correct working
- Redirect to another page using contact form 7? [closed]
- Check if variable is set in filter
- execute function after one completed
- Plugin onclick button activate other plugin
- Different registration form for different roles
- More gentle way to hook WordPress custom url
- How to add custom function to pluggable.php
- Checkbox show / hide output result
- Allow a particular user to access a particular plugin?
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- adding dynamic/multiple slug values in ‘option_none_value’
- working code, not working – Plugin Dev
- Is admin section completely customizable in terms of styling?
- register_activation_hook doesn’t fire at all
- My ajax request don´t work and return 0
- WordPress environment not loading properly
- Populate select option with JSON file
- Saving an array to get_options
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- How to add a handler for a button in plugin?
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Doing action based on input from options menu
- How use Dynamic hyperlink on each wordpress post?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- WP showing “warning: call_user_func_array()”, What to do?
- Security error WP 4.0 + WP phpBB Bridge [closed]
- How to list the Hooks and order of execution in current loading page? [duplicate]
- How to turn off email you receive when registered?
- Execute a function using ajax
- Use functionality of 2 wordpress plugins
- How can i change an image’s author?
- Custom Shipping method not showing in checkout
- The Point of Using apply_filters()
- Plugin exceeds memory limit
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- How to include code into functions.php file via a plugin
- How to trigger $_GET request within admin plugin page?
- How to generate video out of images via WordPress plugin
- How to ‘clone’ a wp plugin to make small changes
- Using a post-signup hook to get user details
- code is working properly in Core PHP but writing coding in WordPress
- wp_remote_get() returns 403 while file_get_contents() does not
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- All sites themes functions.php have been changed
- Perform internal redirect in WordPress?
- How to prevent plugins from loading jQuery
- Duplicate results are displayed in a custom plugin [closed]
- Why can’t I call a (member) function from within a foreach?
- Are there action hooks for comments?
- Help with WP Business Directory Manager Plugin?
- How to redirect to same page after form submission
- Shortcode Attributes to Return different $_POST
- I receive taxonomy id
- Loop in elementor custom widget not working
- Asynchronous request in wordpress
- How to access OOP plugin function inside themes or other plugin
- can’t unzip file
- WordPress Custom Hook with Class method
- The Build menu theme is frozen with the wordpress theme
- The function called on the wp head hook becomes null
- How can I translate something in my class constructor of my plugin in WordPress?
- Define global variable in theme file and call that variable in plugin file
- Submitting form to PHP
- Adding discount functionality to the cart
- Precheck fields when I add a new post
- How to translate to spanish wordpress hardcoded content/files?
- Get Shortcode output to database for static post_content
- SimpleXML is not working with xml response from external api
- how override a define
- WordPress plugin blog creation
- Multiple image selection custom widget
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- Change Woo Custom Endpoint Titles from a Plugin
- Change custom rewrite rule when permalink is updated/changed
- How can I store user preferences in WordPress and retreive them later?
- submit form data to wordpress existing database table using my plugin
- plugin not hooking to my custom hook
- Find all strings between an enclosing shortcode
- How to get site homepage from plugin?
- How to disable register and reset the password from WordPress admin panel?
- Unable to show 4 products in a row
- Adding a script & php to functions.php
- PHP Creating a formula from mysql db values and db stored math operator
- Make plugin admin page visible to other roles
- wp_enqueue_script doesn’t load JS in plugin
- Accessing Correct Database to Create REST API Endpoint