'.__('Install Pagelayer Free Version', 'popularfx').''; $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( ) ); $installed = $upgrader->install('https://downloads.wordpress.org/plugin/pagelayer.zip'); if(is_wp_error( $installed ) || empty($installed)){ return $installed; } if ( !is_wp_error( $installed ) && $installed ) { echo __('Activating Pagelayer Plugin !', 'popularfx'); $installed = activate_plugin('pagelayer/pagelayer.php'); if ( is_null($installed)) { $installed = true; echo '

'. sprintf(__('Done! Pagelayer is now installed and activated. Please click here to import your themes content', 'popularfx'), esc_url(admin_url('admin.php?page=pagelayer_import'))). '


'; echo '

'.__('Done! Pagelayer is now installed and activated', 'popularfx').'.'; } } return $installed; } // Prevent pro activate text for installer function popularfx_install_pagelayer_complete_actions($install_actions, $api, $plugin_file){ if($plugin_file == 'pagelayer-pro/pagelayer-pro.php'){ return array(); } if($plugin_file == 'pagelayer/pagelayer.php'){ return array(); } return $install_actions; } } if(!function_exists('popularfx_admin_menu')){ // This adds the left menu in WordPress Admin page add_action('admin_menu', 'popularfx_admin_menu', 5); function popularfx_admin_menu() { if(defined('PFX_FILE')){ return; } $capability = 'edit_theme_options';// TODO : Capability for accessing this page add_theme_page('PopularFX', __('PopularFX Options', 'popularfx'), $capability, 'popularfx', 'popularfx_page_handler'); /*// Add the menu page add_menu_page('PopularFX', 'PopularFX', $capability, 'popularfx', 'popularfx_page_handler', POPULARFX_URL.'/images/popularfx-logo-menu.png'); // Options Page add_submenu_page('popularfx', 'PopularFX', __('Information', 'popularfx'), $capability, 'popularfx', 'popularfx_page_handler'); // PopularFX Templates add_submenu_page('popularfx', __('Website Templates', 'popularfx'), __('Website Templates', 'popularfx'), $capability, 'popularfx_templates', 'popularfx_page_templates');*/ } } // Install Templates part if(!function_exists('popularfx_page_templates')){ function popularfx_page_templates() { include_once(dirname(__FILE__).'/popularfx-templates.php'); popularfx_templates(); } } if(!function_exists('popularfx_page_handler')){ function popularfx_page_handler() { include_once(dirname(__FILE__).'/popularfx-dashboard.php'); popularfx_dashboard(); } } //////////////// // Some vars //////////////// $popularfx['www_url'] = esc_url('https://popularfx.com'); $popularfx['support_url'] = esc_url('https://popularfx.deskuss.com'); $popularfx['slug'] = popularfx_get_current_theme_slug(); // Show the theme import notice if not shown if(file_exists(dirname(dirname(__FILE__)).'/pagelayer.conf')){ if(!function_exists('pagelayer_theme_import_notices')){ add_action('admin_notices', 'popularfx_pagelayer_required'); }else{ add_action('admin_notices', 'pagelayer_theme_import_notices'); } }