Definition:
function prepend_attachment($content) {}
Wrap attachment in <p> element before content.
Parameters
- string $content
Defined filters
- prepend_attachment
apply_filters('prepend_attachment', $p)
Source code
function prepend_attachment($content) { global $post; if ( empty($post->post_type) || $post->post_type != 'attachment' ) return $content; $p = '<p class="attachment">'; // show the medium sized image representation of the attachment if available, and link to the raw file $p .= wp_get_attachment_link(0, 'medium', false); $p .= '</p>'; $p = apply_filters('prepend_attachment', $p); return "$p\n$content"; }
2599
No comments yet... Be the first to leave a reply!