Assuming that I have the utility plugin, and the my_error_log() function is there, how can I call it from anywhere in my other plugins?
By calling it, there are no special steps
How can I be sure I can call it? Are plugins functions available across my WordPress code?
Yes, plugins are not sandboxed, everything is loaded into the same melting pot. WordPress is aware a plugin exists but it doesn’t track/tag/sandbox code inside plugins. It’s just a mechanism for loading arbitrary PHP.
Should I somehow ensure that my utility plugin is loaded first?
Yes, you should test if the functions/classes exist. How you would do that though is generic PHP that has nothing to do with WordPress though, e.g. if ( function_exists(... etc
Related Posts:
- Shared functionality in plugins and themes
- Plugin update error message
- Core framework/helpers for logging stuff?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- How to handel multiple checkbox field in the admin settings page with Settings API
- wp_insert_user – how to send verification email before logging in
- Is the WordPress HTTPS Plugin Still Safe To Use? [closed]
- Set a User as Author of all ‘New Posts’ posted
- Post source link plugin – small modification
- How do you auto-activate plugins from child themes
- What is the function to get plugin base url in multisite?
- Code in theme functions.php faster than with a plugin?
- Disabling post images for not logged in users
- Override the core function locate_template
- 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
- Trying to count the total number of paragraphs inside a blog article
- How to get post URL in the_content filter?
- How to get variables from fucntion.php to my plugin files
- May i Use ShortCode in Template?
- Pass info from functions.php to plugin
- add_query_arg not working
- Inserting HTML tag with ACF into shortcode
- How to stop or remove an action being called inside a function of an extended class
- How to Display a Plugin function (content) on frontpage using index.php
- Theme my Login plugin, how to update fields
- 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?
- get current date + 90 days and checking every day
- Adding a new field to the address field type in gravity forms
- How to create an input field, and base the output on spreadsheet data? [closed]
- Customize permalink wordpress category id
- Admin style for just one plugin in dashboard
- How to set Noindex to all wordpress pages in a catergory?
- 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
- Load Javascript from Plugin in One Page Only?
- How to get plugin name from plugin file location
- Checking the count within a foreach loop
- How to keep variable `$post` to using in another file
- Plugin Development – Functions or Hooks?
- wp_dequeue_script for a Plugin
- wc_get_template new template does not showing up
- Overriding an Array in a Plugin’s Class/Function from functions.php
- 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()?
- Change Header (Logo) Based on Login
- Hook for altering the content of all wp mails
- How can i list random author?
- Can you echo PHP code from a variable?
- Defining the value of a variable before a function?
- How to get custom minimum price in Woocommerce
- Dynamic URL Rewrite for Custom
- how to validate input field in wordpress generated with wpform plugin
- Error using wordpress functions inside a plugin class
- How to copy the all WordPress media items to another custom plugin folder?
- Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
- Share my WordPress plugin for updating how?
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- The function called on the wp head hook becomes null
- Submitting form to PHP
- How to detect 404 url and make this link underline or change background color?
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- working code, not working – Plugin Dev
- How use get_plugin_updates() function?
- how override a define
- How to Unhook actions/filters in within Class in plugin
- How to disable/enable a plugin at a specific time
- Configuring default woo commerce login with modal popup
- How to wrap image tag into div for post only?
- Update User Meta Via Ajax
- Dynamically Modify s2member Options
- register_activation_hook doesn’t fire at all
- My ajax request don´t work and return 0
- How can I add a custom checkbox / radio button on the admin theme options to display a CSS or other?
- How to delete posts older than one year with post meta, post attachments and files?
- Create csv file in plugin
- Posting code inside the post instead of in the template file using shortcode
- Load wordpress enviroment for external content?
- How do add_action and WP_Query
- How to structure plugin in to functions?
- Can’t get custom user meta to show in header
- overwrite a plugin function in functions.php
- Pass strings to plugin function [closed]
- How to disable register and reset the password from WordPress admin panel?
- How to tweak a plugin without preventing it from updating
- WP Members additional fields on user profile [closed]
- What is wrong with this dbDelta syntax?
- Call a function with href
- Display Video as Post Thumbnail
- Notifications Bar on home page only
- Adding a script & php to functions.php
- Override the plugin class and function
- Activate and deactivate two plugins automatically at certain hours
- Gravity Forms and Gravity View Permissions
- Run a function only once when logging into dashboard
- Event Made Easy – Block registration to two or more events that have the same category
- I want to allow certain file types on dokan upload files