mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Embeds: Allow embedding static front pages and pages having a child page with an embed slug.
This makes `embed` a special slug that can't be used for new pages/posts. When `https://example.com/foo/embed/` is an existing page, embeds fall back to `https://example.com/foo/?embed=true`. Adds unit tests. Fixes #34971. git-svn-id: https://develop.svn.wordpress.org/trunk@36307 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1022,6 +1022,10 @@ class WP_Rewrite {
|
||||
$feedmatch2 = $match . $feedregex2;
|
||||
$feedquery2 = $feedindex . '?' . $query . '&feed=' . $this->preg_index($num_toks + 1);
|
||||
|
||||
// Create query and regex for embeds.
|
||||
$embedmatch = $match . $embedregex;
|
||||
$embedquery = $embedindex . '?' . $query . '&embed=true';
|
||||
|
||||
// If asked to, turn the feed queries into comment feed ones.
|
||||
if ( $forcomments ) {
|
||||
$feedquery .= '&withcomments=1';
|
||||
@@ -1033,7 +1037,7 @@ class WP_Rewrite {
|
||||
|
||||
// ...adding on /feed/ regexes => queries
|
||||
if ( $feed ) {
|
||||
$rewrite = array( $feedmatch => $feedquery, $feedmatch2 => $feedquery2 );
|
||||
$rewrite = array( $feedmatch => $feedquery, $feedmatch2 => $feedquery2, $embedmatch => $embedquery );
|
||||
}
|
||||
|
||||
//...and /page/xx ones
|
||||
|
||||
Reference in New Issue
Block a user