2008-09-30 17:39:13 -04:00
< ? php
/**
2011-04-28 11:24:49 -04:00
* Tools Administration Screen .
2008-09-30 17:39:13 -04:00
*
* @ package WordPress
* @ subpackage Administration
*/
/** WordPress Administration Bootstrap */
2013-09-24 20:18:11 -04:00
require_once ( dirname ( __FILE__ ) . '/admin.php' );
2008-09-30 17:39:13 -04:00
2008-11-27 16:11:25 -05:00
$title = __ ( 'Tools' );
2008-09-30 17:39:13 -04:00
2011-11-28 11:44:08 -05:00
get_current_screen () -> add_help_tab ( array (
'id' => 'press-this' ,
'title' => __ ( 'Press This' ),
'content' => '<p>' . __ ( 'Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you’ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.' ) . '</p>' ,
) );
get_current_screen () -> add_help_tab ( array (
'id' => 'converter' ,
2011-11-30 20:17:14 -05:00
'title' => __ ( 'Categories and Tags Converter' ),
2012-05-05 15:09:08 -04:00
'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>' ,
2011-11-28 11:44:08 -05:00
) );
2011-11-01 23:12:37 -04:00
2011-11-02 16:14:10 -04:00
get_current_screen () -> set_help_sidebar (
2010-05-27 07:52:15 -04:00
'<p><strong>' . __ ( 'For more information:' ) . '</strong></p>' .
2016-10-04 03:08:29 -04:00
'<p>' . __ ( '<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>' ) . '</p>' .
'<p>' . __ ( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>'
2010-05-26 18:18:19 -04:00
);
2013-09-24 20:18:11 -04:00
require_once ( ABSPATH . 'wp-admin/admin-header.php' );
2008-09-30 17:39:13 -04:00
2008-11-27 16:11:25 -05:00
?>
2008-11-28 05:14:43 -05:00
< div class = " wrap " >
2015-06-27 11:41:25 -04:00
< h1 >< ? php echo esc_html ( $title ); ?> </h1>
2008-11-28 05:14:43 -05:00
2009-04-01 01:41:52 -04:00
< ? php if ( current_user_can ( 'edit_posts' ) ) : ?>
2015-03-17 21:58:27 -04:00
< div class = " card pressthis " >
2015-08-30 23:32:21 -04:00
< h2 >< ? php _e ( 'Press This' ) ?> </h2>
2015-04-01 21:30:28 -04:00
< p >< ? php _e ( 'Press This is a little tool that lets you grab bits of the web and create new posts with ease.' ); ?> </p>
2015-03-17 21:58:27 -04:00
< p >< ? php _e ( 'Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.' ); ?> </p>
PressThis v2, first run. Props michael-arestad, stephdau, marcelomazza, DrewAPicture, iseulde, afercia, kraftbj, rachelbaker, AramZS, dd32. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31534
git-svn-id: http://core.svn.wordpress.org/trunk@31515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-24 20:50:26 -05:00
< form >
< h3 >< ? php _e ( 'Install Press This' ); ?> </h3>
< h4 >< ? php _e ( 'Bookmarklet' ); ?> </h4>
2015-03-13 13:31:28 -04:00
< p >< ? php _e ( 'Drag the bookmarklet below to your bookmarks bar. Then, when you’re on a page you want to share, simply “press” it.' ); ?> </p>
PressThis v2, first run. Props michael-arestad, stephdau, marcelomazza, DrewAPicture, iseulde, afercia, kraftbj, rachelbaker, AramZS, dd32. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31534
git-svn-id: http://core.svn.wordpress.org/trunk@31515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-24 20:50:26 -05:00
2015-03-17 21:58:27 -04:00
< p class = " pressthis-bookmarklet-wrapper " >
< a class = " pressthis-bookmarklet " onclick = " return false; " href = " <?php echo htmlspecialchars( get_shortcut_link() ); ?> " >< span >< ? php _e ( 'Press This' ); ?> </span></a>
2016-09-28 15:54:28 -04:00
< button type = " button " class = " button pressthis-js-toggle js-show-pressthis-code-wrap " aria - expanded = " false " aria - controls = " pressthis-code-wrap " >
PressThis v2, first run. Props michael-arestad, stephdau, marcelomazza, DrewAPicture, iseulde, afercia, kraftbj, rachelbaker, AramZS, dd32. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31534
git-svn-id: http://core.svn.wordpress.org/trunk@31515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-24 20:50:26 -05:00
< span class = " dashicons dashicons-clipboard " ></ span >
2015-03-13 13:31:28 -04:00
< span class = " screen-reader-text " >< ? php _e ( 'Copy “Press This” bookmarklet code' ) ?> </span>
PressThis v2, first run. Props michael-arestad, stephdau, marcelomazza, DrewAPicture, iseulde, afercia, kraftbj, rachelbaker, AramZS, dd32. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31534
git-svn-id: http://core.svn.wordpress.org/trunk@31515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-24 20:50:26 -05:00
</ button >
</ p >
2015-03-17 21:58:27 -04:00
< div class = " hidden js-pressthis-code-wrap clear " id = " pressthis-code-wrap " >
PressThis v2, first run. Props michael-arestad, stephdau, marcelomazza, DrewAPicture, iseulde, afercia, kraftbj, rachelbaker, AramZS, dd32. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31534
git-svn-id: http://core.svn.wordpress.org/trunk@31515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-24 20:50:26 -05:00
< p id = " pressthis-code-desc " >
2015-03-13 13:31:28 -04:00
< ? php _e ( 'If you can’t drag the bookmarklet to your bookmarks, copy the following code and create a new bookmark. Paste the code into the new bookmark’s URL field.' ) ?>
PressThis v2, first run. Props michael-arestad, stephdau, marcelomazza, DrewAPicture, iseulde, afercia, kraftbj, rachelbaker, AramZS, dd32. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31534
git-svn-id: http://core.svn.wordpress.org/trunk@31515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-24 20:50:26 -05:00
</ p >
< p >
< textarea class = " js-pressthis-code " rows = " 5 " cols = " 120 " readonly = " readonly " aria - labelledby = " pressthis-code-desc " >< ? php echo htmlspecialchars ( get_shortcut_link () ); ?> </textarea>
</ p >
</ div >
< h4 >< ? php _e ( 'Direct link (best for mobile)' ); ?> </h4>
2015-03-13 13:31:28 -04:00
< p >< ? php _e ( 'Follow the link to open Press This. Then add it to your device’s bookmarks or home screen.' ); ?> </p>
PressThis v2, first run. Props michael-arestad, stephdau, marcelomazza, DrewAPicture, iseulde, afercia, kraftbj, rachelbaker, AramZS, dd32. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31534
git-svn-id: http://core.svn.wordpress.org/trunk@31515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-24 20:50:26 -05:00
< p >
2016-09-28 15:54:28 -04:00
< a class = " button " href = " <?php echo htmlspecialchars( admin_url( 'press-this.php' ) ); ?> " >< ? php _e ( 'Open Press This' ) ?> </a>
PressThis v2, first run. Props michael-arestad, stephdau, marcelomazza, DrewAPicture, iseulde, afercia, kraftbj, rachelbaker, AramZS, dd32. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31534
git-svn-id: http://core.svn.wordpress.org/trunk@31515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-24 20:50:26 -05:00
</ p >
< script >
jQuery ( document ) . ready ( function ( $ ) {
var $showPressThisWrap = $ ( '.js-show-pressthis-code-wrap' );
var $pressthisCode = $ ( '.js-pressthis-code' );
$showPressThisWrap . on ( 'click' , function ( event ) {
var $this = $ ( this );
$this . parent () . next ( '.js-pressthis-code-wrap' ) . slideToggle ( 200 );
$this . attr ( 'aria-expanded' , $this . attr ( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
});
// Select Press This code when focusing (tabbing) or clicking the textarea.
$pressthisCode . on ( 'click focus' , function () {
var self = this ;
setTimeout ( function () { self . select (); }, 50 );
});
});
</ script >
</ form >
2008-11-28 05:14:43 -05:00
</ div >
2009-05-29 15:15:32 -04:00
< ? php
endif ;
2010-06-10 20:00:47 -04:00
if ( current_user_can ( 'import' ) ) :
2010-05-27 00:35:11 -04:00
$cats = get_taxonomy ( 'category' );
$tags = get_taxonomy ( 'post_tag' );
if ( current_user_can ( $cats -> cap -> manage_terms ) || current_user_can ( $tags -> cap -> manage_terms ) ) : ?>
2015-03-17 21:58:27 -04:00
< div class = " card " >
2015-08-30 23:32:21 -04:00
< h2 class = " title " >< ? php _e ( 'Categories and Tags Converter' ) ?> </h2>
< 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>
2010-05-27 00:35:11 -04:00
</ div >
< ? php
endif ;
2010-06-10 20:00:47 -04:00
endif ;
2010-05-27 00:35:11 -04:00
2013-10-26 15:23:09 -04:00
/**
* Fires at the end of the Tools Administration screen .
*
* @ since 2.8 . 0
*/
2009-05-29 15:15:32 -04:00
do_action ( 'tool_box' );
?>
2008-11-28 05:14:43 -05:00
</ div >
2008-11-27 16:11:25 -05:00
< ? php
2013-09-24 20:18:11 -04:00
include ( ABSPATH . 'wp-admin/admin-footer.php' );