1 parent 52cc94a commit bce457eCopy full SHA for bce457e
1 file changed
src/Admin/Admin.php
@@ -236,6 +236,22 @@ public function addAdminBarArchiveLink(WP_Admin_Bar $adminBar): void
236
*/
237
public function addPostTypeSubmenus(): void
238
{
239
+ $pageId = get_option('page_for_posts');
240
+ $postTypeObject = get_post_type_object('post');
241
+ if ($postTypeObject && $pageId) {
242
+ $postType = 'post';
243
+ $editPostLink = get_edit_post_link($pageId);
244
+ $archivesLabel = \is_string($postTypeObject->labels->archives) ? $postTypeObject->labels->archives : $postType;
245
+
246
+ add_submenu_page(
247
+ 'edit.php',
248
+ $archivesLabel,
249
250
+ 'edit_pages',
251
+ $editPostLink
252
+ );
253
+ }
254
255
foreach ($this->api->getPageIds() as $postType => $pageId) {
256
$postTypeObject = get_post_type_object($postType);
257
if (!$postTypeObject) {
0 commit comments