17 // "Borrow" xfn.js for now so we don't have to create new files. |
17 // "Borrow" xfn.js for now so we don't have to create new files. |
18 wp_enqueue_script( 'xfn' ); |
18 wp_enqueue_script( 'xfn' ); |
19 |
19 |
20 } else { |
20 } else { |
21 |
21 |
22 $title = __('Tools'); |
22 $title = __( 'Tools' ); |
23 |
23 |
24 get_current_screen()->add_help_tab( array( |
24 get_current_screen()->add_help_tab( |
25 'id' => 'converter', |
25 array( |
26 'title' => __('Categories and Tags Converter'), |
26 'id' => 'converter', |
27 '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>' . |
27 'title' => __( 'Categories and Tags Converter' ), |
28 '<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>', |
28 '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>' . |
29 ) ); |
29 '<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>', |
|
30 ) |
|
31 ); |
30 |
32 |
31 get_current_screen()->set_help_sidebar( |
33 get_current_screen()->set_help_sidebar( |
32 '<p><strong>' . __('For more information:') . '</strong></p>' . |
34 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
33 '<p>' . __('<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>') . '</p>' . |
35 '<p>' . __( '<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>' ) . '</p>' . |
34 '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' |
36 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
35 ); |
37 ); |
36 } |
38 } |
37 |
39 |
38 require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
40 require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
39 |
41 |
50 <?php |
52 <?php |
51 |
53 |
52 } else { |
54 } else { |
53 |
55 |
54 if ( current_user_can( 'import' ) ) : |
56 if ( current_user_can( 'import' ) ) : |
55 $cats = get_taxonomy('category'); |
57 $cats = get_taxonomy( 'category' ); |
56 $tags = get_taxonomy('post_tag'); |
58 $tags = get_taxonomy( 'post_tag' ); |
57 if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?> |
59 if ( current_user_can( $cats->cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) : |
|
60 ?> |
58 <div class="card"> |
61 <div class="card"> |
59 <h2 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h2> |
62 <h2 class="title"><?php _e( 'Categories and Tags Converter' ); ?></h2> |
60 <p><?php printf( __('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> |
63 <p><?php printf( __( '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> |
61 </div> |
64 </div> |
62 <?php |
65 <?php |
63 endif; |
66 endif; |
64 endif; |
67 endif; |
65 |
68 |
66 /** |
69 /** |
67 * Fires at the end of the Tools Administration screen. |
70 * Fires at the end of the Tools Administration screen. |