PluginProbe
Kortez Toolset / trunk
Kortez Toolset vtrunk
kortez-toolset / kortez-toolset.php

kortez-toolset.php in Kortez Toolset trunk, at kortez-toolset.php

94 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly
3 if ( !defined( 'ABSPATH' ) ) exit;
4 /*
5 Plugin Name: Kortez Toolset
6 Plugin URI:
7 Description: A easy plugin to import dummy data for themes by Kortez Themes.
8 Version: 1.1.4
9 Author: Kortez Themes
10 Author URI: https://kortezthemes.com/
11 License: GPLv3 or later
12 License URI: https://www.gnu.org/licenses/gpl-3.0.html
13 Domain Path: /languages
14 Text Domain: kortez-toolset
15 */
16
17 define( 'KORTEZ_TEMPLATE_URL', plugin_dir_url( __FILE__ ) );
18 define( 'KORTEZ_TOOLSET_PATH', plugin_dir_path( __FILE__ ) );
19
20 /**
21 * Returns the currently active theme's name.
22 *
23 * @since 1.0.0
24 */
25 function kortez_toolset_get_theme_slug(){
26 $demo_theme = wp_get_theme();
27 return $demo_theme->get( 'TextDomain' );
28 }
29
30 /**
31 * Returns the currently active theme's screenshot.
32 *
33 * @since 1.0.0
34 */
35 function kortez_toolset_get_theme_screenshot(){
36 $demo_theme = wp_get_theme();
37 return $demo_theme->get_screenshot();
38 }
39
40 function kortez_toolset_remove_template_import_submenu() {
41 remove_submenu_page(
42 'themes.php',
43 'advanced-import-template'
44 );
45 }
46 add_action( 'admin_menu', 'kortez_toolset_remove_template_import_submenu', 999 );
47
48 /**
49 * The core plugin class that is used to define internationalization,admin-specific hooks,
50 * and public-facing site hooks..
51 *
52 * @since 1.0.0
53 */
54 require KORTEZ_TOOLSET_PATH . 'demo/functions.php';
55
56 /**
57 * Register all of the hooks related to the admin area functionality
58 * of the plugin.
59 *
60 * @since 1.0.0
61 */
62 $plugin_admin = kortez_toolset_hooks();
63 add_filter( 'advanced_import_demo_lists', array( $plugin_admin,'kortez_toolset_demo_import_lists'), 10, 1 );
64 add_filter( 'admin_menu', array( $plugin_admin, 'import_menu' ), 10, 1 );
65 add_filter( 'wp_ajax_kortez_toolset_getting_started', array( $plugin_admin, 'install_advanced_import' ), 10, 1 );
66 add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_styles' ), 10, 1 );
67 add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_scripts' ), 10, 1 );
68 add_action( 'advanced_import_replace_term_ids', array( $plugin_admin, 'replace_term_ids' ), 20 );
69 add_action( 'advanced_import_replace_post_ids', array( $plugin_admin, 'replace_attachment_ids' ), 30 );
70
71 /**
72 * Hide Wpmet promotional notices
73 */
74
75 add_action('admin_head', function () {
76 echo '<style>
77 .wpmet-notice,
78 .wpmet-banner,
79 .notice[class*="wpmet"],
80 div[class*="wpmet"] .notice {
81 display:none !important;
82 }
83 </style>';
84 });
85
86 add_action( 'admin_head', function () {
87 ?>
88 <style>
89 #e-conversion-banner {
90 display: none !important;
91 }
92 </style>
93 <?php
94 } );