The embed_oembed_html
filter runs before an oEmbed resource’s HTML is outputted, so you could hook into this and wrap the output in a div
as below. I can’t think of a simple way of wrapping the other content.
add_filter('embed_oembed_html', 'my_embed_oembed_html', 99, 4);
function my_embed_oembed_html($html, $url, $attr, $post_id) {
return '<div id="video">' . $html . '</div>';
}
Related Posts:
- Add wrapper to only youtube videos via embed_oembed_html filter function
- Detecting Embed URLs Within post_content
- Filter oembeds tags to modify iframe attributes
- Run oembed separately outside the_content()
- How to center oEmbedded content
- How can I replace an oEmbed URL in post with actual embed HTML
- oembed_dataparse filter not running at all for standard YouTube embed
- Modify oembed code conditionally
- How to filter users on admin users page by custom meta field?
- How to bulk delete all users with no posts?
- WordPress 3.9 – Trouble Editing TinyMCE 4.0
- What does (10, 2) mean when used with add_filter
- Clarification on filters and hooks
- Modify links when inserted by WYSIWYG editor
- How to check if a hook is hooked or not?
- post_mime_types Filter not Working in List Mode
- Include a page template along with add_theme_support()
- Adding a class to the body_class function
- Modify the post/entry wrapper markup in genesis childtheme [closed]
- Allowing non-latin characters in registration
- post_row_actions filter is not working while update post using quick edit
- Should I use add_action(‘publish_post or add_filter(‘publish_post?
- get_the_excerpt() with fallback like the_excerpt()
- How to link current user to their author page through shortcodes
- Taxonomy Custom Column – ‘manage_{TAXONOMY}_custom_column’ filter only passing 2 arguments
- How to get list of all hooks of current theme / plugin?
- get_query stops working after post filter
- Can you use add_filter() inside other function?
- is there a specific place where add_filter must be placed?
- How do I replace a render_callback function for a block?
- add_filter() function misunderstanding
- How to make a widget expand wider than the column width when editing its settings in the admin
- check if FILTER(“the_content”) is being executed in `the_post()`
- Change Password Strength Indicator names?
- Is there a wildcard/catchall filter hook?
- Apply the_content filter, but prevent other hooked actions
- Filter my args by the post 1st letter
- Limit RSS feed to previous calendar month
- Adding Filter to Homepage only
- the_excerpt filter with an empty excerpt
- Add Defer Attributes to WordPress Scripts with consistent versioning
- Is this the proper way of switching the “Edit My Profile” link with my BuddyPress “Extended Profile” link?
- Does auto_update_plugin Filter Work When Put In Theme’s functions.php File
- Remove CSS & JS files from WordPress Main Page For Increase Pagespeed?
- String regex match replace for role ‘contributor’ only
- In need of a content replace filter for posts in a specific wordpress category
- Can plugins that filter post contents work on posts from Word 2007?
- How to remove action with slashes and arrows?
- Inline Styles on all native blocks
- How to filter post content and force every link () made in blocks to return urldecode() with readable value?
- Changing WordPress core without hacking core
- Link to Shop-Filter with .current-menu-item
- Plugin options, presets and filters : can you help me improve my workflow?
- Remove posts inside pre_get_posts using a custom query
- Remove / Hide Attachment Display Settings in Add Media popup / dialog
- how to customize rss feed tags using hooks?
- Woocommerce “added to cart” message on main(home) page
- Is it possible to apply filter to meta key value when querying posts?
- Add filter for specific post type only
- How to add_filter to an OOP based apply_filter(‘foo::bar’, $a);
- apply_filters with multiple args and multiple add_filter
- Avoid user registrations with specific email provider
- Should I remove_filter in order to replace a filter?
- How can I specify the post status of an untrashed post?
- filter hook to load a different post/page on current post/page
- Conflict calling an add_filter() twice
- Filter for author list in gutenberg core editor
- Rewrite rule and display of post
- Passing variable from child theme function to parent theme filter
- Add filter unless it is being called under specific function
- paginate_links() Change the order of links
- Filter / add_action to upgrade.php page
- Add Filter – Pass Variable (PHP < 5.3)
- How to disable a wp filter in a certain admin panel page
- Why does admin_body_class not work?
- post_orderby filter breaks function
- Problem width wp_insert_post_data and Gutenberg block editor
- Counting a WP_Post Object value in an arary, using a filter?
- add_filter doesn’t return false?
- How to track a particular page in order to address the loading speed issue
- List all categories that have results in a query
- how to overwrite next_post_link
- Displaying posts on a page that have been assigned a value in a database
- Replace Text with hyperlinks
- Print url to default featured image
- How to filter wp_get_recent_posts() to only posts that have thumbnails?
- What action/filter can be used for modifying the page to be rendered?
- Adding user filter – Not updating data in URL
- How to check which submission button was clicked?
- filter wptexturize doesn’t work on old posts titles
- remove_action conditionally for Custom Post Type – not working
- wp_get_attachment_link filter not working
- How would I remove an inline googleAPI font script in the the parent theme header.php?
- Getting entry ID from frm_email_message filter in formidable
- Is there a hook or filter that adds a button to the left of the search box?
- filter a list by gender
- Filter and manipulate the get_current_user() function
- Can you call a filter hook by “add_action”?
- Why isn’t this add_filter function working as expected?
- Adding filter to the Contact Form 7 response