Edit File by line
/home/barbar84/public_h.../wp-admin
File: tools.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Tools Administration Screen.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
if ( isset( $_GET['page'] ) && ! empty( $_POST ) ) {
[8] Fix | Delete
// Ensure POST-ing to `tools.php?page=export_personal_data` and `tools.php?page=remove_personal_data`
[9] Fix | Delete
// continues to work after creating the new files for exporting and erasing of personal data.
[10] Fix | Delete
if ( 'export_personal_data' === $_GET['page'] ) {
[11] Fix | Delete
require_once ABSPATH . 'wp-admin/export-personal-data.php';
[12] Fix | Delete
return;
[13] Fix | Delete
} elseif ( 'remove_personal_data' === $_GET['page'] ) {
[14] Fix | Delete
require_once ABSPATH . 'wp-admin/erase-personal-data.php';
[15] Fix | Delete
return;
[16] Fix | Delete
}
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
// The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php.
[20] Fix | Delete
if ( isset( $_GET['wp-privacy-policy-guide'] ) ) {
[21] Fix | Delete
require_once dirname( __DIR__ ) . '/wp-load.php';
[22] Fix | Delete
wp_redirect( admin_url( 'options-privacy.php?tab=policyguide' ), 301 );
[23] Fix | Delete
exit;
[24] Fix | Delete
} elseif ( isset( $_GET['page'] ) ) {
[25] Fix | Delete
// These were also moved to files in WP 5.3.
[26] Fix | Delete
if ( 'export_personal_data' === $_GET['page'] ) {
[27] Fix | Delete
require_once dirname( __DIR__ ) . '/wp-load.php';
[28] Fix | Delete
wp_redirect( admin_url( 'export-personal-data.php' ), 301 );
[29] Fix | Delete
exit;
[30] Fix | Delete
} elseif ( 'remove_personal_data' === $_GET['page'] ) {
[31] Fix | Delete
require_once dirname( __DIR__ ) . '/wp-load.php';
[32] Fix | Delete
wp_redirect( admin_url( 'erase-personal-data.php' ), 301 );
[33] Fix | Delete
exit;
[34] Fix | Delete
}
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
/** WordPress Administration Bootstrap */
[38] Fix | Delete
require_once __DIR__ . '/admin.php';
[39] Fix | Delete
[40] Fix | Delete
$title = __( 'Tools' );
[41] Fix | Delete
[42] Fix | Delete
get_current_screen()->add_help_tab(
[43] Fix | Delete
array(
[44] Fix | Delete
'id' => 'converter',
[45] Fix | Delete
'title' => __( 'Categories and Tags Converter' ),
[46] Fix | Delete
'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>' .
[47] Fix | Delete
'<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>',
[48] Fix | Delete
)
[49] Fix | Delete
);
[50] Fix | Delete
[51] Fix | Delete
get_current_screen()->set_help_sidebar(
[52] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[53] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/article/tools-screen/">Documentation on Tools</a>' ) . '</p>' .
[54] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[55] Fix | Delete
);
[56] Fix | Delete
[57] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[58] Fix | Delete
[59] Fix | Delete
?>
[60] Fix | Delete
<div class="wrap">
[61] Fix | Delete
<h1><?php echo esc_html( $title ); ?></h1>
[62] Fix | Delete
<?php
[63] Fix | Delete
[64] Fix | Delete
if ( current_user_can( 'import' ) ) :
[65] Fix | Delete
$cats = get_taxonomy( 'category' );
[66] Fix | Delete
$tags = get_taxonomy( 'post_tag' );
[67] Fix | Delete
if ( current_user_can( $cats->cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) :
[68] Fix | Delete
?>
[69] Fix | Delete
<div class="card">
[70] Fix | Delete
<h2 class="title"><?php _e( 'Categories and Tags Converter' ); ?></h2>
[71] Fix | Delete
<p>
[72] Fix | Delete
<?php
[73] Fix | Delete
printf(
[74] Fix | Delete
/* translators: %s: URL to Import screen. */
[75] Fix | Delete
__( '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.' ),
[76] Fix | Delete
'import.php'
[77] Fix | Delete
);
[78] Fix | Delete
?>
[79] Fix | Delete
</p>
[80] Fix | Delete
</div>
[81] Fix | Delete
<?php
[82] Fix | Delete
endif;
[83] Fix | Delete
endif;
[84] Fix | Delete
[85] Fix | Delete
/**
[86] Fix | Delete
* Fires at the end of the Tools Administration screen.
[87] Fix | Delete
*
[88] Fix | Delete
* @since 2.8.0
[89] Fix | Delete
*/
[90] Fix | Delete
do_action( 'tool_box' );
[91] Fix | Delete
[92] Fix | Delete
?>
[93] Fix | Delete
</div>
[94] Fix | Delete
<?php
[95] Fix | Delete
[96] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[97] Fix | Delete
[98] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function