Making WordPress.org

Opened 6 years ago

Closed 6 years ago

#3680 closed defect (bug) (fixed)

Remove post_type_link filter from the WP Parser plugin

Reported by: keesiemeijer's profile keesiemeijer Owned by: obenland's profile obenland
Milestone: Priority: normal
Component: Developer Hub Keywords: has-patch
Cc:

Description

The wporg-developer theme and the WP parser plugin both register the parsed post types but with different slugs. The parser doesn't register the post types if the theme has registered them already, but it does change the permalink for method permalinks in the post_type_link filter.

If the parser plugin is activated the reference permalink for a method links to

/method/<classname>/<methodname>

While the correct reference permalink for a method is

/reference/classes/<classname>/<methodname>

The following patch removes the post_type_link filter from the parser as it's not needed for the reference.

Attachments (2)

3680.patch (796 bytes) - added by keesiemeijer 6 years ago.
remove filter
3680.1.patch (833 bytes) - added by keesiemeijer 6 years ago.
Set priority to 11

Download all attachments as: .zip

Change History (7)

@keesiemeijer
6 years ago

remove filter

#1 @obenland
6 years ago

@keesiemeijer I'm not too familiar with that code, can you point me to an example of the bug for me to test the patch?

#2 @keesiemeijer
6 years ago

They both use the post_type_link filter to change method permalinks . This is more of an annoyance type fix. After parsing you'll have to de-activate the WP Parser plugin for the method permalinks to be correct (and not 404).

They use the filter here

To test it you can activate the WP Parser plugin (and update permalinks) and see if the method permalinks are wrong (without the patch). I assume the WP Parser registers the post types and changes the method permalink so it works without the wporg-developer theme.

Last edited 6 years ago by keesiemeijer (previous) (diff)

#3 @obenland
6 years ago

Would this be fixed by setting the priority of the wporg-developer callback to 11?

#4 @keesiemeijer
6 years ago

Yes it would :-)

@keesiemeijer
6 years ago

Set priority to 11

#5 @obenland
6 years ago

  • Owner set to obenland
  • Resolution set to fixed
  • Status changed from new to closed

In 7387:

DevHub: Turn callback to 11.

Prevents a priority conflict with WP Parser callback.

Props keesiemeijer.
Fixes #3680.

Note: See TracTickets for help on using tickets.