[ 'label' => __('Homepage', 'crownify'), 'group' => __('Special Pages', 'crownify'), 'description' => __('Your front page, whether that is a static page or the blog index.', 'crownify'), ], ]; foreach (get_post_types(['public' => true], 'objects') as $rankifyPostType) { // Attachments are their own can of worms — WordPress redirects them to the // parent post by default, so templating them would describe a page most // sites never actually serve. if ('attachment' === $rankifyPostType->name) { continue; } $rankifyEntities[$rankifyPostType->name] = [ 'label' => $rankifyPostType->labels->singular_name, 'group' => __('Post Types', 'crownify'), 'description' => sprintf( /* translators: %s: post type plural name. */ __('Single %s.', 'crownify'), strtolower($rankifyPostType->labels->name), ), 'articleType' => true, ]; if (!empty($rankifyPostType->has_archive)) { $rankifyEntities['pta_' . $rankifyPostType->name] = [ 'label' => sprintf( /* translators: %s: post type plural name. */ __('%s Archive', 'crownify'), $rankifyPostType->labels->name, ), 'group' => __('Post Types', 'crownify'), 'description' => __('The archive listing page for this post type.', 'crownify'), 'disableable' => true, ]; } } foreach (get_taxonomies(['public' => true], 'objects') as $rankifyTaxonomy) { $rankifyEntities['tax_' . $rankifyTaxonomy->name] = [ 'label' => $rankifyTaxonomy->labels->singular_name, 'group' => __('Taxonomies', 'crownify'), 'description' => sprintf( /* translators: %s: taxonomy singular name. */ __('Archive pages for each %s.', 'crownify'), strtolower($rankifyTaxonomy->labels->singular_name), ), 'disableable' => true, ]; } $rankifyEntities['author'] = [ 'label' => __('Author Archives', 'crownify'), 'group' => __('Special Pages', 'crownify'), 'description' => __('One page per author listing their posts. On a single-author site these duplicate the blog index exactly.', 'crownify'), 'disableable' => true, ]; $rankifyEntities['date'] = [ 'label' => __('Date Archives', 'crownify'), 'group' => __('Special Pages', 'crownify'), 'description' => __('Year, month and day listings. They rarely rank and duplicate your category pages.', 'crownify'), 'disableable' => true, ]; $rankifyEntities['search'] = [ 'label' => __('Search Results', 'crownify'), 'group' => __('Special Pages', 'crownify'), 'description' => __('Internal search result pages.', 'crownify'), 'forcedNoindex' => __('Search results are always noindexed. The URL space is infinite, so letting a crawler into it wastes your crawl budget and can generate thin pages without limit.', 'crownify'), ]; $rankifyEntities['notFound'] = [ 'label' => __('404 Page', 'crownify'), 'group' => __('Special Pages', 'crownify'), 'description' => __('The page shown when nothing matches the URL.', 'crownify'), 'forcedNoindex' => __('404 pages are always noindexed. They are not content, and indexing them puts error pages in search results.', 'crownify'), ]; // Attachment pages are core's to switch off since WP 6.4 — the toggle here // drives `wp_attachment_pages_enabled` rather than reimplementing the redirect. $rankifyEntities['mediaPages'] = [ 'label' => __('Media Pages', 'crownify'), 'group' => __('Special Pages', 'crownify'), 'description' => __('WordPress creates a page for every uploaded file containing just that file. On an image-heavy site these can outnumber your real pages.', 'crownify'), 'mediaToggle' => true, ]; // Group for display while keeping the flat keys the resolver expects. $rankifyGrouped = []; foreach ($rankifyEntities as $rankifyKey => $rankifyEntity) { $rankifyGrouped[$rankifyEntity['group']][$rankifyKey] = $rankifyEntity; } $rankifyToggleClass = 'relative w-11 h-6 !p-px bg-gray-200 !border-transparent !border text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 before:inline-block before:!size-5 before:bg-white checked:before:bg-white checked:before:m-0 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 text-start'; ?>
$rankifyGroupEntities): ?>

$rankifyEntity): $rankifyIsForced = !empty($rankifyEntity['forcedNoindex']); $rankifyNoindex = 'on' === Utils::getSetting("titles[{$rankifyKey}][noindex]"); ?>

data-dp-dependant-markup=' "titles[{$rankifyKey}][disabled]", 'value' => 'off', 'mode' => 'visibility'])); ?>'>
'title', 'placeholder' => __('Uses the site-wide template', 'crownify'), 'label' => $rankifyEntity['label'] . ' ' . __('title template', 'crownify'), ]), ); ?>'> ">
'description', 'placeholder' => __('Uses the site-wide template', 'crownify'), 'label' => $rankifyEntity['label'] . ' ' . __('description template', 'crownify'), ]), ); ?>'> ">

[__('Noindex', 'crownify'), __('Keep these pages out of search results.', 'crownify')], 'nofollow' => [__('Nofollow', 'crownify'), __('Tell crawlers not to follow links on these pages.', 'crownify')], 'noarchive' => [__('No Archive', 'crownify'), __('Prevent search engines showing a cached copy.', 'crownify')], 'noimageindex' => [__('No Image Index', 'crownify'), __('Keep images on these pages out of image search.', 'crownify')], ]; foreach ($rankifyDirectives as $rankifyDirective => $rankifyDirectiveMeta): [$rankifyDirectiveLabel, $rankifyDirectiveHint] = $rankifyDirectiveMeta; $rankifyFieldName = "titles[{$rankifyKey}][{$rankifyDirective}]"; $rankifyFieldId = "titles_{$rankifyKey}_{$rankifyDirective}"; ?>
__('Blog Posting', 'crownify'), 'Article' => __('Article', 'crownify'), 'NewsArticle' => __('News Article', 'crownify'), 'TechArticle' => __('Technical Article', 'crownify'), 'Report' => __('Report', 'crownify'), 'ScholarlyArticle' => __('Scholarly Article', 'crownify')]; $rankifyCurrentType = Utils::getSetting("titles[{$rankifyKey}][articleType]"); ?>