-
Notifications
You must be signed in to change notification settings - Fork 263
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
Custom WordPress build with plugins #23
Comments
Using the window.wpWorker = { postMessage } From the browser console, I could see the contents of the virtual file system. const { stdout } = await wpWorker.postMessage({
type: 'run_php',
code: `<?php
echo json_encode(
scandir(__DIR__.'/wp-content/plugins/'),
JSON_PRETTY_PRINT
);
`
})
console.log(stdout) And the pre-installed plugin does exist there. (As a tangent, it's probably better to copy it into So, that confirms the build script is successfully including the plugin files in |
Solved. I added the following line in echo "<?php
require_once ABSPATH.'wp-content/mu-plugins/plugin-name/plugin-name.php';
" > wordpress/wp-content/mu-plugins/index.php |
Let's add that to first iteration of technical docs, cross-linking with #12 |
I'd like to create a custom build of
wp.data
with pre-installed plugins. I got pretty close to achieving it, but for some reason the admin screen shows no plugins. Here's what I did:wasm-build/wordpress-data/prepare-wordpress.sh
to download, unzip, and move a plugin folder into./wordpress/wp-content/plugins/
npm run build:wp && npm run publish:wp:web
I confirmed that the plugin's static assets were copied to
dist-web/wp-content/plugins
. I looked in the built filedist-web/wp.js
, and the plugin's file paths are included from/preload/wordpress/wp-content/plugins
- so I assume the files were successfullly included inwp.data
. But somehow the WordPress instance in the browser is not recognizing it.Any idea or hint would be greatly appreciated.
The text was updated successfully, but these errors were encountered: