我在激活我的WordPress网站中的插件时出错Fatal error: Uncaught Error: Call to undefined function create_function() in /home4/seosexey/gifting.icowebtech.com/wp-content/plugins/woocommerce-product-options/includes/order-option-group.php:33 Stack trace: #0 /home4/seosexey/gifting.icowebtech.com/wp-content/plugins/woocommerce-product-options/includes/order-option-group.php(364): Woocommerce_Product_Options_Order_Option_Group->__construct() #1 /home4/seosexey/gifting.icowebtech.com/wp-content/plugins/woocommerce-product-options/woocommerce-product-options.php(22): require_once('/home4/seosexey...') #2 /home4/seosexey/gifting.icowebtech.com/wp-admin/includes/plugin.php(2314): include_once('/home4/seosexey...') #3 /home4/seosexey/gifting.icowebtech.com/wp-admin/plugins.php(192): plugin_sandbox_scrape('woocommerce-pro...') #4 {main} thrown in /home4/seosexey/gifting.icowebtech.com/wp-content/plugins/woocommerce-product-options/includes/order-option-group.php on line 33
我想我得重写一个密码
$func = create_function( '',
'global $woocommerce_product_options_order_option_group; $woocommerce_product_options_order_option_group->print_order_options( "' . $location . '"); return;' );
};
add_action( $location, $func );
有人能帮帮我吗?
1条答案
按热度按时间h43kikqp1#
create_function()已从php 8中删除。网络罪犯发现它太容易被黑客攻击了。
对于您显示的代码来说,这不是必需的。您可以尝试在调用add_action()时使用anonymous function,如下所示。(未调试)
use ( $location )
子句使该变量可以从函数外部在函数内部访问。