archives.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 = array(
  15. array(
  16. 'title' => esc_html__( 'Author archives settings', 'wordpress-seo' ),
  17. 'view_file' => 'paper-content/author-archive-settings.php',
  18. ),
  19. array(
  20. 'title' => esc_html__( 'Date archives settings', 'wordpress-seo' ),
  21. 'view_file' => 'paper-content/date-archives-settings.php',
  22. ),
  23. array(
  24. 'title' => esc_html__( 'Special Pages', 'wordpress-seo' ),
  25. 'view_file' => 'paper-content/special-pages.php',
  26. ),
  27. );
  28. $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
  29. $editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
  30. foreach ( $wpseo_archives as $wpseo_archive_index => $wpseo_archive ) {
  31. $wpseo_archive_presenter = new WPSEO_Paper_Presenter(
  32. $wpseo_archive['title'],
  33. dirname( __FILE__ ) . '/' . $wpseo_archive['view_file'],
  34. array(
  35. 'collapsible' => true,
  36. 'expanded' => ( $wpseo_archive_index === 0 ),
  37. 'recommended_replace_vars' => $recommended_replace_vars,
  38. 'editor_specific_replace_vars' => $editor_specific_replace_vars,
  39. )
  40. );
  41. echo $wpseo_archive_presenter->get_output();
  42. }
  43. unset( $wpseo_archives, $wpseo_archive_presenter, $wpseo_archive_index );