We have four classes in the main plugin that depend on the template loader and we have only checked the dependency for the WPWA_Custom_Post_Types_Manager
class. Let's define the dependencies for the remaining classes. The following code contains the current code for the wpwa_plugin_init
function inside the class-wpwa-portfolio-manager.php
file:
function wpwa_plugin_init(){ if(!class_exists('WPWA_Template_Loader')){ add_action( 'admin_notices', 'wpwa_plugin_admin_notice' ); }else{ global $wpwa_custom_post_types_manager; $wpwa_custom_post_types_manager = new WPWA_Custom_Post_Types_Manager(); } }
Now, let's add the remaining dependencies inside this function, as shown in the following code:
function wpwa_plugin_init(){ if(!class_exists('WPWA_Template_Loader')){ add_action( 'admin_notices', 'wpwa_plugin_admin_notice' ); }else{ global $wpwa_custom_post_types_manager, $wpwa_theme, $wpwa_settings, $backbone_projects ; $wpwa_custom_post_types_manager...