| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
Plugin Name: Kadence ToolKit |
| 5 |
Description: Custom Portfolio and Shortcode functionality for free Kadence WordPress themes |
| 6 |
Version: 3.7 |
| 7 |
Author: Kadence Themes |
| 8 |
Author URI: https://kadencethemes.com/ |
| 9 |
License: GPLv2 or later |
| 10 |
*/ |
| 11 |
|
| 12 |
function virtue_toolkit_activation() { |
| 13 |
flush_rewrite_rules(); |
| 14 |
get_option('kadence_toolkit_flushpermalinks', '1'); |
| 15 |
} |
| 16 |
register_activation_hook(__FILE__, 'virtue_toolkit_activation'); |
| 17 |
|
| 18 |
function virtue_toolkit_deactivation() { |
| 19 |
} |
| 20 |
register_deactivation_hook(__FILE__, 'virtue_toolkit_deactivation'); |
| 21 |
|
| 22 |
add_filter( 'kadence_theme_options_args', 'kadencetoolkit_redux_args_new'); |
| 23 |
function kadencetoolkit_redux_args_new( $args ) { |
| 24 |
$args['customizer_only'] = false; |
| 25 |
return $args; |
| 26 |
} |
| 27 |
require_once('post-types.php'); |
| 28 |
require_once('gallery.php'); |
| 29 |
require_once('shortcodes.php'); |
| 30 |
require_once('shortcode_ajax.php'); |
| 31 |
require_once('pagetemplater.php'); |
| 32 |
require_once('metaboxes.php'); |
| 33 |
|
| 34 |
if(!defined('VIRTUE_TOOLKIT_PATH')){ |
| 35 |
define('VIRTUE_TOOLKIT_PATH', realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR ); |
| 36 |
} |
| 37 |
if(!defined('VIRTUE_TOOLKIT_URL')){ |
| 38 |
define('VIRTUE_TOOLKIT_URL', plugin_dir_url(__FILE__) ); |
| 39 |
} |
| 40 |
|
| 41 |
function kadencetoolkit_textdomain() { |
| 42 |
load_plugin_textdomain( 'virtue-toolkit', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
| 43 |
} |
| 44 |
add_action( 'plugins_loaded', 'kadencetoolkit_textdomain' ); |
| 45 |
|
| 46 |
|
| 47 |
function kadencetoolkit_admin_scripts() { |
| 48 |
wp_register_style('kadencetoolkit_adminstyles', VIRTUE_TOOLKIT_URL . '/assets/toolkit_admin.css', false, 23); |
| 49 |
wp_enqueue_style('kadencetoolkit_adminstyles'); |
| 50 |
|
| 51 |
} |
| 52 |
|
| 53 |
add_action('admin_enqueue_scripts', 'kadencetoolkit_admin_scripts'); |
| 54 |
|
| 55 |
function kadence_toolkit_flushpermalinks() { |
| 56 |
$hasflushed = get_option('kadence_toolkit_flushpermalinks', '0'); |
| 57 |
if($hasflushed != '1') { |
| 58 |
flush_rewrite_rules(); |
| 59 |
update_option('kadence_toolkit_flushpermalinks', '1'); |
| 60 |
} |
| 61 |
} |
| 62 |
add_action('init', 'kadence_toolkit_flushpermalinks'); |
| 63 |
|
| 64 |
|
| 65 |
|