wpseo-export.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. /* translators: %1$s expands to Yoast SEO */
  13. $submit_button_value = sprintf( __( 'Export your %1$s settings', 'wordpress-seo' ), 'Yoast SEO' );
  14. if ( filter_input( INPUT_POST, 'do_export' ) ) {
  15. $export = new WPSEO_Export();
  16. $export->export();
  17. return;
  18. }
  19. $wpseo_export_phrase = sprintf(
  20. /* translators: %1$s expands to Yoast SEO */
  21. __( 'Export your %1$s settings here, to copy them on another site.', 'wordpress-seo' ),
  22. 'Yoast SEO'
  23. );
  24. ?>
  25. <p><?php echo esc_html( $wpseo_export_phrase ); ?></p>
  26. <form
  27. action="<?php echo esc_url( admin_url( 'admin.php?page=wpseo_tools&tool=import-export#top#wpseo-export' ) ); ?>"
  28. method="post"
  29. accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
  30. <?php wp_nonce_field( WPSEO_Export::NONCE_ACTION ); ?>
  31. <input type="hidden" name="do_export" value="1" />
  32. <button type="submit" class="button button-primary" id="export-button"><?php echo esc_html( $submit_button_value ); ?></button>
  33. </form>