This works, just don’t know if it’s the proper way to do it:
Yes, the functions are the same so they’re equivalent. There is nothing wrong here. But if we dig a bit deeper, we see they’re not 2 filters for the same thing at all:
embed_oembed_html
filters the cached oEmbed HTML.oembed_result
filters the HTML returned by the oEmbed provider.
So oembed_result
is when the html is first retrieved, before caching. embed_oembed_html
is when the cache has been fetched but before rendering.
You can probably get away with only one or the other, making sure to flush all caches/transients first
Related Posts:
- remove empty paragraphs from the_content?
- Set JPEG compression for specific custom image sizes
- Define custom Page Template without its own .php file
- Removing default image size list in Media Box
- How to restrict actions and filters “properly” by conditions
- syntax for remove_filter in parent theme with class
- Convert hyphen to underscore in permalinks
- Override parent theme function that is not hooked or in the functions.php file
- Remove bulk actions based on user role or capabilities
- Set first oembed in post to a global variable or function
- How to remove the embed_footer?
- Removing title from page
- Hide some items from Screen options in dashboard for products
- Adding body class when post contains a specific shortcode
- Replace Archive Widget Link Text
- Exclude Empty Child Categories in Menu
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Best way to programatically add “rel” attributes to page and post images
- add_filter priority problem
- Limit filter upgrader_post_install to a single plugin
- How to update feed only 2-3 times a week (for Feedburner email)?
- Clean-up script tags
- Remove function or filter
- Super simple shortcode not working
- How to filter out shortcode when displaying the_excerpt() in the loop?
- Adding multiple taxonomy filters to functions.php
- Adding HTML to the end of every post with the Block Editor
- Last updated date function
- How to set default archive image without overriding first attached image? [closed]
- Only let plugin add actions to wp_head & wp_footer on single posts
- How to make custom column Admin>Users sortable?
- How can I grab the video id of youtube?
- Get Current Post ID in functions php, meta query filter
- Output and filter data from a XML url
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- How to filter $content in shortcode function
- Run wp_kses_decode_entities on atom feed?
- Filtering out the #more anchor link that gets produced by
- Can’t filter wp_get_attachment_link
- append to existing parent theme function
- Add Element as a Filter to the_content
- How can I add a filter for specific categories on functions.php?
- How to add custom JavaScript in functions?
- How would I go about replacing this function in my child theme located in inc/template-tags.php
- Retrieve a value from Yoast SEO to use to set a default twitter card image honoring overrides
- Can’t properly set the_title add_filter to show short_URL
- Filter an WordPress Function in (general-template.php)
- Redefine function arguments before rendering
- Filter nav menu items HTML tags and wrap inner text with span
- How can I add a class to a nav li depending on URL?
- Modify gform_other_choice_value for specific form and specific field in Gravity Forms
- login_headertitle is deprecated since version 5.2.0
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- Filter to wp_list_authors
- The_content and Preg_replace in loaded Iframe [closed]
- Add Adsense code between job listings – wp job manager plugin
- Problem with images URL after filter applying
- remove_action not working, even after changing priority [duplicate]
- remove/hide wp-editor
- Replace header image on all other pages but home – URL issue
- Add a class to post if it has been recently updated
- search form leads to 404
- how to add_filter to non hook function
- Any adverse effects of adding apply_filters to a function?
- how can I add filter in specfic field in my website?
- Customizing the wp_video_shortcode output with add_filter
- Overwrite text in a complicated filter hook
- How to add HTML into error message
- Save_post – Warning: Cannot modify header information
- custom error message for empty username and password using authenticate filter not working
- Removing comment lines from all enqueued js files using a filter function
- Add #primary at the end of navlink permalinks on single posts
- remove_filter function to unhook twentysixteen parent theme function
- Security when outputing wp_oembed_get code
- only update titles of single posts
- OOP Switch statement with array as parameter
- Child theme remove parent filter in functions
- How can I automatically delete comments that contain a URL?
- Appending „read more” to the excerpt conditionally
- How to add class dynamically from templates
- function replace_text for entire page
- add product thumbnail to checkout page only and include variation name
- ACF Filter return value
- Graphic before title – Specific Category
- Which method is more correct for removing WooCommerce Extensions menu item?
- How to make an If Else on Excerpt Filter
- Why might wptexturize have become re-enabled?
- Shortcode to eliminate and replace with
- Regex works in regexr, but not if I filter content [closed]
- Retrieve a custom form field modified by a filter
- functions.php filters not applied in AJAX call
- Settings in functions.php used by a plugin
- Allow tags and attributes in post and pages content
- Can’t change excerpt length and more tag
- Force resize for all video content
- Way of getting queried loop before the query with a filter hook?
- Filter to strip unnecessary attributes
- Trying to get this function to show below the content
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- How can I modify or filter this variable in an existing class? (Mai Theme)