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

add_rewrite_rules triggered after save_post #53

Closed
torarnv opened this issue May 10, 2016 · 4 comments
Closed

add_rewrite_rules triggered after save_post #53

torarnv opened this issue May 10, 2016 · 4 comments

Comments

@torarnv
Copy link

torarnv commented May 10, 2016

The priority of 100 when adding the add_rewrite_rules hook for wp_loaded means that add_permastruct is called after the save_post action. This means get_post_permalink will not give the right permalink in save_post.

With a priority of 10 it works fine. Why is the priority 100? Would another hook than wp_loaded be more appropriate?

@torarnv
Copy link
Author

torarnv commented May 10, 2016

This seems due to piklist processing their front end forms in add_action('wp_loaded', array('piklist_form', 'wp_loaded'), 100);

@torarnv
Copy link
Author

torarnv commented May 10, 2016

Not sure if piklist is doing the right thing saving forms in wp_loaded, and if they are, how to ensure custom-post-type-permalinks runs first, besides bumping the priority in piklist. Thoughts?

@torounit
Copy link
Owner

In the old days, since the conflicts with other plug-ins, I think I was set to 100.
However, I do not think there is much of a reason.

Please pull request!

@torounit
Copy link
Owner

torounit commented Jun 6, 2016

5d5a7bc

marge your issue

@torounit torounit closed this as completed Jul 4, 2016
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