Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:54:32+00:00 2026-06-14T02:54:32+00:00

In wp-config.php I defined WPLANG by: if(isset($_GET[‘lang’]) && $_GET[‘lang’] == ‘pl’) { define(‘WPLANG’, ‘pl_PL’);

  • 0

In wp-config.php I defined WPLANG by:

if(isset($_GET['lang']) && $_GET['lang'] == 'pl') {
  define('WPLANG', 'pl_PL');
} else {
  define('WPLANG', 'en_US');
}

whenever I access the WPLANG it works perfectly, however when I try to add metadata from a mailpress widget it fails to recognize the WPLANG. The function for inserting the language to wpdb is located in functions.php of the theme:

add_action( 'MailPress_insert_user', 'MailPress_insert_set_lang');
    function MailPress_insert_set_lang($mp_user_id) {
        global $wpdb;
        $q = $wpdb->prepare( "INSERT INTO $wpdb->mp_usermeta 
        (mp_user_id, meta_key, meta_value) 
        VALUES (%s, 'lang', %s)", $mp_user_id, WPLANG );
        $wpdb->query( $q );
    }

the Mailpress widget uses ajax. Whenever i put echo WPLANG before the function definition it echoes the right language, however WPLANG is not recognized within the scope of that function.

Please advise.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:54:33+00:00Added an answer on June 14, 2026 at 2:54 am

    Possibly try wrapping WPLANG with constant()

    add_action( 'MailPress_insert_user', 'MailPress_insert_set_lang');
    function MailPress_insert_set_lang($mp_user_id) {
        global $wpdb;
        $q = $wpdb->prepare( "INSERT INTO $wpdb->mp_usermeta 
        (mp_user_id, meta_key, meta_value) 
        VALUES (%s, 'lang', %s)", $mp_user_id, constant(WPLANG) );
        $wpdb->query( $q );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have defined file path like- $docRoot = $_SERVER['DOCUMENT_ROOT']; $webRoot = str_replace(array($docRoot, 'library/config.php'), '',
/cake/config/paths.php /** * Path to the public images directory. */ define('IMAGES', WWW_ROOT.'images'.DS); /** *
I have a php file named config.php in which I defined the application settings
config.php put at the root level, this file will be included in any pages.
I have a config.php file that creates an array, something like $config = array(
in my config.php where i have all constants i set the PATH to a
I have config.php with this... $dbhost = localhost; I want to be able to
I'm writing code in PHP that requires including a config.php file depending on the
I it safe to place config.php in the root of your website even though
PHP PDO Singleton Class: <?php require_once('app/config.php'); // Require constants HOST, DATABASE, USER, PASSWORD /*

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.