Skip to content

Commit 283222b

Browse files
committed
fix: phpstan
1 parent 47b7696 commit 283222b

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

src/Admin/Admin.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,17 @@ public function addPostTypeSubmenus(): void
241241
if ($postTypeObject && $pageId) {
242242
$postType = 'post';
243243
$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-
$archivesLabel,
250-
'edit_pages',
251-
$editPostLink
252-
);
244+
if ($editPostLink) {
245+
$archivesLabel = \is_string($postTypeObject->labels->archives) ? $postTypeObject->labels->archives : $postType;
246+
247+
add_submenu_page(
248+
'edit.php',
249+
$archivesLabel,
250+
$archivesLabel,
251+
'edit_pages',
252+
$editPostLink
253+
);
254+
}
253255
}
254256

255257
foreach ($this->api->getPageIds() as $postType => $pageId) {

0 commit comments

Comments
 (0)