true ) ); } // Create post object function BBPWPDIRCheckPageAlreadyexist( $title ) { $query = new WP_Query( [ 'post_type' => 'page', 'post_status' => 'publish', 'title' => $title, 'posts_per_page' => 1 ] ); return $query->have_posts() ? $query->posts[0] : null; } $page_BBPWPDIR = BBPWPDIRCheckPageAlreadyexist( 'BuildABand' ); if (!$page_BBPWPDIR) { $my_post_BBPWPDIR = array( 'post_title' => wp_strip_all_tags('BuildABand'), 'post_content' => '[BuildABand]', 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', ); // Insert the post into the database wp_insert_post( $my_post_BBPWPDIR ); } } } new buildaband_BAND_A_BUILDER(); } // Enqueue scripts and styles add_action('wp_enqueue_scripts', 'band_a_builder_wp_callback_for_scripts'); function band_a_builder_wp_callback_for_scripts() { wp_enqueue_style('bootstrap_css_BBWP', buildaband_PLUGIN_URL.'assets/css/plugins/bootstrap.min.css',[],'1.0'); wp_enqueue_style( 'bootstrap_css_BBWP' ); wp_register_style( 'montserrat_BBWP', buildaband_PLUGIN_URL.'assets/fonts/montserrat/montserrat.css',[],'1.2' ); wp_enqueue_style( 'montserrat_BBWP' ); wp_register_style( 'theme_BBWP', buildaband_PLUGIN_URL.'assets/css/theme.css' ,array(),'1.10'); wp_enqueue_style( 'theme_BBWP' ); wp_register_style( 'band_builders_BBWP', buildaband_PLUGIN_URL.'assets/css/band-builder.css',array(),'1.0' ); wp_enqueue_style( 'band_builders_BBWP' ); wp_register_style( 'responsive_BBWP', buildaband_PLUGIN_URL.'assets/css/responsive.css' ,array(),'10' ); wp_enqueue_style( 'responsive_BBWP' ); } function band_a_builder_wp_enqueue_external_js_footer() { wp_enqueue_script( 'bootstrap_BBWP', buildaband_PLUGIN_URL.'assets/js/plugins/bootstrap.bundle.min.js', array( 'jquery' ),false ); wp_enqueue_script('theme_buildaband', buildaband_PLUGIN_URL . 'assets/js/theme.js', array('jquery'), '1.9', true); wp_localize_script('theme_buildaband', 'buildaband_ajax', array( 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('buildaband_filter_program'), )); wp_localize_script('theme_buildaband', 'buildaband_add_to_cart_ajax', array( 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('buildaband_addTocartOrder'), )); } add_action('wp_footer', 'band_a_builder_wp_enqueue_external_js_footer'); require_once plugin_dir_path(__FILE__) . 'templates/band-builder-woo-variant.php';