get_bloginfo( 'version' ) , 'plugins_installed' => $plugins , 'last_update_range_facet_tooltip' => _txt_awppt_last_update_range_tooltip , 'rating_facet_tooltip' => _txt_awppt_rating_tooltip , 'num_ratings_facet_tooltip' => _txt_awppt_num_ratings_tooltip , 'plugin_class_facet_tooltip' => _txt_awppt_plugin_class_tooltip , 'installs_facet_tooltip' => _txt_awppt_installs_tooltip ) ); } //======================================================================================================================================= // THEMES SEARCH PAGE // only if user is admin and is on the right page, we load what we need if(is_admin() && $hook == $awppt_themes_page ) { //CSS wp_enqueue_style( 'swpp-styles-css', AWPPT_PLUGIN_URL .'assets/css/styles.css'); add_thickbox(); //JS wp_enqueue_script( 'bootstrap_awppt', AWPPT_PLUGIN_URL.'assets/js/bootstrap.min.js', array('jquery'), '3.2.0', true); wp_enqueue_script( 's_awppt', AWPPT_PLUGIN_URL.'assets/js/s.min.js', false, '3.0.1', true); wp_enqueue_script( 'sh_awppt', AWPPT_PLUGIN_URL.'assets/js/s.h.min.js', false,'2.0.1', true); wp_enqueue_script( 'hogan_awptt', AWPPT_PLUGIN_URL.'assets/js/hogan.common.js', false, '3.0.0', true); wp_enqueue_script( 'checkbox_awppt', AWPPT_PLUGIN_URL . 'assets/js/bootstrap-checkbox.js',false,'1.0.0', true); wp_enqueue_script( 'slider_awppt', AWPPT_PLUGIN_URL . 'assets/js/bootstrap-slider.js',false,'1.0.0', true); wp_enqueue_script( 'app_awpt', AWPPT_PLUGIN_URL . 'assets/js/awpt.min.js',false,'1.1.0', true); // We pass some variables to the JS app in order to improve results wp_localize_script('app_awpt', 'app_awpt_vars', array( 'wpversion' => get_bloginfo( 'version' ) , 'last_update_range_facet_tooltip' => _txt_awppt_last_update_range_tooltip , 'rating_facet_tooltip' => _txt_awppt_rating_tooltip , 'num_ratings_facet_tooltip' => _txt_awppt_num_ratings_tooltip , 'installs_facet_tooltip' => _txt_awppt_installs_tooltip ) ); } } function awppt_get_plugins_installed() { //We get the list of plugins installed in order to check against the search so the user can see if //the plugin is already installed directly in the results... //Un-comment for debugging... //print("
".print_r(get_plugins(),true)."
"); $all_plugins = get_plugins(); $all_plugins_keys = array_keys($all_plugins); $plugins = array(); $loopCtr = 0; foreach ($all_plugins as $plugin_item) { // Get our Plugin data variables $plugin_root_file = $all_plugins_keys[$loopCtr]; $arr = explode("/", $plugin_root_file, 2); $plugins[] .= $arr[0]; //Uncomment for debugging if needed /* $slug = $arr[0]; $plugin_title = $plugin_item['Title']; $plugin_version = $plugin_item['Version']; $plugin_status = is_plugin_active($plugin_root_file) ? 'active' : 'inactive'; echo $loopCtr.'-'.$plugin_root_file .' - SLUG = '. $slug.'
'; */ $loopCtr++; } return $plugins; } function awppt_subscribe_newsletter() { $screen = get_current_screen(); if($screen->id == 'appearance_page_addendio-search-themes'){ // Form for the Themes Newsletter $html = '

'; } // Form for the Plugins Newsletter if($screen->id == 'plugins_page_addendio-search-plugins'){ $html = '

'; } return $html; }