If you don’t want to mess with plugin load order, you can trigger the require
part a bit later, e.g. via the plugins_loaded
hook.
function csp_require_simplehtml() {
if (!function_exists('file_get_html')) {
require(CPS_PLUGIN_PATH . '/vendor/simple_html_dom.php');
}
}
add_action('plugins_loaded', 'csp_require_simplehtml');
Related Posts:
- Include WP_Query in my own PHP file?
- PHP get_category() function redeclared
- Should I use spl_autoload_register() in my plugin?
- How can I save a multiple select array with the settings API for a plug-in options page?
- error_log() output for print_r() appearing on page
- When to use Exceptions vs Error Objects vs just plain false/null
- Using register_activation_hook in classes
- Include a external PHP file into a WordPress Custom Template
- Allow only 1 taxonomy per custom post type [duplicate]
- Custom plugin: Trying to show saved data on frontend
- Uninstalling a plugin: delete all options with specific prefix
- Include files in functions.php
- Is there a way for a plugin to add an attribute to the tag of a theme?
- WordPress URL Rewrite not working
- Do I require the use of nonce?
- Fatal error: Call to undefined function plugin_dir_path()
- How to use update and delete query in wordpress
- Detect a focus on wp_editor
- Gutenberg Blocks doesn’t render correctly when using do_blocks
- load/require specific php files for specific pages/templates/post types
- How to make WordPress plugin check for database changes and then do something?
- I can’t fetch query parameters ($_GET parameters) with get_query_var
- Retrieve multiple values passed to a single attribute in a shortcode
- Change Password Hint
- Dynamic URL to reference custom PHP files
- ob_get_clean returns empty string, ob_get_flush outputs string
- Display a text message if the shortcode is not found?
- add_meta_boxes action with refresh on save
- How to change date language without changing the entire site language?
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- Prevent multiple counts by same user – WP PostViews plugin
- simple wordpress ajax plugin not working when not logged in
- How to use copy() function and paste file in /wp-content/themes directory
- Second select list values are not saved after clicking update
- Use wc_enqueue_js only on specific pages – nested add_action
- How to use a frontend URL with a Plugin
- Utilize WP-CLI from inside WordPress, not SSH
- Saving metabox repeatable fields
- OOP Plugin Development. Including external object
- Authenticating to WordPress, using my own authentication two-factor system
- Use composer to load custom classes [closed]
- Resize Image without cropping
- Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions
- how to create and show sessions in word press?
- where to include a php file
- Disable External Pingacks on WordPress Posts and Only Allow ‘Self Pings’
- wordpress custom endpoint multiple params
- Loading page template into shortcode
- Why when I instantiate wp_error in a validation method my user registration method stops working?
- My shortcode is showing up twice
- Database “Migration” for Plugins?
- WordPress template_include filter not working properly
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- When is is_admin() available?
- Create table in database when activating plugin
- do not show web page section when using advanced custom fields pro
- How to get all existing post types
- Using wp_get_image_editor in a standalone script
- New Plugin Review
- Problem with WordPress Ajax form
- Create custom blocks for bootstrap
- Theme url in all plugin pages
- Include Class File in WordPress
- allow user to select pages from dropdown in my plugin
- nowplaying.include.php Will Not Display Results
- Am I not understanding plugins?
- integrating external php library into wordpress- the right way
- Change title and meta description in included page (not template)
- Continue execution after WP REST API response
- WordPress Ajax Custom Query – High CPU LOAD
- “The plugin generated 2694 characters of unexpected output…” on Plugin activation, CREATE TABLE sql command not working
- Using Font Awesome as post thumbnail
- Can I change a variable in a content part while calling it?
- How to display a value from a radio button in the options menu in wordpress
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- allow users to publish without admin approval
- How to set a custom path, for ajax image upload folder in admin?
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- the_author() not working outside the loop
- admin-ajax.php responding with 0
- Making Quote Plugin more efficient
- How to access function from outside of a class within this class in WP plugin?
- Hiding WordPress Plugin Source Code
- How can i display post loop in table format?
- Page Reloads Before AJAX Request Finishes
- action hook wp_head higher priority as all other plugins/hooks
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- PHP can I add line numbers to file_get_contents()
- Put CSS inside a PHP file and include it the right way
- Add htaccess rules with insert_with_markers at beginning of htaccess
- custom shortcode will not display the wrapped content
- How to call function at the bottom of post using plugin?
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Insert array data on plugin activation
- Will simple function names in a class structure conflict with other plugins?
- Do my defines need to be unique?
- WordPress php filter admin_body_class not working
- Instantiate class to be available to all plugin functions
- Common abstract class for plugins