/** * Generates the header for admin pages * * @param bool $form Whether or not the form start tag should be included. * @param string $option The short name of the option to use for the current page. * @param bool $contains_files Whether the form should allow for file uploads. * @param bool $option_long_name Group name of the option. */ public function admin_header($form = true, $option = 'wpseo', $contains_files = false, $option_long_name = false) { if (!$option_long_name) { $option_long_name = WPSEO_Options::get_group_name($option); } ?> <div class="wrap wpseo-admin-page page-<?php echo $option; ?> "> <?php /** * Display the updated/error messages * Only needed as our settings page is not under options, otherwise it will automatically be included * @see settings_errors() */ require_once ABSPATH . 'wp-admin/options-head.php'; ?> <h1 id="wpseo-title"><?php echo esc_html(get_admin_page_title()); ?> </h1> <div class="wpseo_content_wrapper"> <div class="wpseo_content_cell" id="wpseo_content_top"> <?php if ($form === true) { $enctype = $contains_files ? ' enctype="multipart/form-data"' : ''; echo '<form action="' . esc_url(admin_url('options.php')) . '" method="post" id="wpseo-conf"' . $enctype . ' accept-charset="' . esc_attr(get_bloginfo('charset')) . '">'; settings_fields($option_long_name); } $this->set_option($option); }
* @package Admin */ /** * @todo - [JRF => whomever] check for other sitemap plugins which may conflict ? * @todo - [JRF => whomever] check for existance of .xls rewrite rule in .htaccess from * google-sitemaps-plugin/generator and remove as it will cause errors for our sitemaps * (or inform the user and disallow enabling of sitemaps ) * @todo - [JRF => whomever] check if anything along these lines is already being done */ if (!defined('WPSEO_VERSION')) { header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit; } global $wpseo_admin_pages; $wpseo_admin_pages->admin_header(true, WPSEO_Options::get_group_name('wpseo_xml'), 'wpseo_xml'); $options = get_option('wpseo_xml'); $content = $wpseo_admin_pages->checkbox('enablexmlsitemap', __('Check this box to enable XML sitemap functionality.', 'wordpress-seo'), false); $content .= '<div id="sitemapinfo">'; if (wpseo_is_nginx()) { $content .= '<div style="margin: 5px 0; padding: 3px 10px; background-color: #ffffe0; border: 1px solid #E6DB55; border-radius: 3px;">'; $content .= '<p>' . __('As you\'re on NGINX, you\'ll need the following rewrites:', 'wordpress-seo') . '</p>'; $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>'; }
<?php /** * @package WPSEO * @subpackage Admin */ if (!defined('WPSEO_VERSION')) { header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit; } global $wpseo_admin_pages; $wpseo_admin_pages->admin_header(true, WPSEO_Options::get_group_name('wpseo_internallinks'), 'wpseo_internallinks'); $content = $wpseo_admin_pages->checkbox('breadcrumbs-enable', __('Enable Breadcrumbs', 'wordpress-seo')); $content .= '<br/>'; $content .= $wpseo_admin_pages->textinput('breadcrumbs-sep', __('Separator between breadcrumbs', 'wordpress-seo')); $content .= $wpseo_admin_pages->textinput('breadcrumbs-home', __('Anchor text for the Homepage', 'wordpress-seo')); $content .= $wpseo_admin_pages->textinput('breadcrumbs-prefix', __('Prefix for the breadcrumb path', 'wordpress-seo')); $content .= $wpseo_admin_pages->textinput('breadcrumbs-archiveprefix', __('Prefix for Archive breadcrumbs', 'wordpress-seo')); $content .= $wpseo_admin_pages->textinput('breadcrumbs-searchprefix', __('Prefix for Search Page breadcrumbs', 'wordpress-seo')); $content .= $wpseo_admin_pages->textinput('breadcrumbs-404crumb', __('Breadcrumb for 404 Page', 'wordpress-seo')); if (get_option('show_on_front') == 'page' && get_option('page_for_posts') > 0) { $content .= $wpseo_admin_pages->checkbox('breadcrumbs-blog-remove', __('Remove Blog page from Breadcrumbs', 'wordpress-seo')); } $content .= $wpseo_admin_pages->checkbox('breadcrumbs-boldlast', __('Bold the last page in the breadcrumb', 'wordpress-seo')); $content .= '<br/><br/>'; $post_types = get_post_types(array('public' => true), 'objects'); if (is_array($post_types) && $post_types !== array()) { $content .= '<strong>' . __('Taxonomy to show in breadcrumbs for:', 'wordpress-seo') . '</strong><br/>'; foreach ($post_types as $pt) { $taxonomies = get_object_taxonomies($pt->name, 'objects');