wp_mail()
is defined in wp-includes/pluggable.php
. This file is loaded after the plugins are loaded, but before the hook plugins_loaded
has been fired.
So the answer is: wait.
add_action( 'plugins_loaded', 'renderHTML' );
On a side note: prefix your function names and your global variables.
Related Posts:
- What is the advantage of using wp_mail?
- wp_mail is undefined
- wp_mail not recognizing cc and bcc headers
- Problem with `wp_mail()`
- Do I have to override the wp_mail() pluggable function with writing a plugin?
- How to send email in wordpress with more than one attachments
- wp_mail() headers multipart/alternative
- White screen when activating plugin that sends form via WordPress
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- Fatal error: Call to a member function get_page_permastruct() on a non-object
- Fatal error: Uncaught Error: Call to undefined function convert_to_screen()
- Fatal error: Cannot redeclare admin_notice() [closed]
- Error: Call to a member function get_error_code() on a non-object
- Class cannot be found, but it’s available in the file, I get: Fatal Error: Uncaught Error: Class ‘Blocks\Base\Activation’ not found
- How to get post meta in functions?
- Using wp_mail to send email?
- WP_Fatal_Error_Handler OR WP_Error OR try/catch
- Uncaught Error: Call to undefined function wp_get_current_user() in
- Fatal error: Uncaught Error: Using $this when not in object context
- Allow user to add the php code in wp_mail()
- wp_mail links are dead
- wp_mail_from not changing from address
- Fatal Error triggers Before WP_Error handler
- Saving metabox updates causing fatal error
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How can I add an image upload field directly to a custom write panel?
- Creating a table in the admin-style?
- On the WordPress Admin section how do I link to submenu pages created for a plugin?
- How to return only certain fields using get_posts()
- Scheduled events disappear from events queue
- Where is it better to start learning how to develop for WordPress?
- How to log plugin errors to plugin error_log file
- Custom Post Type Link from Plugin
- How to Get a List of Sub Blogs without Using get_blog_list()?
- How to find attachment ID for first image in a post
- Multiple textdomains
- Dynamically Override Fancy Title
- What URL do you pass to wp_remote_get to load the body of the current post’s preview?
- Override pluggable functions in a plugin?
- Set a specific page as 404 – not found via my own plugin
- Adding Automatically To In WordPress Using Filter Referencing?
- Sharing a common set of image files for media library, across all sites within multisite
- Plugin update not reflected in WordPress plugin page
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- Best plugin for most viewed post [closed]
- What could cause my plugin’s options/settings page not to load?
- Disable The Events Calendar plugin from loading its scripts
- How to remove images from my plugin page in WP Directory?
- How to create database table, add data, update and delete using wpdb via plugins?
- Extending theme PHP class in plugin
- Any ideas to trigger some code after plugin update?
- Is there an additional block.json property to set to get an InnerBlocks child to respect the “supports” property?
- Plugin with action ‘save_post’ needs to press publish twice on order to publish
- WP Editor Issue in Backend
- How to test plugin update through WordPress plugin updater without tagging new release in the repo
- On the .org repo, can your plugin name/slug contain “WooCommerce” [closed]
- Wrap text around shortcode
- UWooCommerce – add cart discount programmatically?
- Checked() function on a multidimensional array
- Remove sidebar on single page using plugin API
- When does save_post hook fire on post save/update
- Plugin does not add action
- Enqueuing scripts and styles in custom plugins
- Include file in plugin file
- Plugin language always shows WP site language, not profile language
- Adding custom stylesheet into header.php using a plugin
- Developing the save function in Gutenberg blocks
- Creating an installation zip file
- update_callback is not working in register_rest_field
- How to create ShortCode
- Detect change in site_url and home_url
- Reporting errors in a shortcode plugin
- shortcode tags not working in do_shortcode
- Why is the form not updating when I select a new sector from the list?
- How do I add a menu item to a Pods admin menu?
- Is there a way to add a link with add_post_meta?
- How to Show Category List With Corresponding Links?
- .htaccess with WordPress – create my own pretty url with parameters (above WordPress settings)
- Import images remotly run through timeout error
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- How do I add a 5 digit ZIP code validation to a Contact7 form?
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- How can we stop showing short code in create or edit post section
- Delete Plugin Options with Verify
- set a custom post type to a taxonomy term programmatically in metabox
- How to create a simple plugin which show/hide an html code in wordpress?
- How to display properly exception or echo string after posting in plugin?
- How to create custom frontend php page via plugin
- How can I add recent posts to menu like mashable
- Translation of plugin Upload button
- Changing upload directory for plugin uploads only
- Create wordpress dashboard metabox which spans all columns
- How do I query posts and have their related taxonomies returned in the results?
- add_filter adds output in the head
- How can i add insertion point between inner blocks in my custom block like core blocks
- Update option hook not firing
- $_GET vs get_query_var()
- Call API on post save/update and show the result in admin area
- 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