Skip to content

Commit

Permalink
Fix permalinks of scheduled pages and scheduled CPT posts (#49092)
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyasikhar authored Mar 19, 2023
1 parent 53d605d commit ce7947b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import PostScheduleLabel from '../post-schedule/label';
import { store as editorStore } from '../../store';

const POSTNAME = '%postname%';
const PAGENAME = '%pagename%';

/**
* Returns URL for a future post.
Expand All @@ -33,6 +34,10 @@ const getFuturePostUrl = ( post ) => {
return post.permalink_template.replace( POSTNAME, slug );
}

if ( post.permalink_template.includes( PAGENAME ) ) {
return post.permalink_template.replace( PAGENAME, slug );
}

return post.permalink_template;
};

Expand Down

1 comment on commit ce7947b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in ce7947b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4459574369
📝 Reported issues:

Please sign in to comment.