- No categories
- All
Fatal error: Uncaught Error: Call to undefined function get_home_path()
EDIT, I've taken some custom SiteOrigin Page Builder widgets out of a theme and placed them in a new custom plugin. In the main plugin file, I have: require plugin_dir_url( __FILE__ ) . 'hdr003.php'; require plugin_dir_url( __FILE__ ) . 'hme006.php'; require plugin_dir_url( __FILE__ ) . 'hme007.php'; function purity_register_widgets(){ register_widget('ICD_HDR003_Widget'); register_widget('ICD_HME006_Widget'); register_widget('ICD_HME007_Widget'); } add_action( 'widgets_init', 'purity_register_widgets'); In, for example, hdr003.php, I have: class ICD_HDR003_Widget extends WP_Widget { However, I receive: Fatal error: Class 'WP_Widget' not found Hence, I'm trying to include in hdr003.php: require_once(get_home_path(). 'wp-includes/class-wp-widget.php'); but this produces an error: Fatal error: Uncaught Error: Call to undefined function get_home_path() The function is a valid function. If I replace that line with: require_once(ABSPATH . 'wp-includes/class-wp-widget.php'); I … [Read more...] about Fatal error: Uncaught Error: Call to undefined function get_home_path()
Learn More