-
Notifications
You must be signed in to change notification settings - Fork 66
You forgot to include screen.php #435
Comments
Hi @danieleftodi in what circumstance is this, on which screen? in admin mode get_current_screen() is normally defined, are you saying that YITH Gift Cards has an admin screen which sends emails and where get_current_screen is not defined? there are several places in the plugin where get_current_screen() is used and not all of them test for the existence of the function, but they are expected to be called from a standard admin screen which does have the function enabled. |
Well, your plugin has been working for us, but since the last week or so, after all the updates in all the plugins related to "WooCommerce" & Polylang ... it has failed.
In this "Screen" ... when clicking "Send now" Also, I don't know, but I'm guessing when the system is automatically sending out the "Gift Card" order... when the order is marked as "Payed" in WooCommerce ... it is using the same email function.
Could the issue happen since we are using the WP-Security plugin, to change the default /wp-admin/ URL to something else? (this, to make it harder for "crackers" to brute force crack our site...) |
What this piece of code does is, for any email using standard woocommerce footer text, from address and from name, if we are in admin mode, only attempt to translate these values if the current screen is the order detail screen... .. the reason for doing this is that we can only reliably tell the language when in the current order screen by detecting the language of the global $post object. These filters are generic - for example also called from the password reminder screen - so do not include any information about the current order as this may not be an order email. Basically there are several possible solutions and I am trying to understand which is the best one:
|
Solution:
require_once(ABSPATH . 'wp-admin/includes/screen.php');
add it to:
/wp-content/plugins/woo-poly-integration/src/Hyyan/WPI/Emails.php
Three days ago you update the plugin ... and our Gift Card implementation with Yith Gift Cards couldn't send out any e-mails ...
as on line 270 you where refering to an undeclared function ...
$screen = get_current_screen();
Found the solution online, and allied it to screen.php ... and it works again....
The text was updated successfully, but these errors were encountered: