Easily add and display a caption for the featured image of a post.
Featured Image Caption makes it simple to show a caption with the featured image of a post or page. It works seamlessly with most themes, with no coding required. If you like to mess about in the code, it supports that too.
featured-image-caption
directory to your site’s plugins
directory.Plugins
menu in WordPress.Settings
> Featured Image Caption
.Documentation is maintained on the plugin’s GitHub wiki. I don’t want to maintain two separate sets of documentation and run the risk of conflicting/outdated information, and all of the plugin development happens on GitHub.
Undefined Index
errors for the REST API.posts
response. See plugin documentation for the REST API for usage information.Restricts the automatic caption insertion to only occur in The Loop.
cc-featured-image-caption
to ccfic
. This was done for a few reasons. First, WordPress documentation advises against hyphens in shortcode names, so in order to follow best practices the hyphens have been removed. Second, it’s easier to type the abbreviation when using the shortcode. Please note, the old shortcode name still works for now, but you should expect that it will be removed entirely by the time this plugin reaches its 1.0.0 release. As such, please update all the locations that you use the shortcode. Please see the shortcode documentation for usage information.Fixes a bug in upgrading plugin options.
Fixes missing dependency.
Fixes bug in handling HTML tags in caption data that was introduced in the last release. Bug fixes related to activation.
Adds support for HTML tags to be used in caption and source text. HTML tags are filtered, and only tags allowed in post content are allowed in caption and source text.
Fixes issue with incorrectly escaped characters for the meta box fields.
Fixes a bug introduced in 0.6.0 in the theme function.
A shortcode has been added for easy insertion of caption information into a post or page. Debugging information is now displayed on the plugin settings page. Minor bug fixes.
** Major Release / Breaking Changes **
Plugin can automatically add the caption after the featured image, removing the need to modify theme files. If you are upgrading from a previous option this will be disabled by default, otherwise it is enabled by default. Theme function cc_featured_image_caption()
is not needed if you have automatic caption insertion turned on. If this option is enabled, the function won’t display anything. You can, however, still use it to return
the caption data. CSS classes have changed. See the FAQ for information about the new markup and CSS classes.
Added support for custom post types. Thanks to anlutro for the contribution.
Removed image source attribution pre-text.
Only display caption text data if it has been set.
Dedicated fields for image source attribution. When formatted text is requested, the source information has its own CSS class.
cc_featured_image_caption()
no longer needs to be used with echo
but instead defaults to echo. If you’d like to return the result, add false
as an argument for the function like so: cc_featured_image_caption( false );
cc_has_featured_image_caption()
which returns true
if a caption is set, and false
if a caption is not set.Theme function checks whether the caption data returned to it is false. If false, the theme function also returns false. If not false, the theme function returns a formatted caption string.
Fixed bug in declaring <span>
class.
Added <span>
around the rendered caption to allow for CSS formatting.
Initial release.