I think there is a difference here between do_action
and apply_filters
.
do_action
usually triggers a global state change, either output, enqueuing of resource, initialization of modules, and such. This, like anything which infuance global state can result in surprising side effect when used out of context.
apply_filters
OTOH behaves much more like a function call, and if written properly should return the same result whenever it is “called”.
Still, the quality of plugins varies (just few hours ago someone asked about a “pro” plugin that uses eval
🙁 ), so your implementation strategy will depend in the end on the coding skills some 5$/hr developer copy pasting snippets he finds around the internet. You will need proper testing against leading plugins to make sure that your code works with at least the leading ones.
Related Posts:
- How can a plugin create a page/form in the front end?
- Looking for WordPress System Diagrams
- How to add Request header in WordPress remote api calls
- Init action hook running late after PayPal’s return url?
- Get specific color from admin color scheme
- wp_remote_get doesn’t work with secure connections https?
- How do you create a custom edit.php / edit pages page
- Edit the output of wp_widget_rss_output()
- Why are two functions over-riding each other?
- How to Parse an Array of Elements in Gutenberg Block
- how to set context in WordPress for unit testing
- Custom rewrite rule serves content, but returns 404 error code
- Should I ask my Twitter plugin users to create their own Twitter App and API Keys to use my plugin?
- Support auto-save and revisions for custom fields
- Gutenberg – What is the best way to save/update post meta?
- Dequeue theme stylesheets but keep widget styling on custom page template
- WP_Query with tax_query, order by most ‘matches’
- Using the Settings API, how should I add multiple values to an option?
- WP custom menus error > menu name already exists?
- Plugin updates, version dependencies, and backwards compatibility
- Where and how does WordPress store and use its plugin and hook information?
- Cache directory needed for plugin
- How to sanitize user input?
- Remove Internal Style Sheet if no Value Provided?
- Widget update function not saving values
- Turn off Admin Bar (Toolbar) in backend – no easy way
- Error : “Cannot use object of type WP_Post as array in”
- Replacing Scripts in Admin Load_Scripts
- How to filter content on Save/Publish to add rel=”nofollow” to all external links?
- When to use add_settings_section vs just register_setting?
- How to show active version on wordpress.org of a published plugin?
- How to customize login process
- How should I store a log for my plugin
- Adding more text to a post, after it was published
- How to modify the comments to be displayed in a post?
- Find out Requires WP tag for a plugin when submitting it
- what is the difference between these phares?
- WP_Query filters
- Plugin Architecture Question: How to avoid using transients
- SSL certificate verify failed
- How to load library scripts in admin from plugins in noConflict wrapper?
- wordpress how to query wp_options table
- rest_no_route on custom API endpoint wordpress
- How to query custom db table?
- How to only load css for used blocks on frontend
- adding wp-cli commands to plugin: how to document to users?
- Additional classes `undefined` after saving post in Gutenberg
- How do you submit a Gutenberg plugin?
- Creating an empty page programatically
- Multiple API Endpoints (wp_remote_get)
- plugin_dir_url & plugin_basename not working when plugin dir is outside wordpress dir
- How to replace default comments with custom HTML?
- Invalid hook call on save, not edit when using swiper slider
- Call to undefined function is_home() or any conditional tags
- WP nonce field checkbox prints checked=’checked’ outside input field
- WooCommerce Endpoints content
- Make dynamic string translatable
- Creating two tables in database on activation hook
- wp_schedule_event is registered but function isn’t running
- Simple plugin don’t display content
- Cannot output plugin twice with shortcode
- How to make an admin plugin menu page go full screen?
- It is possible to pass $args that sent by add_settings_field() inside another function?
- Change reminder email date to 14 days before
- Gutenberg – Call google map render function in save after DOM has been rendered
- Woocommerce get_term_by() in transition_post_status hook doesn’t works
- Does $this context change in an AJAX callback?
- Home page is not loading, where in other pages are displaying on the site
- Custom table / Alternative to WP_List_Table
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- Adding Amchart Interface to WordPress API
- WordPress Own Rewrite Rules
- WordPress with React: Saving and Using Data Collected with fetch
- Don’t print customizer styles when no setting has been used
- bindParam? WordPress 4.9.5 SQL LIKE statement %s and %LIKE%
- tweaking the
- Plugin with functions inside a class & how to trigger WP CRON
- User Registration Moderate
- external Integration with wordpress timeout error
- add_settings_error on validating plugin options API
- Implementing Select2 plugin into WordPress
- Problem to return more than single line captions
- Unable to show a message after plugin activation
- Use plupload to upload images and save them to custom folder and database table
- How to add conent (text) to Add New pages form of admin in WordPress
- Can I access WordPress API’s from within plugin scripts?
- Is there a way to make is_search() always return false
- Ajax url value to pass ‘variable’ to use in query
- Apply Filters Causing a 500 Internal Server Error
- How to do searching based on keywords added in page
- Open media box library from link
- How to only Load scripts on variable products page
- Using tag or inline style attribute?
- remove () from category number [closed]
- Is there any other ways to replicating changes on live from staging without pushing from git
- upload image to wordpress media library failed for custom post type
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php
- How to get locale within WP REST Request?
- How to add extra EXIF data when images are uploaded?
- How to boost WP custom post REST API GET queries by custom taxonomies