Issue with function_exists in a plugin file
-
I’m trying to use pll_register_string and did it like this :
if ( function_exists( 'pll_register_string' ) ) : /** * Register some string from the customizer to be translated with Polylang */ function plugin_pll_register_string() { $mystring = get_option( 'an_option'); pll_register_string('Simple text', $mystring); } add_action( 'admin_init', 'plugin_pll_register_string' ); endif;
The problem is the function_exists( ‘pll_register_string’ ) returns false when the plugins are actives. Odd thing is if i comment out the if statement, it works and my string is available in string translations, proving that the function really exists. What is this mystery?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Issue with function_exists in a plugin file’ is closed to new replies.