Easily reference another post in your blog using a shortcut, either by id or post slug. The shortcut is replaced with the hyperlinked t
|Author:||Scott Reilly (profile at wordpress.org)|
|WordPress version required:||3.6|
|WordPress version tested:||4.1.1|
|Added to WordPress repository:||21-12-2004|
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|Total downloads:||8 373|
Click to start download
Easily create a link to another post using a shortcode to reference the post by id or slug; the link text is the post's title, unless overridden.
When writing your posts, you can refer to other posts either by ID, like so:
or by the post slug/name, like so:
When viewed on your site, the post-to-post link tag is replaced with a permalink to the post you've referenced. By default, the text of the link will be the referenced post's title, resulting in something like:
"<a href="http://example.com/archives/2005/04/01/hello-world/" title="Hellow World!">Hello World!</a>"
You can optionally customize the link text by specifying a
text="" attribute and value to the post-to-post link tag:
Check out [post2post id="hello-world"]my first post[/post2post].
Check out "<a href="http://example.com/archives/2011/07/01/hello-world/" title="Hello World!">my first post</a>".
The plugin provides its own admin options page via
Post2Post in the WordPress admin. Here you can define text that you want to appear before and/or after each post-to-post substitution, and if you want to enable legacy tag support. The plugin's admin page also provides some documentation.
Should I enable legacy tag support?
The “Enable legacy HTML comment-style tag support?” setting controls whether the older, HTML comment style notation (from before v2.0 of the plugin) should be recognized. The “Enable legacy pseudo-shortcode tag support?” setting controls whether the older pseudo-shortcode syntax (from before v3.0 of the plugin) should be recognized You should only enable a particular legacy mode if you’ve used versions of this plugin prior to v3.0 and still want those post-to-post links to work without updating them. If you started using the plugin at v3.0 or later, you do not need to enable legacy support. Unnecessarily enabling legacy tag support will have a negative impact on the performance of your site.
What happens when a post-to-post tag references a post that does not exist?
If no post on your blog matches the value you specified as either a post ID or post slug, then the post-to-post tag in question disappears from the view, having been replaced with an empty string.
Can’t the shortcode be something other than ‘post2post’; perhaps something shorter?
Yes. See the Filters section for an example of code to change the shortcode name. If you are going to make this short of change, it is recommended that you do so before making use of the shortcode in your posts/pages (unless you search and replace all occurrences of the original shortcode in other posts). Out of the box, the plugin only supports a single name for the shortcode.
- Publicly release changes from the not-publicly released v2.0 and v3.0 of the plugin
- Update plugin framework to 039
- Add support for shortcode attributes ‘before’ and ‘after’ to override plugin setting on per-user basis
- Implement a Quicktags button “post2post” that inserts the shortcode into the post editor (Text-mode only)
- Remove support for the broken TinyMCE button (Visual-mode), including files
- Move plugin page examples out from bottom of settings page into help tab
- Better singleton implementation:
get_instance()static method for returning/creating singleton instance
- Make static variable ‘instance’ private
- Make constructor protected
- Make class final
- Additional related changes in plugin framework (protected constructor, erroring
- Add unit tests
- Explicitly declare
- Add checks to prevent execution of code if file is directly accessed
- Re-license as GPLv2 or later (from X11)
- Reformat plugin header
- Add ‘License’ and ‘License URI’ header tags to readme.txt and plugin file
- Use explicit path for require_once()
- Discontinue use of PHP4-style constructor
- Discontinue use of explicit pass-by-reference for objects
- Remove ending PHP close tag
- Minor documentation improvements
- Minor code reformatting (spacing, bracing)
- Change documentation links to wp.org to be https
- Note compatibility through WP 4.1+
- Drop compatibility with version of WP older than 3.6
- Update copyright date (2015)
- Regenerate .pot
- Move .pot to lang/ subdirectory
- Change donate link
- Add assets directory to plugin repository checkout
- Update screenshot
- Move screenshot into repo’s assets directory
- Add banner
- Add icon
- Add support for and favor ‘post2post’ shortcode to link to posts
- Add filter ‘c2c_post2post_shortcode’ to customize shortcode tag
- Re-implementation by extending C2C_Plugin_025, which adds support for:
- Reset of options to default values
- Better sanitization of input values
- Offload of core/basic functionality to generic plugin framework
- Additional hooks for various stages/places of plugin operation
- Easier localization support
- Add shortcode examples to plugin settings page
- No longer attempt add button to quicktags editor buttonbar (not sure if this will be permanent or not)
- Full localization support
- Add __construct(), activation(), uninstall()
- Rename class from PostToPostLinks to c2c_EasyPostToPostLinks
- Move object instantiation to within the initial if(!class_exists()) check
- Save a static version of itself in class variable $instance
- Add PHPDoc documentation
- Add package info to top of plugin file
- Remove docs from top of plugin file (all that and more are in readme.txt)
- Minor code reformatting (spacing)
- Improve documentation
- Note compatibility through WP 3.2+
- Drop compatibility with versions of WP older than 3.0
- Tweak description
- Update copyright date (2011)
- Add Legacy, Filters, Changelog, and Upgrade Notice sections to readme.txt
- Add screenshot
- Add .pot file
- Add plugin homepage and author links in description in readme.txt
- Created its own class to encapsulate plugin functionality
- Added admin options page under Options -> Post2Post (or in WP 2.5: Settings -> Post2Post). Options are now saved to database, negating need to customize code within the plugin source file.
- Admin options page also includes documentation and examples
- Added support for new post-to-post tag syntax of [post=”XX”]
(also still works for legacy syntax)
- Added support for per-post-to-post-link override of display text, i.e. [post=’25’ title=’this post’]
- Fixed bug that prevented linking to posts vis post slug from working
- Send post’s ID to get_the_title(), not the title
- Utilize get_the_title() to obtain the post’s title, rather than direct retrieval
- Added filter so that content seen via RSS gets filtered
- Filter ‘get_the_except’ instead of ‘the_excerpt’
- Added new admin option ‘enable_legacy’ to control support of legacy syntax
- Changed filter priority level to 9 to trigger before some of WP’s formatting filters
- Added TinyMCE button (w/ custom image) to insert post-to-post link tag into editor. If text is highlighted, it becomes the text=”” value.
- Fixed Quicktags button support; now it also applies to writing and creating pages
- Changed installation instructions
- Added compatibility note
- Updated copyright date and version to 2.0
- Moved into its own subdirectory; added readme.txt and screenshot
- Tested compatibility with WP 2.3.3 and 2.5
- (Lost to time)
- Initial release