To me you code looks good, I would recommend adding priority as high as 9999
Heres how :
add_filter('the_content', 'filter_ptags_on_images', '9999');
Related Posts:
- Stop WordPress Wrapping Images In A “P” Tag
- Get content from one page and show it on another page
- Content editor creating blank paragraphs in spaces and creating   in the_excerpt
- Testing for post title in ‘if/else’ statement returns no content
- Why content_arr[‘extended’] removes paragraph tags?
- the_content() Not Grabbing All Content
- why my urdu text is not aligned properly when written in wordpress blog post?
- Stop WordPress automatically adding tags to post content
- How to get ‘post_content’ without stripping tags?
- Keyboard shortcut for updating a page or post?
- Customizing HTML Editor Quicktags button to open a dialog for choosing insert options
- Removing any and all inline styles from the_content()
- Allow user to “edit_others_posts” to save only, not publish
- Let private posts stay in status “private” after edit through “editors”
- how to limit edit_form_after_title hook to page and post edit only?
- Strategy for handling hierarchical pages with empty parent content
- Listen to Post action
- How to disable content pagination?
- How to create WP Editor using javascript
- Modify ‘Read more’ link adding a new class
- How to remove Nextpage tag inside posts text depending of utm_campaign
- How to add editor’s name to entry meta byline?
- Adding a div class or id inside the_content()
- How can you make sure authors’ posts are longer than 250 words?
- What is the best / efficient way to get WordPress content by post id and why?
- Restrict access to post if it is currently being edited
- JSON not valid after json_encode posts
- Change padding to text indent in “Increase indent” TinyMCE
- How can I allow editors to leave comments on posts that have not yet been published?
- Automatically added brs and paragraphs?
- Divide Post content into separate divs for every 500 characters (or any other character counts)
- Add default content to post (for specific category)
- Post content being duplicated by the_content();
- How can I pass $post object to ‘save_post’ add_action?
- Programmatically inserting page breaks
- Hide parts of the post content on the home page
- Filter/Remove HTML Elements on all posts and pages
- Paragraphs removed when using get_post_custom()?
- Load post content into div with ajax
- Custom function for “Submit for Review” hook
- How can I extract the URL of a link from a post?
- add image map script to post
- How to add custom content (text/image) at start of content (IN content ie the same line)
- 2nd button row from WP Super Edit or TinyMCE Advanced doesn’t show to 2nd admin
- Display the Content of a Post with qTip2
- How to show video from specific category on sidebar?
- Same content shared between multiple posts?
- how load content as pop-up using ajax
- custom post type grid with content in lightbox [closed]
- Strange problems when I try to insert HTML\XML code snippet in my posts
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- How to get only text from wordpress post content?
- Visual / HTML tabs vanished on editor
- Getting a 404 error when clicking edit page
- Batch process: remove first image from post content
- WordPress version 3.8 – Preview button not working for editor
- How to retrieve the postID in a “image_send_to_editor” hook function?
- Uppercase first sentence in every post
- Modify Image Source With The_Content Filter?
- How to add pagination in between post and comments?
- Make Post Editor Select Number of Columns To 1 By Default
- Unautop / Sanitize content added to a post through a plugin
- is there a way to show the the post title after the image?
- How to get rid of shortcodes in post content once and for all
- Add Word Limit to Posts
- Adding the_date inside tags around the_content
- Show the content that is after the excerpt using child theme
- Lost draft under all posts and drafts
- Show only one page link in content pagination
- get query() without post content?
- How to show full post?
- Show only posts with images and a fixed amount of posts
- Filter only the text in the_content
- How to create new post content templates for my users?
- How do I do a page break?
- How to get a post’s content? [closed]
- How to check if single.php has already called the_post_thumbnail function
- Why does a published post only displays the title and not the content in the site? [closed]
- Best Way to Add UnEditable HTML to Posts
- How to disable the_excerpt from one post
- The_excerpt() doesn’t parse – how to change that?
- WP text styles not coming through to actual post
- Page and post loop same template
- WordPress.com post editor replacement
- Benefits to using semantic HTML in post content? [closed]
- Why can’t publish posts with too much text?
- Add div before the first paragraph the_content [closed]
- Can’t save WordPress post with “/etc/” in it
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- Hide parts of the post content after typing it’s name or searching it by category
- How to exclude the word “class” from being matched in search?
- Preview page/post revisions without overwriting current content
- Posts and Pages w. private visibility don’t show up in existing content
- Adding if statement into the_content()
- Keyboard shortcut for headings on safari
- Plugin for visitors to edit content without logging in? [closed]
- any way to access variables from within post editor?
- definining own teaser text for post
- Add text and change style to post programmatically depending on category
- How do I display main query posts in random order using add_filter