File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments