Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php 7.2 create_function #26

Open
ed10101 opened this issue May 30, 2019 · 2 comments
Open

php 7.2 create_function #26

ed10101 opened this issue May 30, 2019 · 2 comments

Comments

@ed10101
Copy link

ed10101 commented May 30, 2019

widgets-manager.php line 579

$conditional_function = create_function('', 'return '.cherry_condition($options_type[$id], $options[$id], $users[$id]).';');

Deprecated: Function create_function() is deprecated in ####/wp-content/plugins/cherry-plugin/includes/widgets/widgets-manager.php on line 577

@scebotari66
Copy link

For anyone stumbling into this issue, just replace $conditional_function and $conditional_result declarations with these ones:

$conditional_function = function() use ($options_type, $options, $users) {
  return (boolean) cherry_condition($options_type[$id], $options[$id], $users[$id]);
};
$conditional_result = $conditional_function();

@Erictoby
Copy link

Erictoby commented Feb 8, 2021

It works. I had to add $id in use ($options_type, $options, $users, $id). It didn't work without (boolean). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants