[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-admin/ -> tools.php (source)

   1  <?php
   2  /**
   3   * Tools Administration Screen.
   4   *
   5   * @package WordPress
   6   * @subpackage Administration
   7   */
   8  
   9  if ( isset( $_GET['page'] ) && ! empty( $_POST ) ) {
  10      // Ensure POST-ing to `tools.php?page=export_personal_data` and `tools.php?page=remove_personal_data`
  11      // continues to work after creating the new files for exporting and erasing of personal data.
  12      if ( $_GET['page'] === 'export_personal_data' ) {
  13          require_once ( ABSPATH . 'wp-admin/export-personal-data.php' );
  14          return;
  15      } elseif ( $_GET['page'] === 'remove_personal_data' ) {
  16          require_once ( ABSPATH . 'wp-admin/erase-personal-data.php' );
  17          return;
  18      }
  19  }
  20  
  21  /** WordPress Administration Bootstrap */
  22  require_once( dirname( __FILE__ ) . '/admin.php' );
  23  
  24  // The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php.
  25  if ( isset( $_GET['wp-privacy-policy-guide'] ) ) {
  26      wp_redirect( admin_url( 'privacy-policy-guide.php' ), 301 );
  27      exit;
  28  } elseif ( isset( $_GET['page'] ) ) {
  29      // These were also moved to files in WP 5.3.
  30      if ( $_GET['page'] === 'export_personal_data' ) {
  31          wp_redirect( admin_url( 'export-personal-data.php' ), 301 );
  32          exit;
  33      } elseif ( $_GET['page'] === 'remove_personal_data' ) {
  34          wp_redirect( admin_url( 'erase-personal-data.php' ), 301 );
  35          exit;
  36      }
  37  }
  38  
  39  $title = __( 'Tools' );
  40  
  41  get_current_screen()->add_help_tab(
  42      array(
  43          'id'      => 'converter',
  44          'title'   => __( 'Categories and Tags Converter' ),
  45          'content' => '<p>' . __( 'Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
  46          '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
  47      )
  48  );
  49  
  50  get_current_screen()->set_help_sidebar(
  51      '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
  52      '<p>' . __( '<a href="https://wordpress.org/support/article/tools-screen/">Documentation on Tools</a>' ) . '</p>' .
  53      '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
  54  );
  55  
  56  require_once ( ABSPATH . 'wp-admin/admin-header.php' );
  57  
  58  ?>
  59  <div class="wrap">
  60  <h1><?php echo esc_html( $title ); ?></h1>
  61  <?php
  62  
  63  if ( current_user_can( 'import' ) ) :
  64      $cats = get_taxonomy( 'category' );
  65      $tags = get_taxonomy( 'post_tag' );
  66      if ( current_user_can( $cats->cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) :
  67          ?>
  68          <div class="card">
  69              <h2 class="title"><?php _e( 'Categories and Tags Converter' ); ?></h2>
  70              <p>
  71              <?php
  72                  printf(
  73                      /* translators: URL to Import screen. */
  74                      __( 'If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.' ),
  75                      'import.php'
  76                  );
  77              ?>
  78              </p>
  79          </div>
  80          <?php
  81      endif;
  82  endif;
  83  
  84  /**
  85   * Fires at the end of the Tools Administration screen.
  86   *
  87   * @since 2.8.0
  88   */
  89  do_action( 'tool_box' );
  90  
  91  ?>
  92  </div>
  93  <?php
  94  
  95  include ( ABSPATH . 'wp-admin/admin-footer.php' );


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7