date-archives-settings.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Views\Archive
  6. *
  7. * @uses Yoast_Form $yform Form object.
  8. */
  9. $yform->toggle_switch(
  10. 'disable-date',
  11. [
  12. 'off' => __( 'Enabled', 'wordpress-seo' ),
  13. 'on' => __( 'Disabled', 'wordpress-seo' ),
  14. ],
  15. __( 'Date archives', 'wordpress-seo' )
  16. );
  17. ?>
  18. <div id='date-archives-titles-metas-content' class='archives-titles-metas-content'>
  19. <?php
  20. $date_archives_help = new WPSEO_Admin_Help_Panel(
  21. 'noindex-archive-wpseo',
  22. esc_html__( 'Help on the date archives search results setting', 'wordpress-seo' ),
  23. sprintf(
  24. /* translators: 1: expands to <code>noindex</code>; 2: link open tag; 3: link close tag. */
  25. esc_html__( 'Not showing the date archives in the search results technically means those will have a %1$s robots meta. %2$sMore info on the search results settings%3$s.', 'wordpress-seo' ),
  26. '<code>noindex</code>',
  27. '<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/show-x' ) ) . '" target="_blank" rel="noopener noreferrer">',
  28. '</a>'
  29. )
  30. );
  31. $yform->index_switch(
  32. 'noindex-archive-wpseo',
  33. __( 'date archives', 'wordpress-seo' ),
  34. $date_archives_help->get_button_html() . $date_archives_help->get_panel_html()
  35. );
  36. $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
  37. $editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
  38. $editor = new WPSEO_Replacevar_Editor(
  39. $yform,
  40. [
  41. 'title' => 'title-archive-wpseo',
  42. 'description' => 'metadesc-archive-wpseo',
  43. 'page_type_recommended' => $recommended_replace_vars->determine_for_archive( 'date' ),
  44. 'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( 'date' ),
  45. 'paper_style' => false,
  46. ]
  47. );
  48. $editor->render();
  49. ?>
  50. </div>