2008-09-30 23:39:13 +02:00
< ? php
/**
2011-04-28 17:24:49 +02:00
* Tools Administration Screen .
2008-09-30 23:39:13 +02:00
*
* @ package WordPress
* @ subpackage Administration
*/
2019-05-26 22:50:53 +02:00
if ( isset ( $_GET [ 'page' ] ) && ! empty ( $_POST ) ) {
// Ensure POST-ing to `tools.php?page=export_personal_data` and `tools.php?page=remove_personal_data`
// continues to work after creating the new files for exporting and erasing of personal data.
2020-02-09 17:55:09 +01:00
if ( 'export_personal_data' === $_GET [ 'page' ] ) {
2020-02-06 07:33:11 +01:00
require_once ABSPATH . 'wp-admin/export-personal-data.php' ;
2019-05-26 22:50:53 +02:00
return ;
2020-02-09 17:55:09 +01:00
} elseif ( 'remove_personal_data' === $_GET [ 'page' ] ) {
2020-02-06 07:33:11 +01:00
require_once ABSPATH . 'wp-admin/erase-personal-data.php' ;
2019-05-26 22:50:53 +02:00
return ;
}
}
2008-09-30 23:39:13 +02:00
/** WordPress Administration Bootstrap */
2020-02-06 07:33:11 +01:00
require_once __DIR__ . '/admin.php' ;
2008-09-30 23:39:13 +02:00
2019-05-26 22:50:53 +02:00
// The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php.
if ( isset ( $_GET [ 'wp-privacy-policy-guide' ] ) ) {
wp_redirect ( admin_url ( 'privacy-policy-guide.php' ), 301 );
exit ;
} elseif ( isset ( $_GET [ 'page' ] ) ) {
// These were also moved to files in WP 5.3.
2020-02-09 17:55:09 +01:00
if ( 'export_personal_data' === $_GET [ 'page' ] ) {
2019-05-26 22:50:53 +02:00
wp_redirect ( admin_url ( 'export-personal-data.php' ), 301 );
exit ;
2020-02-09 17:55:09 +01:00
} elseif ( 'remove_personal_data' === $_GET [ 'page' ] ) {
2019-05-26 22:50:53 +02:00
wp_redirect ( admin_url ( 'erase-personal-data.php' ), 301 );
exit ;
}
}
2018-05-09 22:51:23 +02:00
2019-05-26 22:50:53 +02:00
$title = __ ( 'Tools' );
2018-05-09 22:51:23 +02:00
2019-05-26 22:50:53 +02:00
get_current_screen () -> add_help_tab (
array (
'id' => 'converter' ,
'title' => __ ( 'Categories and Tags Converter' ),
'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>' .
'<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 & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>' ,
)
);
2018-05-09 22:51:23 +02:00
2019-05-26 22:50:53 +02:00
get_current_screen () -> set_help_sidebar (
'<p><strong>' . __ ( 'For more information:' ) . '</strong></p>' .
2019-07-26 00:45:57 +02:00
'<p>' . __ ( '<a href="https://wordpress.org/support/article/tools-screen/">Documentation on Tools</a>' ) . '</p>' .
2019-05-26 22:50:53 +02:00
'<p>' . __ ( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
);
2010-05-27 00:18:19 +02:00
2020-02-06 07:33:11 +01:00
require_once ABSPATH . 'wp-admin/admin-header.php' ;
2008-09-30 23:39:13 +02:00
2008-11-27 22:11:25 +01:00
?>
2008-11-28 11:14:43 +01:00
< div class = " wrap " >
2015-06-27 17:41:25 +02:00
< h1 >< ? php echo esc_html ( $title ); ?> </h1>
2009-05-29 21:15:32 +02:00
< ? php
2010-05-27 06:35:11 +02:00
2019-05-27 04:40:53 +02:00
if ( current_user_can ( 'import' ) ) :
$cats = get_taxonomy ( 'category' );
$tags = get_taxonomy ( 'post_tag' );
if ( current_user_can ( $cats -> cap -> manage_terms ) || current_user_can ( $tags -> cap -> manage_terms ) ) :
?>
< div class = " card " >
< h2 class = " title " >< ? php _e ( 'Categories and Tags Converter' ); ?> </h2>
I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.
Includes minor code layout fixes.
Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!
Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.
Built from https://develop.svn.wordpress.org/trunk@45926
git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 19:13:59 +02:00
< p >
< ? php
printf (
2020-01-20 16:43:04 +01:00
/* translators: %s: URL to Import screen. */
I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.
Includes minor code layout fixes.
Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!
Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.
Built from https://develop.svn.wordpress.org/trunk@45926
git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 19:13:59 +02:00
__ ( '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.' ),
'import.php'
);
?>
</ p >
2019-05-27 04:40:53 +02:00
</ div >
< ? php
2018-05-09 22:51:23 +02:00
endif ;
2019-05-27 04:40:53 +02:00
endif ;
2018-05-09 22:51:23 +02:00
2019-05-27 04:40:53 +02:00
/**
* Fires at the end of the Tools Administration screen .
*
* @ since 2.8 . 0
*/
do_action ( 'tool_box' );
2019-05-26 22:50:53 +02:00
2009-05-29 21:15:32 +02:00
?>
2008-11-28 11:14:43 +01:00
</ div >
2008-11-27 22:11:25 +01:00
< ? php
2019-05-26 22:50:53 +02:00
2020-02-06 07:33:11 +01:00
require_once ABSPATH . 'wp-admin/admin-footer.php' ;