Fatal error: Uncaught Error: Call to undefined function pll__()
-
Hello,
I’m creating a custom plugin. Poylang is installed and configured in WordPress (both latest version). The plugin uses an own mailer.
Can’t get the translatiions of the Mailtext working. Following error is thrown:
Fatal error: Uncaught Error: Call to undefined function pll__() in PATH/TO/PLUGIN/inc/mailing/mailer.php:36 Stack trace: #0
This is the corresponding line:
$content = pll__("mailafterregistration");
The hole code (just trying) of the function is:
function MailAfterRegistration($userguid) { $content = pll__("mailafterregistration"); $subject = pll__("mailafterregistrationsubject"); $usermail ) = "[email protected]" SendMail($content, $subject, $usermail); } function SendMail($content, $subject, $to) { $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= 'From: XXXXXXXX' . "\r\n"; $headers .= 'Bcc: XXXXXXX' . "\r\n"; mail($to, $subject, $content, $headers); }
Can anyone help withj this please? I think I’m missing an include or so?
Edit: the strings are registered correctly and can be used in other parts of the custom plugin. For example:
function GetSingleText() { $out = '<p>. pll__("mailafterregistration") . '</p>': return $out; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Fatal error: Uncaught Error: Call to undefined function pll__()’ is closed to new replies.