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:
- Shared functionality in plugins and themes
- Prevent publishing the post before setting a featured image?
- Need to create a Theme demo site that features multiple themes
- How to Loop Plugin Option Field Set?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Adding New Role
- Add Top-Level Menu that opens URL
- How to load plugin before the wordpress jquery?
- Disabling post images for not logged in users
- wordpress custom login successful redirect hook
- Extend Elementor Archive Posts widget with a custom skin in order to show multiple badges
- HELP: Integrating WP with raw PHP code once published button is hit
- Display All Non-Used Plugins
- How to redirect Old Post URL to new Post and keep Old post Comments?
- Modifying Footnote Plugin for Descriptive Title Attributes
- I would like to use create a function in my custom plugin to tell WP to use a different header
- New Plugin: Post update pushes a copy as a revision
- bulk change of image setting “link to” to “link to: image url “
- Placement of Code in Plugin for hooking `save_post`
- Limit the number of plugins that can be installed in a WordPress installation
- How to get variables from fucntion.php to my plugin files
- PHP Fatal error: Call to undefined function plugin_basename
- How to stop or remove an action being called inside a function of an extended class
- Missing Argument
- load_plugin_textdomain error
- Adding Shortcode to Text Widget
- Date calculations from 2 custom fields
- How to debug error message: Cannot modify header information
- How to enable specific plugin only based around shop manager role?
- Adding a new field to the address field type in gravity forms
- Nested shortcode functions accessing variable
- Calling an attribute from a plugin shortcode
- WP Query. Is there a maximum size?
- 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
- Checking the count within a foreach loop
- Create a post builder skin in a plugin
- Proper way to use plugin functions in functions.php
- Need to replace Currency Shortforms
- add_query_arg not work in admin
- 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()?
- Api external with wordpress
- Hook for altering the content of all wp mails
- How to get rid of Ellipsis on Woocommerce [Essential] Theme [closed]
- Sharing functions between plugins
- auto activate plugin when theme is active
- How to keep plugin (media-sync) running even the tab is closed?
- Load CSS before Theme CSS
- Custom Logo Link WordPress
- Where do I put the code snippets I found here or somewhere else on the web?
- How to convert Currency from USD to other IP Based currency in Php function
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- Attempting to list all product categories and the price range of all products within them
- the_posts_pagination() not working if I add wp_head() to header.php
- How to copy the all WordPress media items to another custom plugin folder?
- WordPress default post categories meta box widget
- Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
- function post to trash problem
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- adding dynamic/multiple slug values in ‘option_none_value’
- 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
- Compare Ajax Data Results
- EventON – Dequeue Styles
- WordPress Add advertising ads befor and after content with periority [closed]
- Function in my plugin is called twice
- Searched & tried a lot: Is it Possible to Eliminate Render Blocking Manually
- Unexpected plugin_dir_path Output
- Every time I use wp_get_current_user() my plugin breaks
- 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.”
- Metabox Data not saving
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Custom Function for SEO by Yoast plugin
- Call current post parameters inside a plugin
- Can’t get custom user meta to show in header
- How to list posts that appear in two categories
- 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
- Display Video as Post Thumbnail
- Notifications Bar on home page only
- How to disable plugin capability : “create new category”
- Option value not getting updated until page refresh in WordPress
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode