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

Question : Can we listen and profile Wordpress events/routes in Symfony? #11

Open
loicrey opened this issue Feb 25, 2023 · 1 comment
Open

Comments

@loicrey
Copy link

loicrey commented Feb 25, 2023

Hi.

Can we listen to WordPress events on Symfony like post creation, post updates, etc...?
Additionally, will Sword will supports profiling WordPress-related routes and executions?

The project seems amazing, I'm really excited to go deeply into it and make something with it.

@williarin
Copy link
Member

Hi,

WordPress is launched after Symfony's kernel.controller event, it's a fallback route with low priority. So yes you can listen to WordPress events in Symfony using WordpressService interface and adding your hooks in initialize(). You can see an example here: https://getsword.com/guide/tutorial/services.html

For the profiling unfortunately it's a bit complex to integrate it into Symfony therefore I haven't spent time on it, however you can still use QueryMonitor plugin in Wordpress.

Thanks for your interest in this project!

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