author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Tools Administration Screen. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
16 | 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 ( 'export_personal_data' === $_GET['page'] ) { |
|
13 |
require_once ABSPATH . 'wp-admin/export-personal-data.php'; |
|
14 |
return; |
|
15 |
} elseif ( 'remove_personal_data' === $_GET['page'] ) { |
|
16 |
require_once ABSPATH . 'wp-admin/erase-personal-data.php'; |
|
17 |
return; |
|
18 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
19 |
} |
0 | 20 |
|
16 | 21 |
// The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php. |
22 |
if ( isset( $_GET['wp-privacy-policy-guide'] ) ) { |
|
23 |
require_once dirname( __DIR__ ) . '/wp-load.php'; |
|
18 | 24 |
wp_redirect( admin_url( 'options-privacy.php?tab=policyguide' ), 301 ); |
16 | 25 |
exit; |
26 |
} elseif ( isset( $_GET['page'] ) ) { |
|
27 |
// These were also moved to files in WP 5.3. |
|
28 |
if ( 'export_personal_data' === $_GET['page'] ) { |
|
29 |
require_once dirname( __DIR__ ) . '/wp-load.php'; |
|
30 |
wp_redirect( admin_url( 'export-personal-data.php' ), 301 ); |
|
31 |
exit; |
|
32 |
} elseif ( 'remove_personal_data' === $_GET['page'] ) { |
|
33 |
require_once dirname( __DIR__ ) . '/wp-load.php'; |
|
34 |
wp_redirect( admin_url( 'erase-personal-data.php' ), 301 ); |
|
35 |
exit; |
|
36 |
} |
|
37 |
} |
|
38 |
||
39 |
/** WordPress Administration Bootstrap */ |
|
40 |
require_once __DIR__ . '/admin.php'; |
|
41 |
||
19 | 42 |
// Used in the HTML title tag. |
16 | 43 |
$title = __( 'Tools' ); |
44 |
||
45 |
get_current_screen()->add_help_tab( |
|
46 |
array( |
|
47 |
'id' => 'converter', |
|
48 |
'title' => __( 'Categories and Tags Converter' ), |
|
49 |
'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>' . |
|
50 |
'<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>', |
|
51 |
) |
|
52 |
); |
|
53 |
||
54 |
get_current_screen()->set_help_sidebar( |
|
55 |
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
56 |
'<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-screen/">Documentation on Tools</a>' ) . '</p>' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
57 |
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' |
16 | 58 |
); |
59 |
||
60 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
|
0 | 61 |
|
62 |
?> |
|
63 |
<div class="wrap"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
64 |
<h1><?php echo esc_html( $title ); ?></h1> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
65 |
<?php |
5 | 66 |
|
16 | 67 |
if ( current_user_can( 'import' ) ) : |
68 |
$cats = get_taxonomy( 'category' ); |
|
69 |
$tags = get_taxonomy( 'post_tag' ); |
|
70 |
if ( current_user_can( $cats->cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) : |
|
71 |
?> |
|
72 |
<div class="card"> |
|
73 |
<h2 class="title"><?php _e( 'Categories and Tags Converter' ); ?></h2> |
|
74 |
<p> |
|
75 |
<?php |
|
76 |
printf( |
|
77 |
/* translators: %s: URL to Import screen. */ |
|
78 |
__( '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.' ), |
|
79 |
'import.php' |
|
80 |
); |
|
9 | 81 |
?> |
16 | 82 |
</p> |
83 |
</div> |
|
84 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
85 |
endif; |
16 | 86 |
endif; |
5 | 87 |
|
16 | 88 |
/** |
89 |
* Fires at the end of the Tools Administration screen. |
|
90 |
* |
|
91 |
* @since 2.8.0 |
|
92 |
*/ |
|
93 |
do_action( 'tool_box' ); |
|
94 |
||
0 | 95 |
?> |
96 |
</div> |
|
97 |
<?php |
|
16 | 98 |
|
99 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |