Press This
Press This ist ein kleines Werkzeug, mit dem du Dinge aus dem Web aufgreifen und daraus ganz einfach neue Beiträge erstellen kannst. Es ermöglicht dir sogar, Bilder oder Videos von jeder beliebigen Seite zur Einbindung in deine eigenen Beiträge auszuwählen. Nutze Press This als ein schnelles und leichtgewichtiges Werkzeug, um eine andere Seite im Internet hervorzuheben.
Version 2.0 – Gutenberg Block Editor
Press This 2.0 brings the modern WordPress block editor experience to the bookmarklet popup. You can now compose posts using familiar blocks like Paragraph, Heading, Image, Quote, List, and Embed.
New Features:
- Gutenberg Block Editor – Full block editor integration for a consistent WordPress editing experience
- Smart Post Format Suggestions – Automatically suggests Video, Quote, or Link formats based on content
- Enhanced Content Extraction – Improved scraping with JSON-LD structured data support
- Client-Side Only Scraping – All content extraction happens in your browser for better privacy and security
- Featured Image Support – Set any scraped image as your post’s featured image
- Improved Media Grid – Better thumbnail display with support for video and audio embeds
Filters for Developers
Press This 2.0 includes new filters for customization:
press_this_allowed_blocks– Customize which blocks are available in the editorpress_this_post_format_suggestion– Modify the auto-suggested post format
See the Developer Documentation section below for details.
Mitwirkende
Fehler und PRs können via https://github.com/WordPress/press-this eingereicht werden.
Developer Documentation
New Hooks and Filters in 2.0
press_this_allowed_blocks
Customize which blocks are available in the Press This editor.
add_filter( 'press_this_allowed_blocks', function( $blocks ) {
// Add the gallery block
$blocks[] = 'core/gallery';
// Remove the embed block
$blocks = array_filter( $blocks, function( $block ) {
return $block !== 'core/embed';
} );
return $blocks;
} );
Default blocks: core/paragraph, core/heading, core/image, core/quote, core/list, core/list-item, core/embed
press_this_post_format_suggestion
Modify or override the auto-suggested post format based on content.
add_filter( 'press_this_post_format_suggestion', function( $suggested_format, $data ) {
// If the URL contains 'podcast', suggest audio format
if ( ! empty( $data['u'] ) && strpos( $data['u'], 'podcast' ) !== false ) {
return 'audio';
}
return $suggested_format;
}, 10, 2 );
The $data array contains scraped content including:
– u – Source URL
– s – Selected text
– t – Page title
– _images – Array of image URLs
– _embeds – Array of embed URLs
– _meta – Meta tag data
– _jsonld – JSON-LD structured data
Preserved Hooks from 1.x
All existing hooks continue to work:
press_this_redirect_in_parent– Control post-save redirect behaviorpress_this_save_post– Filter post data before savingpress_this_save_redirect– Filter redirect URL after saveenable_press_this_media_discovery– Toggle media scrapingpress_this_data– Filter the complete scraped data arraypress_this_suggested_html– Filter default content templatesshortcut_link– Customize the bookmarklet URL
Verlauf
WordPress enthielt von Anfang an eine Möglichkeit, Snippets von anderen Websites einzubinden, die du dann auf deiner eigenen Website veröffentlichen kannst.
Das ursprüngliche „Press It“ wurde in WordPress 2.5 entfernt und ein neues „Press This“ in 2.6 hinzugefügt. Es existierte ziemlich unverändert bis WordPress 4.2, das „Press This“ komplett überarbeitet hat.
In WordPress 4.9 wurde Press This in ein „kanonisches Plugin“ ausgegliedert – ein offizielles Plugin von WordPress.org, sodass Websites, die es nutzen wollen, es verwenden können, aber mehr Nischenfunktionalität aus dem Core herausgeholt wird. Dies wurde zuvor mit den Importern gemacht.
In version 2.0, Press This was modernized to use the Gutenberg block editor, bringing it in line with the modern WordPress editing experience while maintaining backward compatibility with existing installations.
