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

Call to undefined function _e() in control-{bar,sort}.php #113

Open
anthonyfok opened this issue May 6, 2023 · 0 comments
Open

Call to undefined function _e() in control-{bar,sort}.php #113

anthonyfok opened this issue May 6, 2023 · 0 comments
Assignees

Comments

@anthonyfok
Copy link
Member

Not sure if it is a problem at all, but I saw these two error messages while doing Simply Static export today (2023-05-05):

riskprofiler-wordpress-1  | [05-May-2023 19:12:23 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function _e() in /var/www/html/site/assets/themes/fw-child/template/scenarios/control-bar.php:4
riskprofiler-wordpress-1  | Stack trace:
riskprofiler-wordpress-1  | #0 {main}
riskprofiler-wordpress-1  |   thrown in /var/www/html/site/assets/themes/fw-child/template/scenarios/control-bar.php on line 4

riskprofiler-wordpress-1  | [05-May-2023 19:12:23 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function _e() in /var/www/html/site/assets/themes/fw-child/template/scenarios/control-sort.php:16
riskprofiler-wordpress-1  | Stack trace:
riskprofiler-wordpress-1  | #0 {main}
riskprofiler-wordpress-1  |   thrown in /var/www/html/site/assets/themes/fw-child/template/scenarios/control-sort.php on line 16

Fortunately, it does not seem to affect the static site export at all, and the exported pages look normal.

The solution seems to be to add require_once ( $parse_uri[0] . 'wp-load.php' ); (which Phil already did in control-sort.php, but commented out); see also https://stackoverflow.com/questions/51953428/fatal-error-call-to-undefined-function-e-in-wordpress-plugin-error

Probably this is a non-issue because it looks like both control-bar.php and control-sort.php are not meant to be run standalone, but rather, PHP segments that are included by other PHP scripts.

Documenting this here in case we need this info in the future.

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

2 participants