archives.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Views
  6. */
  7. if ( ! defined( 'WPSEO_VERSION' ) ) {
  8. header( 'Status: 403 Forbidden' );
  9. header( 'HTTP/1.1 403 Forbidden' );
  10. exit();
  11. }
  12. // To improve readability, this tab has been divided into separate blocks, included below.
  13. require dirname( __FILE__ ) . '/archives/help.php';
  14. $wpseo_archives = [
  15. [
  16. 'title' => esc_html__( 'Author archives settings', 'wordpress-seo' ),
  17. 'view_file' => 'paper-content/author-archive-settings.php',
  18. 'paper_id' => 'settings-author-archives',
  19. ],
  20. [
  21. 'title' => esc_html__( 'Date archives settings', 'wordpress-seo' ),
  22. 'view_file' => 'paper-content/date-archives-settings.php',
  23. 'paper_id' => 'settings-date-archives',
  24. ],
  25. [
  26. 'title' => esc_html__( 'Special Pages', 'wordpress-seo' ),
  27. 'view_file' => 'paper-content/special-pages.php',
  28. 'paper_id' => 'settings-special-pages',
  29. ],
  30. ];
  31. $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
  32. $editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
  33. foreach ( $wpseo_archives as $wpseo_archive_index => $wpseo_archive ) {
  34. $wpseo_archive_presenter = new WPSEO_Paper_Presenter(
  35. $wpseo_archive['title'],
  36. dirname( __FILE__ ) . '/' . $wpseo_archive['view_file'],
  37. [
  38. 'collapsible' => true,
  39. 'expanded' => ( $wpseo_archive_index === 0 ),
  40. 'paper_id' => $wpseo_archive['paper_id'],
  41. 'recommended_replace_vars' => $recommended_replace_vars,
  42. 'editor_specific_replace_vars' => $editor_specific_replace_vars,
  43. 'class' => 'search-appearance',
  44. ]
  45. );
  46. echo $wpseo_archive_presenter->get_output();
  47. }
  48. unset( $wpseo_archives, $wpseo_archive_presenter, $wpseo_archive_index );