Once we have captured additional data in the post editor, the next logical step will be to add code to display it when visitors view posts and pages. In the case of our source link data, the most logical place to show this link is after each post's content, which can easily be accomplished by assigning a function to the filter the_content
.
This recipe explains how to create a filter function to display the source data associated with a post or page item as a clean link.
You should have already followed the Capturing and displaying information using custom meta boxes recipe to have a starting point for this recipe and the resulting plugin should still be active in your development site. Alternatively, you can get the resulting code (Chapter 5/ch5-post-source-link/ch5-post-source-link-v1.php
) from the code bundle you downloaded from the Packt Publishing website (https://www.packtpub.com/support) and rename the file as ch5-post-source...