PluginProbe
Virtue/Ascend/Pinnacle Toolkit / 4.9.12.2
Virtue/Ascend/Pinnacle Toolkit v4.9.12.2
4.9.12.2 trunk 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.7 All 48 releases
← All changes | virtue_toolkit.php +84 -41 3.0 → 4.9.12.2 View file →
@@ -1,65 +1,108 @@
1 1 <?php
2 +/**
3 + * Plugin Name: Virtue/Ascend/Pinnacle Toolkit
4 + * Description: Custom Portfolio and Shortcode functionality for free Virtue, Ascend, and Pinnacle WordPress themes.
5 + * Version: 4.9.12.2
6 + * Author: Kadence WP
7 + * Author URI: https://kadencewp.com/
8 + * License: GPLv2 or later
9 + *
10 + * @package Kadence Toolkit
11 + */
2 12
3 -/*
4 -Plugin Name: Virtue / Pinnacle ToolKit
5 -Description: Custom Portfolio and Shortcode functionality for Virtue and Pinnacle Wordpress Theme
6 -Version: 3.0
7 -Author: Kadence Themes
8 -Author URI: http://kadencethemes.com/
9 -License: GPLv2 or later
10 -*/
11 -
13 +/**
14 + * Kadence Toolkit Activation
15 + */
12 16 function virtue_toolkit_activation() {
13 - kad_portfolio_post_init();
14 17 flush_rewrite_rules();
15 - get_option('kadence_toolkit_flushpermalinks', '1');
18 + get_option( 'kadence_toolkit_flushpermalinks', '2' );
16 19 }
17 -register_activation_hook(__FILE__, 'virtue_toolkit_activation');
20 +register_activation_hook( __FILE__, 'virtue_toolkit_activation' );
18 21
19 -function virtue_toolkit_deactivation() {
22 +/**
23 + * Set redux args
24 + *
25 + * @param array $args redux framework args.
26 + */
27 +function virtue_toolkit_redux_args_new( $args ) {
28 + $args['customizer_only'] = false;
29 + $args['save_defaults'] = true;
30 + return $args;
20 31 }
21 -register_deactivation_hook(__FILE__, 'virtue_toolkit_deactivation');
32 +add_filter( 'kadence_theme_options_args', 'virtue_toolkit_redux_args_new' );
22 33
23 -add_filter( 'kadence_theme_options_args', 'kadencetoolkit_redux_args_new');
24 -function kadencetoolkit_redux_args_new( $args ) {
25 - $args['customizer_only'] = false;
26 - return $args;
34 +if ( ! defined( 'VIRTUE_TOOLKIT_PATH' ) ) {
35 + define( 'VIRTUE_TOOLKIT_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
27 36 }
28 -require_once('post-types.php');
29 -require_once('gallery.php');
30 -require_once('shortcodes.php');
31 -require_once('shortcode_ajax.php');
32 -require_once('pagetemplater.php');
33 -require_once('metaboxes.php');
37 +if ( ! defined( 'VIRTUE_TOOLKIT_URL' ) ) {
38 + define( 'VIRTUE_TOOLKIT_URL', plugin_dir_url( __FILE__ ) );
39 +}
34 40
35 -if(!defined('VIRTUE_TOOLKIT_PATH')){
36 - define('VIRTUE_TOOLKIT_PATH', realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR );
41 +require_once VIRTUE_TOOLKIT_PATH . 'kadence_image_processing.php';
42 +require_once VIRTUE_TOOLKIT_PATH . 'post-types.php';
43 +require_once VIRTUE_TOOLKIT_PATH . 'gallery.php';
44 +require_once VIRTUE_TOOLKIT_PATH . 'author_box.php';
45 +require_once VIRTUE_TOOLKIT_PATH . 'shortcodes.php';
46 +require_once VIRTUE_TOOLKIT_PATH . 'shortcode_ajax.php';
47 +require_once VIRTUE_TOOLKIT_PATH . 'pagetemplater.php';
48 +require_once VIRTUE_TOOLKIT_PATH . 'metaboxes.php';
49 +require_once VIRTUE_TOOLKIT_PATH . 'class-virtue-toolkit-welcome.php';
50 +require_once VIRTUE_TOOLKIT_PATH . 'widgets.php';
51 +
52 +/**
53 + * Virtue Toolkit Textdomain
54 + */
55 +function virtue_toolkit_textdomain() {
56 + load_plugin_textdomain( 'virtue-toolkit', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
37 57 }
38 -if(!defined('VIRTUE_TOOLKIT_URL')){
39 - define('VIRTUE_TOOLKIT_URL', plugin_dir_url(__FILE__) );
40 -}
58 +add_action( 'plugins_loaded', 'virtue_toolkit_textdomain' );
41 59
42 -function kadencetoolkit_textdomain() {
43 - load_plugin_textdomain( 'kadencetoolkit', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
44 -}
45 -add_action( 'plugins_loaded', 'kadencetoolkit_textdomain' );
46 60
61 +function virtue_toolkit_admin_scripts( $hook ) {
62 + wp_enqueue_style( 'virtue_toolkit_adminstyles', VIRTUE_TOOLKIT_URL . '/assets/toolkit_admin.css', false, 46 );
47 63
48 -function kadencetoolkit_admin_scripts() {
49 - wp_register_style('kadencetoolkit_adminstyles', VIRTUE_TOOLKIT_URL . '/assets/toolkit_admin.css', false, 23);
50 - wp_enqueue_style('kadencetoolkit_adminstyles');
64 + if( $hook != 'edit.php' && $hook != 'post.php' && $hook != 'post-new.php' && $hook != 'widgets.php' ) {
65 + return;
66 + }
67 + wp_enqueue_media();
68 + wp_enqueue_script('toolkit_gallery_meta', VIRTUE_TOOLKIT_URL . '/assets/kttk_admin_gallery.js', array( 'jquery' ), 460, false);
51 69
52 70 }
53 71
54 -add_action('admin_enqueue_scripts', 'kadencetoolkit_admin_scripts');
72 +add_action('admin_enqueue_scripts', 'virtue_toolkit_admin_scripts');
55 73
56 -function kadence_toolkit_flushpermalinks() {
74 +function virtue_toolkit_flushpermalinks() {
57 75 $hasflushed = get_option('kadence_toolkit_flushpermalinks', '0');
58 - if($hasflushed != '1') {
76 + if($hasflushed != '2') {
59 77 flush_rewrite_rules();
60 - update_option('kadence_toolkit_flushpermalinks', '1');
78 + update_option('kadence_toolkit_flushpermalinks', '2');
61 79 }
62 80 }
63 -add_action('init', 'kadence_toolkit_flushpermalinks');
81 +add_action('init', 'virtue_toolkit_flushpermalinks');
82 +
83 +
84 +add_action( 'after_setup_theme', 'virtue_toolkit_add_in_slider_sections', 1);
85 +function virtue_toolkit_add_in_slider_sections() {
86 + $the_theme = wp_get_theme();
87 + // Ascend only
88 + if( $the_theme->get( 'Name' ) == 'Ascend' || $the_theme->get( 'Template') == 'ascend' ) {
89 +
90 + if ( ! class_exists( 'Redux' ) ) {
91 + return;
92 + }
93 + if(ReduxFramework::$_version <= '3.5.6') {
94 + return;
95 + }
96 +
97 + $options_slug = 'ascend';
98 + $home_header = Redux::getField($options_slug, 'home_header');
99 + if(is_array($home_header)){
100 + $hextras = array('basic' => __('Basic Slider', 'ascend'), 'basic_post_carousel' => __('Post Carousel', 'ascend'));
101 + $home_header['options'] = array_merge($hextras, $home_header['options']);
102 + }
103 + Redux::setField($options_slug, $home_header);
104 + }
105 +}
106 +
64 107
65 108