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:
- How to export comments in WordPress?
- How can I call a function from one plugin within another plugin?
- Gutenberg disallow certain custom blocks but keep all core blocks?
- Remote upload file to server B
- Publish author posts only with editor approval?
- Using functions from a plugin in your theme
- Keep one user logged for a year?
- Customizing subject in comment notification e-mails
- WP showing “warning: call_user_func_array()”, What to do?
- Declare a function before plugin does on the theme functions.php file
- Generate Advanced Custom Fields box in custom admin menu page
- How to turn off email you receive when registered?
- Removing user contact methods works from functions.php but not from a plugin
- Execute a function using ajax
- Use functionality of 2 wordpress plugins
- How can i change an image’s author?
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- Showing Co-Authors on post page
- jQuery Plugin to use WordPress functions in AJAX request
- Debugging Technique Question re: functions.php
- The Point of Using apply_filters()
- WP Job Manager Category Drop-down; Change Placeholder Text Via Filter
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- How to include code into functions.php file via a plugin
- Custom Taxonomy Tag Search
- Redeclare theme’s function in a plugin
- I have functions in my wordpress plugin. How do I get them to work for me?
- Change wordpress current_time function to different timezone
- How to override a plugin function wrapped in a class?
- Edit Yoast SEO breadcrumbs output [closed]
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Using a post-signup hook to get user details
- Restrict media upload size by format
- Calling plugin function inside custom plugin for onclick event
- Show function to super admin
- Facebook Messager Plugin
- All sites themes functions.php have been changed
- WordPress get_avatar function not correct working
- WordPress metaboxes – textfield suggestion automatically populated
- Which file of wordpress manage plugins functionalities?
- Improving the perfomance of a plugin action
- Check if variable is set in filter
- Image change on hover
- Passing stored variables to add_filter
- JQuery prepend a function
- Are there action hooks for comments?
- How to make a dynamic css class whose name changes every visit to confuse scraper
- Plugin onclick button activate other plugin
- Activate and deactivate plugin automatically
- Send email with list of active plugins upon activation/deactivation
- Using custom fields for image alt and title
- Where Should i write the code for wordpress ajax voting?
- Set up functions to be overridden without using function_exists() by short-circuiting them?
- How do I convert my WordPress website to be domain agnostic?
- Add the_post_thumbnail_url to a shortcode in function.php
- Add action to custom Function
- Show media-uploads to all users
- Help with a function in a widget
- how can authors to define custom pages?
- Adding a Tag Parameter / Filter to My Shortcode
- Call javascript functions from each page
- How do I create pages within a WordPress post?
- How can i call a functions.php function, from inside my plugin class?
- How to upload large media file in chunks, without any plugin?
- WP Function does not trigger on Webhook API Call
- Why do I need to reload the page for WordPress to see the new custom field added with jQuery
- Cookie value changes back to previous value after changing
- RSS Feed on WordPress showing code (hypertext) in articles titles
- Alternative Hook to the_content for Changing Background Color
- Unpublished Pages Failing To Appear On Custom Path
- Post source link plugin – small modification
- How to add specific script to WordPress webpage that will working with user input and databases
- Hide Plugin Custom Post Type Menu Link
- How to create algorithm for ordering posts in WordPress?
- Add external javascript to post template
- Block plugin update possibilities (but not by hiding notifications)
- Execute function activate/deactivate plugin in specific pages
- Plugin function in child theme
- Call function with button and return response
- Soflyy WP All Import Custom File Download Issue
- Update (a function) post’s featured image as soon as $image_url changes
- Why is WP template_include overwritting all templates rather than specified page?
- Why isn’t my plugin seeing other classes?
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Contact Form 7: custom validation [closed]
- functions.php conditional output for a single plugin
- date function not correctly returning date
- Access to wordpress method inside of classes
- Single dash converted to double dash
- How use Dynamic hyperlink on each wordpress post?
- How to declare this function correctly?
- WordPress: code structure
- Can’t modify plugin function
- PHP if url extension action=discussion condition use [closed]
- filter just a portion of plugin function
- Make plugin admin page visible to other roles
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- wp_enqueue_script doesn’t load JS in plugin
- Read page- or post-content across different builder-plugins
- Remove posts that start with similar words (like a delete duplicate posts plugin)