Created
November 18, 2014 09:46
-
-
Save willybahuaud/0382401b87c7ab4c6eb5 to your computer and use it in GitHub Desktop.
translate wpm ajax requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'plugins_loaded', function() { | |
global $sitepress; | |
if( ! isset( $_REQUEST['icl_ajx_action'] ) && isset( $_POST[ 'mylang' ] ) ) { | |
$reflection = new ReflectionClass( 'SitePress' ); | |
$admin_language = $reflection->getProperty( 'admin_language' ); | |
$admin_language->setAccessible( true ); | |
$admin_language->setValue( $sitepress, $_POST[ 'mylang' ] ); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment