Make WordPress Core

Opened 6 years ago

Closed 4 years ago

Last modified 4 years ago

#45159 closed defect (bug) (invalid)

Embed template not loaded with certain custom post types

Reported by: pampfelimetten's profile pampfelimetten Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Embeds Keywords:
Focuses: Cc:


We use a handfull of different custom post types. The internal embeding works fine for most, showing the iframe with the abstract, page logo, etc. But with some it doesn't work, it only shows the post title.
The only major difference I found, is, that the falling cpt has the special rewrite setting with_front set to false.
I traced it back, the problem is, that it isn't even calling the embed.php template in the theme directory, it is failing before.

Change History (4)

#1 @pampfelimetten
6 years ago

Update: I'm pretty sure meanwhile it has something to do with the custom rewrite rules we use for this custom post type.
We have 2 posttypes called "zeitungsausgabe" and "zeitungsartikel".
The rewrite of "zeitungsartikel is basically "zeitung/%zeitungsausgabe%/%zeitungsartikel%", which we resolve by setting custom add_rewrite_tag called "z" and adding custom rewrite rules and filter the post_type_link to account for it.
It seems like the function url_to_postid doesn't account for custom rewrite tags, as it resolves the url to "zeitung%zeitungsartikel%" - the custom rewrite tag is ignored. thereby it cannot properly resolve the url (but weirdly somehow still gets the title).

Version 0, edited 6 years ago by pampfelimetten (next)

#3 @pampfelimetten
4 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Yep, it was an bug in my code =|

#4 @desrosj
4 years ago

  • Milestone Awaiting Review deleted
  • Version 4.9.8 deleted
Note: See TracTickets for help on using tickets.