Maybe you should try calling the functions of your plugin using the plugins_loaded action.
Plugin A
class PluginA {
public function func_a() {
// do stuff
}
}
Plugin B
class PluginB {
function functB() {
if (class_exists('PluginA')) {
//do stuff that depends of PluginA
}
}
}
add_action('plugins_loaded', 'call_plugin_a_using_plugin_b');
function call_plugin_a_using_plugin_b() {
PluginB::functB();
}
According to the Codex, the plugins_loaded action fires after all plugins are loaded, so making sure that all plugins are loaded before calling a function from other plugin might be the way to go.
Related Posts:
- How do I replace a function, declared inside a plugin’s class, in functions.php?
- Need to create a Theme demo site that features multiple themes
- Define Function in functions.php or plugin and call in theme loop
- Autogenerate wordpress shortcodes using array?
- Why does including a file in theme’s functions.php not work?
- WooCommerce create new product and add to cart on form submit
- Adding New Role
- Shortcode under a Shortcode Multiple times Possible?
- Add Top-Level Menu that opens URL
- wordpress custom login successful redirect hook
- WordPress ajax call for not logged in users, doesn’t work
- Display All Non-Used Plugins
- New Plugin: Post update pushes a copy as a revision
- Placement of Code in Plugin for hooking `save_post`
- Display a text message if the field is not found and not if found
- Add get_option to jquery
- Get all categories of custom post even not assigned
- Function to prevent users from trashing comments
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- How to add class in plugin only for network site?
- How does WordPress process plugin installations?
- PHP Fatal error: Call to undefined function plugin_basename
- Executing my function once on a specific time
- Missing Argument
- load_plugin_textdomain error
- wordpress plugin is not activating from widget
- Adding Shortcode to Text Widget
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Using a function to change favorites listing
- WP Query. Is there a maximum size?
- How to remove custom post type and add category and post name
- Redirect to another page using contact form 7? [closed]
- Display Custom Field Value on Admin Page Column
- List the authors that have written posts in a category
- How to get plugin name from plugin file location
- How to prevent additional code in functions.php to be removed once there is an update?
- Checking the count within a foreach loop
- Create a post builder skin in a plugin
- Need to replace Currency Shortforms
- add_query_arg not work in admin
- Woocommerce singe product custom gallery output works just on the first slide
- How do I create a custom permalink structure for a page template
- How to remove a class function from a plugin by using remove_action()?
- How to translate wordpress error message
- Api external with wordpress
- strange shortcode error: does shortcodes requires any dependency?
- All custom widgets are not showing in widget area at the same time
- Hook for altering the content of all wp mails
- How to get rid of Ellipsis on Woocommerce [Essential] Theme [closed]
- Sharing functions between plugins
- More gentle way to hook WordPress custom url
- Removing the custom_image_header from wp_head
- Build a must-use plugin that tracks when other plugins are activated or deactivated
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- How to copy the all WordPress media items to another custom plugin folder?
- FPDF for creating pdf diplomas
- WordPress default post categories meta box widget
- Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- adding dynamic/multiple slug values in ‘option_none_value’
- How to assign a specific service to a specific provider based on location
- Make modification of add_to_cart button specific to single page
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- how can export data in excel file custom plugin
- WP_CRON issue with UTC and local time
- How to wrap image tag into div for post only?
- Update User Meta Via Ajax
- EventON – Dequeue Styles
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- Nested DIV’s across functions in PHP, do not seem to work
- Function in my plugin is called twice
- Searched & tried a lot: Is it Possible to Eliminate Render Blocking Manually
- Unexpected plugin_dir_path Output
- Can plugin automatically update if i hide the update notification?
- how to repeat taxonomy in different places on wordpress
- how to create table during plugin installation in side a class
- Posting code inside the post instead of in the template file using shortcode
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- How to use scripts when header/footer are stripped out
- Metabox Data not saving
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Can’t get custom user meta to show in header
- Including a PHP file via a function that is part of a plugin?
- overwrite a plugin function in functions.php
- Pass strings to plugin function [closed]
- How to tweak a plugin without preventing it from updating
- WP Members additional fields on user profile [closed]
- Adminimize Plugin — Is there an alternative to limiting Editor to ‘Appearance > Widgets’ only?
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Woocommerce – Product Description heading [closed]
- Display Video as Post Thumbnail
- Notifications Bar on home page only
- How to Add Extra Text In WordPress Title Before Post Publish
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Gravity Forms and Gravity View Permissions
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- WordPress Convert queries to slashes using function.php
- add to cart linking to add to cart page
- How to call a logging function from a generic utility plugin from another plguin