3 * @package WPSEO\Admin|Google_Search_Console
5 * This is the view for the modal box that appears when the create redirect link is clicked
9 * @var string $view_type The type of view to be displayed, can be 'create', 'already_exists', 'no_premium'
10 * @var string $current_redirect The existing redirect
11 * @var string $url Redirect for URL
15 <div id='redirect-<?php echo md5( $url ); ?>' style='display: none;'>
17 <div class='form-wrap wpseo_content_wrapper'>
19 switch ( $view_type ) {
21 echo '<h3>', __( 'Redirect this broken URL and fix the error', 'wordpress-seo' ), '</h3>';
23 <div class='form-field form-required'>
24 <label for='wpseo-current-url'><?php _e( 'Current URL:', 'wordpress-seo' ); ?></label>
25 <input type='text' id='wpseo-current-url' name='current_url' value='<?php echo $url; ?>' disabled='disabled'>
27 <div class='form-field form-required'>
28 <label for='wpseo-new-url'><?php _e( 'New URL:', 'wordpress-seo' ); ?></label>
29 <input type='text' id='wpseo-new-url' name='new_url' autofocus value=''>
31 <div class='form-field form-required'>
32 <label for='wpseo-mark-as-fixed' class='clear'><?php _e( 'Mark as fixed:', 'wordpress-seo' ); ?></label>
33 <input type='checkbox' checked value='1' id='wpseo-mark-as-fixed' name='mark_as_fixed' class='clear' >
35 /* Translators: %1$s: expands to 'Google Search Console'. */
36 echo sprintf( __( 'Mark this issue as fixed in %1$s.', 'wordpress-seo' ), 'Google Search Console' );
40 <input type='button' name='submit' id='submit' class='button button-primary' value='<?php _e( 'Create redirect', 'wordpress-seo' ); ?>' onclick='wpseo_gsc_post_redirect( jQuery( this ) );' />
45 case 'already_exists' :
46 echo '<h3>', __( 'Error: a redirect for this URL already exists', 'wordpress-seo' ), '</h3>';
49 /* Translators: %1$s: expands to the current url and %2$s expands to url the redirects points to. */
51 __( 'You do not have to create a redirect for URL %1$s because a redirect already exists. The existing redirect points to %2$s. If this is fine you can mark this issue as fixed. If not, please go to the redirects page and change the target URL.', 'wordpress-seo' ),
59 /* Translators: %s: expands to Yoast SEO Premium */
60 echo '<h3>', sprintf( __( 'Creating redirects is a %s feature', 'wordpress-seo' ), 'Yoast SEO Premium' ), '</h3>';
62 /* Translators: %1$s: expands to 'Yoast SEO Premium', %2$s: links to Yoast SEO Premium plugin page. */
64 __( 'To be able to create a redirect and fix this issue, you need %1$s. You can buy the plugin, including one year support and updates, on %2$s.', 'wordpress-seo' ),
66 '<a href="http://yoa.st/redirects" target="_blank">yoast.com</a>'