-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Including WordPress? #3944
Comments
Not a WordPress user, but I will ask what could be a pertinent question. Before any require __DIR__ . '/vendor/autoload.php'; // note your location may vary You mention a |
Oh thank you @oleibman, but I yes, I should have said. If we have this, then we get the error I reported earlier:
But then if we swap the first two lines round like this, and click the button to submit the data, no error happens - but nothing happens.
|
Sorry it wasn't a simple solution. I don't have any other ideas. Have you asked this question of WordPress? |
Thanks very much anyway! Not that easy to contact WordPress alas, but I'll try some Facebook groups too. Much appreciated. |
Sorry I don't know how to use Github message templates very well but let me try and explain. We have a template on a WordPress website that posts data to a PHP file, which generates a spreadsheet. It starts with this code:
However if we add this line at the top of the file, so we can integrate WordPress and use its functions:
require_once('../../../../wp-load.php');
We get this error:
PHP message: PHP Fatal error: Uncaught Error: Call to undefined method PhpOffice\PhpSpreadsheet\Spreadsheet::getDefinedName() in /www//public/wp-content/themes//vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Validations.php:109*
Is there a way we can use PHPSpreadsheet and WordPress in the same file?
Thank you!
The text was updated successfully, but these errors were encountered: