$content .= '<pre>rewrite ^/sitemap_index\\.xml$ /index.php?sitemap=1 last; rewrite ^/([^/]+?)-sitemap([0-9]+)?\\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;</pre>'; $content .= '</div>'; } if ($options['enablexmlsitemap'] === true) { $content .= '<p>' . sprintf(esc_html__('You can find your XML Sitemap here: %sXML Sitemap%s', 'wordpress-seo'), '<a target="_blank" class="button-secondary" href="' . esc_url(wpseo_xml_sitemaps_base_url('sitemap_index.xml')) . '">', '</a>') . '<br/><br/>' . __('You do <strong>not</strong> need to generate the XML sitemap, nor will it take up time to generate after publishing a post.', 'wordpress-seo') . '</p>'; } else { $content .= '<p>' . __('Save your settings to activate XML Sitemaps.', 'wordpress-seo') . '</p>'; } // When we write the help tab for this we should definitely reference this plugin :https://wordpress.org/plugins/edit-author-slug/ $content .= '<h2>' . __('User sitemap', 'wordpress-seo') . '</h2>'; $content .= $wpseo_admin_pages->checkbox('disable_author_sitemap', __('Disable author/user sitemap', 'wordpress-seo'), false); $content .= '<div id="xml_user_block">'; $content .= '<p><strong>' . __('Exclude users without posts', 'wordpress-seo') . '</strong><br/>'; $content .= $wpseo_admin_pages->checkbox('disable_author_noposts', __('Disable all users with zero posts', 'wordpress-seo'), false); $roles = wpseo_get_roles(); if (is_array($roles) && $roles !== array()) { $content .= '<p><strong>' . __('Exclude user roles', 'wordpress-seo') . '</strong><br/>'; $content .= __('Please check the appropriate box below if there\'s a user role that you do <strong>NOT</strong> want to include in your sitemap:', 'wordpress-seo') . '</p>'; foreach ($roles as $role_key => $role_name) { $content .= $wpseo_admin_pages->checkbox('user_role-' . $role_key . '-not_in_sitemap', $role_name); } } $content .= '</div>'; $content .= '<br/>'; $content .= '<h2>' . __('General settings', 'wordpress-seo') . '</h2>'; $content .= '<p>' . __('After content publication, the plugin automatically pings Google and Bing, do you need it to ping other search engines too? If so, check the box:', 'wordpress-seo') . '</p>'; $content .= $wpseo_admin_pages->checkbox('xml_ping_yahoo', __('Ping Yahoo!', 'wordpress-seo'), false); $content .= $wpseo_admin_pages->checkbox('xml_ping_ask', __('Ping Ask.com', 'wordpress-seo'), false); $post_types = apply_filters('wpseo_sitemaps_supported_post_types', get_post_types(array('public' => true), 'objects')); if (is_array($post_types) && $post_types !== array()) {
/** * Add dynamically created default options based on available post types and taxonomies * * @return void */ public function enrich_defaults() { $user_roles = wpseo_get_roles(); $filtered_user_roles = apply_filters('wpseo_sitemaps_supported_user_roles', $user_roles); if (is_array($filtered_user_roles) && $filtered_user_roles !== array()) { foreach ($filtered_user_roles as $role_name => $role_value) { $this->defaults['user_role-' . $role_name . '-not_in_sitemap'] = false; unset($user_role); } } unset($filtered_user_roles); $post_type_names = get_post_types(array('public' => true), 'names'); $filtered_post_types = apply_filters('wpseo_sitemaps_supported_post_types', $post_type_names); if (is_array($filtered_post_types) && $filtered_post_types !== array()) { foreach ($filtered_post_types as $pt) { if ($pt !== 'attachment') { $this->defaults['post_types-' . $pt . '-not_in_sitemap'] = false; } else { $this->defaults['post_types-' . $pt . '-not_in_sitemap'] = true; } } unset($pt); } unset($filtered_post_types); $taxonomy_objects = get_taxonomies(array('public' => true), 'objects'); $filtered_taxonomies = apply_filters('wpseo_sitemaps_supported_taxonomies', $taxonomy_objects); if (is_array($filtered_taxonomies) && $filtered_taxonomies !== array()) { foreach ($filtered_taxonomies as $tax) { if (isset($tax->labels->name) && trim($tax->labels->name) != '') { $this->defaults['taxonomies-' . $tax->name . '-not_in_sitemap'] = false; } } unset($tax); } unset($filtered_taxonomies); }