apply_filters( ‘shortcut_link’, string $link )

This hook has been deprecated.

Filters the Press This bookmarklet link.

Parameters

$linkstring
The Press This bookmarklet link.

Source

return apply_filters( 'shortcut_link', $link );

Changelog

VersionDescription
4.9.0This hook has been deprecated.
2.6.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    Example migrated from Codex:

    Create a “Press This” button for a custom post type called example.

    add_filter('shortcut_link', 'press_this_ptype', 11);
    
    function press_this_ptype($link) {
    	$post_type = 'example';
    
    	$link = str_replace('post-new.php', "post-new.php?post_type=$post_type", $link);
    	$link = str_replace('?u=', '&u=', $link);
    
    	return $link;
    }

You must log in before being able to contribute a note or feedback.