Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Press This"

m (Notes)
 
(14 intermediate revisions by 10 users not shown)
Line 2: Line 2:
 
{{en|Press This}}
 
{{en|Press This}}
 
{{ja|Press This}}
 
{{ja|Press This}}
  +
{{pt-br|Publique Isso}}
 
}}
 
}}
   
The "Press This" function allows quick posting and publishing through the use of a special web browser favourite. You can create a shortcut to allow use of "Press This" from the new post screen. You then activate the function when browsing by selecting the favourite from your web browser favourites list.
+
The "Press This" function allows quick publishing with a special web browser [[Glossary#Bookmarklet|bookmarklet]]. You can create a post by quoting some text, images, and videos on any web page.
   
  +
==Updated Installation==
You will find the Press This bookmarklet in the WP Administration Panel under the Tools menu.
 
   
  +
#Install the Press This plugin via the [https://wordpress.org/plugins/press-this/ WP Plugins page] or navigate to /wp-admin/press-this.php on your site.
On a technical note: using this bookmarklet to publish posts does not pass the $_POST['post_type'] variable with the value of "post".
 
   
  +
Press This was removed from the Tools submenu in the WP Core as of build 4.9. Due to this, it no longer appears in the Tools menu along with the Categories and Tags Converter options by default.
''Note:'' [http://yoast.com/press-this/ Press This] is also the name of a WordPress podcast hosted by Joost de Valk.
 
  +
  +
== Usage ==
  +
  +
# After installing the plugin, go to the Tools submenu. You can then drag the Press This bookmarklet to your browser toolbar or use the Open Press This direct link to add to a mobile device menu.
  +
# While browsing, select some text (optional) and click the bookmarklet in your browser's favorite (bookmark).
  +
# Edit the content in the invoked pop-up window.
  +
# Save, preview, or publish the post.
  +
  +
== Making the Press This work with NoScript and RequestPolicy ==
  +
  +
WordPress 4.2 shipped with a new Press This bookmarklet. Unlike the previous bookmarklet, this new one will not play nicely with NoScript and RequestPolicy (which are security add-ons for Firefox and most modern browsers) out of the box. Here are the steps to get the bookmarklet working with one or both add-ons installed:
  +
  +
# Whitelist the domain of the WordPress site in NoScript if this hasn't been done already (click on the S icon and choose Allow mydomain.com, where mydomain.com is your WordPress site's domain).
  +
# Open the NoScript preferences by clicking on the S icon again and choosing Options
  +
# Click on the Advanced tab. A set of sub-tabs will appear. Click on XSS.
  +
# In the box that says Anti-XSS Protection Exemptions, add the following (change mydomain.com to your domain): <pre>^https://mydomain.com/ptw/wp-admin/press-this.php(?:\?|/\1\b)</pre>
  +
# Note in the example above the HTTPS prefix is in use. You'll want to change this to regular old HTTP (no s) if you don't have secure hosting set up for your site.
  +
# Click Okay to exit NoScript's options.
  +
# Now, if you have RequestPolicy, open its preferences by clicking on RP's red/gray flag icon. Choose Preferences and click on the Whitelist tab.
  +
# Under the Whitelist tab, click the Destinations sub-tab.
  +
# In the whitebox at the bottom which contains the placeholder Destination, type in your site's domain. Do not enter a prefix like http or https. It isn't necessary to put "www." in either. Click Allow. You should see your domain appear in the larger box above.
  +
# Close RequestPolicy preferences. The new Press This bookmarklet should now function correctly, and you'll be able to continue benefiting from the protections that NoScript and RequestPolicy offer.
  +
  +
== Technical Note ==
 
Using this bookmarklet to publish posts does not pass the <tt>$_POST['post_type']</tt> variable with the value of "post".
  +
  +
The bookmark calls <tt>http://example.com/wp-admin/press-this.php?u=&t=&s=&i=</tt>
  +
  +
*u = the url of the current page
  +
*t = the title of the current page
  +
*s = the text selection from the current page
  +
*i = url of an image file
  +
  +
Edit the bookmark within your browser to change the values passed if necessary.
  +
  +
== Technical Note ==
  +
*When I use Press This sometimes I get a "NOT FOUND" page. I just change the address from u=http%3A%2F%2F to u= and it works fine. I do notice I have to copy and paste the new address in a new tab in firefox when doing this.
  +
  +
*End users can edit the properties of their bookmark to alleviate the 404 Not Found problem. In your browser bookmarks folder or on the bookmark bar, right-click the Press This bookmark, select Edit or Properties, and then change this:
  +
  +
u=‘+e(l.href)+‘
  +
  +
to this:
  +
  +
u=’+e(l.href.replace(/\//g,’\\/’))+’
  +
  +
== Notes ==
  +
  +
* Continued development of Press This (v1.1.1) is continuing as a plugin at [https://github.com/WordPress/press-this/ GitHub].
  +
* This feature was removed from the Core build in WordPress 4.9 and moved to the status of plugin. Details about this move and possible user impacts can be found in this [https://make.wordpress.org/core/2017/11/02/press-this-in-4-9/ WP Make post].
 
* "Press This" is also the name of a [http://yoast.com/press-this/ WordPress podcast hosted by Joost de Valk].
  +
* This feature replaced the "[[Press It]]" function in WordPress 2.6, but has now been deprecated.
  +
* [http://en.support.wordpress.com/press-this/ WordPress.com Documentation] includes a screencast video on how to use Press It.
   
 
{{Stub}}
 
{{Stub}}

Latest revision as of 23:29, 14 June 2018

The "Press This" function allows quick publishing with a special web browser bookmarklet. You can create a post by quoting some text, images, and videos on any web page.

Updated Installation

  1. Install the Press This plugin via the WP Plugins page or navigate to /wp-admin/press-this.php on your site.

Press This was removed from the Tools submenu in the WP Core as of build 4.9. Due to this, it no longer appears in the Tools menu along with the Categories and Tags Converter options by default.

Usage

  1. After installing the plugin, go to the Tools submenu. You can then drag the Press This bookmarklet to your browser toolbar or use the Open Press This direct link to add to a mobile device menu.
  2. While browsing, select some text (optional) and click the bookmarklet in your browser's favorite (bookmark).
  3. Edit the content in the invoked pop-up window.
  4. Save, preview, or publish the post.

Making the Press This work with NoScript and RequestPolicy

WordPress 4.2 shipped with a new Press This bookmarklet. Unlike the previous bookmarklet, this new one will not play nicely with NoScript and RequestPolicy (which are security add-ons for Firefox and most modern browsers) out of the box. Here are the steps to get the bookmarklet working with one or both add-ons installed:

  1. Whitelist the domain of the WordPress site in NoScript if this hasn't been done already (click on the S icon and choose Allow mydomain.com, where mydomain.com is your WordPress site's domain).
  2. Open the NoScript preferences by clicking on the S icon again and choosing Options
  3. Click on the Advanced tab. A set of sub-tabs will appear. Click on XSS.
  4. In the box that says Anti-XSS Protection Exemptions, add the following (change mydomain.com to your domain):
    ^https://mydomain.com/ptw/wp-admin/press-this.php(?:\?|/\1\b)
  5. Note in the example above the HTTPS prefix is in use. You'll want to change this to regular old HTTP (no s) if you don't have secure hosting set up for your site.
  6. Click Okay to exit NoScript's options.
  7. Now, if you have RequestPolicy, open its preferences by clicking on RP's red/gray flag icon. Choose Preferences and click on the Whitelist tab.
  8. Under the Whitelist tab, click the Destinations sub-tab.
  9. In the whitebox at the bottom which contains the placeholder Destination, type in your site's domain. Do not enter a prefix like http or https. It isn't necessary to put "www." in either. Click Allow. You should see your domain appear in the larger box above.
  10. Close RequestPolicy preferences. The new Press This bookmarklet should now function correctly, and you'll be able to continue benefiting from the protections that NoScript and RequestPolicy offer.

Technical Note

Using this bookmarklet to publish posts does not pass the $_POST['post_type'] variable with the value of "post".

The bookmark calls http://example.com/wp-admin/press-this.php?u=&t=&s=&i=

  • u = the url of the current page
  • t = the title of the current page
  • s = the text selection from the current page
  • i = url of an image file

Edit the bookmark within your browser to change the values passed if necessary.

Technical Note

  • When I use Press This sometimes I get a "NOT FOUND" page. I just change the address from u=http%3A%2F%2F to u= and it works fine. I do notice I have to copy and paste the new address in a new tab in firefox when doing this.
  • End users can edit the properties of their bookmark to alleviate the 404 Not Found problem. In your browser bookmarks folder or on the bookmark bar, right-click the Press This bookmark, select Edit or Properties, and then change this:

u=‘+e(l.href)+‘

to this:

u=’+e(l.href.replace(/\//g,’\\/’))+’

Notes

  • Continued development of Press This (v1.1.1) is continuing as a plugin at GitHub.
  • This feature was removed from the Core build in WordPress 4.9 and moved to the status of plugin. Details about this move and possible user impacts can be found in this WP Make post.
  • "Press This" is also the name of a WordPress podcast hosted by Joost de Valk.
  • This feature replaced the "Press It" function in WordPress 2.6, but has now been deprecated.
  • WordPress.com Documentation includes a screencast video on how to use Press It.
This page is marked as incomplete. You can help Codex by expanding it.