I get these errors from php:
Undefined index: lang in /var/www/html/wordpress/wp-content/plugins/language-field/lf_core_functions.php
Undefined variable: thePostID in /var/www/html/wordpress/wp-content/plugins/language-field/lf_core_functions.php
Might be the reason behind it not working.
The problem is with thePostID
It is defined as the_Post_ID but then used as thePostID
Here is the original code:
$the_Post_ID = $wp_query->post->ID;
$lf_language_code = get_post_meta( $thePostID, '_lf_language_code', true);
The fix:
$the_Post_ID = $wp_query->post->ID;
$lf_language_code = get_post_meta( $the_Post_ID, '_lf_language_code', true);
But the other error is still not resolved.
There are so many issues with your plugin, also the code is not following a standard indentation.
Notice: Use of undefined constant addlflang - assumed 'addlflang' in /var/www/html/wordpress/wp-content/plugins/language-field/lf_admin_page.php on line 10
Notice: Use of undefined constant reset - assumed 'reset' in /var/www/html/wordpress/wp-content/plugins/language-field/lf_admin_page.php on line 12
Notice: Undefined index: reset in /var/www/html/wordpress/wp-content/plugins/language-field/lf_admin_page.php on line 12
The solution for the undefined constant is to quote the array keys as follow:
if(isset($_POST['addlflang'])) {
and
} else if($_GET['reset']==1) {
Solution for undefined index do this:
else if( (isset($_GET['reset']) ? $_GET['reset'] : '')==1 ) {