feat: initial ACRIB WordPress deployment
- WordPress 6.9.4 (es_ES) with Kadence theme - Homepage: Hero, La Asociación, Pilares, Beneficios, Eventos, Miembros, Hazte Miembro, Contacto - Brand identity: #13294b navy, #a12932 burgundy, #c69c48 gold - Fonts: Raleway (headings) + Source Sans 3 (body) + Lato (UI) - Plugins: Kadence Blocks, Polylang, Contact Form 7 - Custom CSS with full brand styling and responsive layout - HTTPS enforced via wp-config.php proxy detection
This commit is contained in:
@@ -0,0 +1,438 @@
|
||||
<?php
|
||||
/**
|
||||
* Build Welcome Page with settings.
|
||||
*
|
||||
* @package Kadence
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build Welcome Page class
|
||||
*
|
||||
* @category class
|
||||
*/
|
||||
class Kadence_Dashboard_Settings {
|
||||
|
||||
/**
|
||||
* Settings of this class
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $settings = array();
|
||||
|
||||
/**
|
||||
* Instance of this class
|
||||
*
|
||||
* @var null
|
||||
*/
|
||||
private static $instance = null;
|
||||
/**
|
||||
* Static var active plugins
|
||||
*
|
||||
* @var $active_plugins
|
||||
*/
|
||||
private static $active_plugins;
|
||||
|
||||
/**
|
||||
* Instance Control
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
/**
|
||||
* Class Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
// only load if admin.
|
||||
if ( is_admin() ) {
|
||||
add_action( 'admin_menu', array( $this, 'add_menu' ) );
|
||||
$this->add_category_color();
|
||||
}
|
||||
add_action( 'init', array( $this, 'load_api_settings' ) );
|
||||
}
|
||||
/**
|
||||
* Redirect to the settings page on activation.
|
||||
*
|
||||
* @param string $key setting key.
|
||||
*/
|
||||
public static function get_data_options( $key ) {
|
||||
if ( ! isset( self::$settings[ $key ] ) ) {
|
||||
self::$settings[ $key ] = get_option( $key, array() );
|
||||
}
|
||||
return self::$settings[ $key ];
|
||||
}
|
||||
/**
|
||||
* Add option page menu
|
||||
*/
|
||||
public function add_menu() {
|
||||
$page = add_theme_page( __( 'Kadence - Next Generation Theme', 'kadence' ), __( 'Kadence', 'kadence' ), apply_filters( 'kadence_admin_settings_capability', 'manage_options' ), 'kadence', array( $this, 'config_page' ) );
|
||||
add_action( 'admin_print_styles-' . $page, array( $this, 'scripts' ) );
|
||||
do_action( 'kadence_theme_admin_menu' );
|
||||
}
|
||||
/**
|
||||
* Initialize getting the active plugins list.
|
||||
*/
|
||||
public static function get_active_plugins() {
|
||||
|
||||
self::$active_plugins = (array) get_option( 'active_plugins', array() );
|
||||
|
||||
if ( is_multisite() ) {
|
||||
self::$active_plugins = array_merge( self::$active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Active Plugin Check
|
||||
*
|
||||
* @param string $plugin_base_name is plugin folder/filename.php.
|
||||
*/
|
||||
public static function active_plugin_check( $plugin_base_name ) {
|
||||
|
||||
if ( ! self::$active_plugins ) {
|
||||
self::get_active_plugins();
|
||||
}
|
||||
return in_array( $plugin_base_name, self::$active_plugins, true ) || array_key_exists( $plugin_base_name, self::$active_plugins );
|
||||
}
|
||||
/**
|
||||
* Loads admin style sheets and scripts
|
||||
*/
|
||||
public function scripts() {
|
||||
$installed_plugins = get_plugins();
|
||||
$button_label = esc_html__( 'Browse Kadence Starter Templates', 'kadence' );
|
||||
$data_action = '';
|
||||
if ( ! defined( 'KADENCE_STARTER_TEMPLATES_VERSION' ) ) {
|
||||
if ( ! isset( $installed_plugins['kadence-starter-templates/kadence-starter-templates.php'] ) ) {
|
||||
$button_label = esc_html__( 'Install Kadence Starter Templates', 'kadence' );
|
||||
$data_action = 'install';
|
||||
} elseif ( ! self::active_plugin_check( 'kadence-starter-templates/kadence-starter-templates.php' ) ) {
|
||||
$button_label = esc_html__( 'Activate Kadence Starter Templates', 'kadence' );
|
||||
$data_action = 'activate';
|
||||
}
|
||||
}
|
||||
wp_enqueue_style( 'kadence-dashboard', get_template_directory_uri() . '/inc/dashboard/react/dash-controls.min.css', array( 'wp-components' ), KADENCE_VERSION );
|
||||
wp_enqueue_script( 'kadence-dashboard', get_template_directory_uri() . '/assets/js/admin/dashboard.js', array( 'wp-i18n', 'wp-element', 'wp-plugins', 'wp-components', 'wp-api', 'wp-hooks', 'wp-edit-post', 'lodash', 'wp-block-library', 'wp-block-editor', 'wp-editor', 'jquery' ), KADENCE_VERSION, true );
|
||||
wp_localize_script(
|
||||
'kadence-dashboard',
|
||||
'kadenceDashboardParams',
|
||||
array(
|
||||
'adminURL' => esc_url( admin_url() ),
|
||||
'settings' => esc_attr( get_option( 'kadence_theme_config' ) ),
|
||||
'changelog' => $this->get_changelog(),
|
||||
'proChangelog' => ( class_exists( 'Kadence_Theme_Pro' ) ? $this->get_pro_changelog() : '' ),
|
||||
'starterTemplates' => ( defined( 'KADENCE_STARTER_TEMPLATES_VERSION' ) ? true : false ),
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'ajax_nonce' => wp_create_nonce( 'kadence-ajax-verification' ),
|
||||
'proURL' => esc_url( \Kadence\kadence()->get_pro_url( 'https://www.kadencewp.com/kadence-theme/premium/', 'https://www.kadencewp.com/kadence-theme/premium/', 'in-app', 'theme-dash' ) ),
|
||||
'status' => $data_action,
|
||||
'starterLabel' => $button_label,
|
||||
'starterImage' => esc_attr( get_template_directory_uri() . '/assets/images/starter-templates-banner.jpeg' ),
|
||||
'starterURL' => $this->get_starter_templates_link(),
|
||||
'videoImage' => esc_attr( get_template_directory_uri() . '/assets/images/getting-started-video.jpg' ),
|
||||
)
|
||||
);
|
||||
if ( function_exists( 'wp_set_script_translations' ) ) {
|
||||
wp_set_script_translations( 'kadence-dashboard', 'kadence' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Starter Templates Link
|
||||
*/
|
||||
public function get_starter_templates_link() {
|
||||
$config = get_option( 'kadence_starter_templates_config', '' );
|
||||
$use_site_assist = apply_filters( 'kadence_starter_site_assist_enabled', true );
|
||||
if ( ! empty( $config ) ) {
|
||||
$config = json_decode( $config, true );
|
||||
if ( isset( $config['siteAssist'] ) && 'disable' === $config['siteAssist'] ) {
|
||||
$use_site_assist = false;
|
||||
}
|
||||
}
|
||||
if ( $use_site_assist || class_exists( '\\KadenceWP\\KadenceBlocks\\StellarWP\\Uplink\\Register' ) ) {
|
||||
return admin_url( 'admin.php?page=kadence-starter-templates' );
|
||||
}
|
||||
return admin_url( 'themes.php?page=kadence-starter-templates' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Changelog ( Largely Borrowed From Neve Theme )
|
||||
*/
|
||||
public function get_changelog() {
|
||||
$changelog = array();
|
||||
$changelog_path = get_template_directory() . '/changelog.txt';
|
||||
if ( ! is_file( $changelog_path ) ) {
|
||||
return $changelog;
|
||||
}
|
||||
global $wp_filesystem;
|
||||
if ( ! is_object( $wp_filesystem ) ) {
|
||||
require_once ABSPATH . '/wp-admin/includes/file.php';
|
||||
WP_Filesystem();
|
||||
}
|
||||
|
||||
$changelog_string = $wp_filesystem->get_contents( $changelog_path );
|
||||
if ( is_wp_error( $changelog_string ) ) {
|
||||
return $changelog;
|
||||
}
|
||||
$changelog = explode( PHP_EOL, $changelog_string );
|
||||
$releases = [];
|
||||
foreach ( $changelog as $changelog_line ) {
|
||||
if ( empty( $changelog_line ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( substr( ltrim( $changelog_line ), 0, 2 ) === '==' ) {
|
||||
if ( isset( $release ) ) {
|
||||
$releases[] = $release;
|
||||
}
|
||||
$changelog_line = trim( str_replace( '=', '', $changelog_line ) );
|
||||
$release = array(
|
||||
'head' => $changelog_line,
|
||||
);
|
||||
} else {
|
||||
if ( preg_match( '/[*|-]?\s?(\[fix]|\[Fix]|fix|Fix)[:]?\s?\b/', $changelog_line ) ) {
|
||||
//$changelog_line = preg_replace( '/[*|-]?\s?(\[fix]|\[Fix]|fix|Fix)[:]?\s?\b/', '', $changelog_line );
|
||||
$changelog_line = trim( str_replace( [ '*', '-' ], '', $changelog_line ) );
|
||||
$release['fix'][] = $changelog_line;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( preg_match( '/[*|-]?\s?(\[add]|\[Add]|add|Add)[:]?\s?\b/', $changelog_line ) ) {
|
||||
//$changelog_line = preg_replace( '/[*|-]?\s?(\[add]|\[Add]|add|Add)[:]?\s?\b/', '', $changelog_line );
|
||||
$changelog_line = trim( str_replace( [ '*', '-' ], '', $changelog_line ) );
|
||||
$release['add'][] = $changelog_line;
|
||||
continue;
|
||||
}
|
||||
$changelog_line = trim( str_replace( [ '*', '-' ], '', $changelog_line ) );
|
||||
$release['update'][] = $changelog_line;
|
||||
}
|
||||
}
|
||||
return $releases;
|
||||
}
|
||||
/**
|
||||
* Get Changelog ( Largely Borrowed From Neve Theme )
|
||||
*/
|
||||
public function get_pro_changelog() {
|
||||
$changelog = array();
|
||||
if ( ! defined( 'KTP_PATH' ) ) {
|
||||
return $changelog;
|
||||
}
|
||||
$changelog_path = KTP_PATH . '/changelog.txt';
|
||||
if ( ! is_file( $changelog_path ) ) {
|
||||
return $changelog;
|
||||
}
|
||||
global $wp_filesystem;
|
||||
if ( ! is_object( $wp_filesystem ) ) {
|
||||
require_once ABSPATH . '/wp-admin/includes/file.php';
|
||||
WP_Filesystem();
|
||||
}
|
||||
|
||||
$changelog_string = $wp_filesystem->get_contents( $changelog_path );
|
||||
if ( is_wp_error( $changelog_string ) ) {
|
||||
return $changelog;
|
||||
}
|
||||
$changelog = explode( PHP_EOL, $changelog_string );
|
||||
$releases = [];
|
||||
foreach ( $changelog as $changelog_line ) {
|
||||
if ( empty( $changelog_line ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( substr( ltrim( $changelog_line ), 0, 2 ) === '==' ) {
|
||||
if ( isset( $release ) ) {
|
||||
$releases[] = $release;
|
||||
}
|
||||
$changelog_line = trim( str_replace( '=', '', $changelog_line ) );
|
||||
$release = array(
|
||||
'head' => $changelog_line,
|
||||
);
|
||||
} else {
|
||||
if ( preg_match( '/[*|-]?\s?(\[fix]|\[Fix]|fix|Fix)[:]?\s?\b/', $changelog_line ) ) {
|
||||
//$changelog_line = preg_replace( '/[*|-]?\s?(\[fix]|\[Fix]|fix|Fix)[:]?\s?\b/', '', $changelog_line );
|
||||
$changelog_line = trim( str_replace( [ '*', '-' ], '', $changelog_line ) );
|
||||
$release['fix'][] = $changelog_line;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( preg_match( '/[*|-]?\s?(\[add]|\[Add]|add|Add)[:]?\s?\b/', $changelog_line ) ) {
|
||||
//$changelog_line = preg_replace( '/[*|-]?\s?(\[add]|\[Add]|add|Add)[:]?\s?\b/', '', $changelog_line );
|
||||
$changelog_line = trim( str_replace( [ '*', '-' ], '', $changelog_line ) );
|
||||
$release['add'][] = $changelog_line;
|
||||
continue;
|
||||
}
|
||||
$changelog_line = trim( str_replace( [ '*', '-' ], '', $changelog_line ) );
|
||||
$release['update'][] = $changelog_line;
|
||||
}
|
||||
}
|
||||
return $releases;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register settings
|
||||
*/
|
||||
public function load_api_settings() {
|
||||
|
||||
register_setting(
|
||||
'kadence_theme_config',
|
||||
'kadence_theme_config',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => __( 'Config Kadence Modules', 'kadence' ),
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
'show_in_rest' => true,
|
||||
'default' => '',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads config page
|
||||
*/
|
||||
public function config_page() {
|
||||
?>
|
||||
<div class="kadence_theme_dash_head">
|
||||
<div class="kadence_theme_dash_head_container">
|
||||
<div class="kadence_theme_dash_logo">
|
||||
<img src="<?php echo esc_attr( apply_filters( 'kadence_theme_dashboard_logo', get_template_directory_uri() . '/assets/images/kadence-logo.png' ) ); ?>">
|
||||
</div>
|
||||
<div class="kadence_theme_dash_version">
|
||||
<span>
|
||||
<?php echo esc_html( KADENCE_VERSION ); ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrap kadence_theme_dash">
|
||||
<div class="kadence_theme_dashboard">
|
||||
<h2 class="notices" style="display:none;"></h2>
|
||||
<?php settings_errors(); ?>
|
||||
<div class="page-grid">
|
||||
<div class="kadence_theme_dashboard_main">
|
||||
</div>
|
||||
<div class="side-panel">
|
||||
<?php do_action( 'kadence_theme_dash_side_panel' ); ?>
|
||||
<div class="community-section sidebar-section components-panel">
|
||||
<div class="components-panel__body is-opened">
|
||||
<h2><?php esc_html_e( 'Web Creators Community', 'kadence' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Join our community of fellow kadence users creating effective websites! Share your site, ask a question and help others.', 'kadence' ); ?></p>
|
||||
<a href="https://www.facebook.com/groups/webcreatorcommunity" target="_blank" class="sidebar-link"><?php esc_html_e( 'Join our Facebook Group', 'kadence' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="support-section sidebar-section components-panel">
|
||||
<div class="components-panel__body is-opened">
|
||||
<h2><?php esc_html_e( 'Video Tutorials', 'kadence' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Want a guide? We have video tutorials to walk you through getting started.', 'kadence' ); ?></p>
|
||||
<a href="https://kadence-theme.com/learn-kadence/?utm_source=in-app&utm_medium=theme-dash&utm_campaign=videos" target="_blank" class="sidebar-link"><?php esc_html_e( 'Watch Videos', 'kadence' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="support-section sidebar-section components-panel">
|
||||
<div class="components-panel__body is-opened">
|
||||
<h2><?php esc_html_e( 'Documentation', 'kadence' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Need help? We have a knowledge base full of articles to get you started.', 'kadence' ); ?></p>
|
||||
<a href="<?php echo esc_url( \Kadence\kadence()->get_pro_url( 'https://www.kadencewp.com/help-center/knowledge-base/kadence-theme/', 'https://www.kadencewp.com/help-center/knowledge-base/kadence-theme/', 'in-app', 'theme-dash', 'docs' ) ); ?>" target="_blank" class="sidebar-link"><?php esc_html_e( 'Browse Docs', 'kadence' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="support-section sidebar-section components-panel">
|
||||
<div class="components-panel__body is-opened">
|
||||
<h2><?php esc_html_e( 'Support', 'kadence' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Have a question, we are happy to help! Get in touch with our support team.', 'kadence' ); ?></p>
|
||||
<a href="https://www.kadencewp.com/free-support/?utm_source=in-app&utm_medium=theme-dash&utm_campaign=help" target="_blank" class="sidebar-link"><?php esc_html_e( 'Submit a Ticket', 'kadence' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
private function add_category_color() {
|
||||
// Enqueue the color picker script and styles
|
||||
add_action('admin_enqueue_scripts', function ($hook_suffix) {
|
||||
if ($hook_suffix === 'edit-tags.php' || $hook_suffix === 'term.php' || $hook_suffix === 'edit-category') {
|
||||
// Add the color picker CSS and JS
|
||||
wp_enqueue_style('wp-color-picker');
|
||||
wp_enqueue_script('custom-color-picker', get_stylesheet_directory_uri() . '/assets/js/custom-color-picker.min.js', ['wp-color-picker', 'jquery'], false, true);
|
||||
}
|
||||
});
|
||||
|
||||
// Add the color picker to the 'Add New Category' screen
|
||||
add_action('category_add_form_fields', function ($taxonomy) {
|
||||
?>
|
||||
<div class="form-field">
|
||||
<label for="archive_category_color"><?php esc_html_e('Archive Color', 'kadence'); ?></label>
|
||||
<input type="text" name="archive_category_color" id="archive_category_color" class="color-field" value="" />
|
||||
<p class="description"><?php esc_html_e('Color for the archive category label.', 'kadence'); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
});
|
||||
|
||||
// Add the color picker to the 'Edit Category' screen
|
||||
add_action('category_edit_form_fields', function ($term) {
|
||||
$value = get_term_meta($term->term_id, 'archive_category_color', true); // Get the current color value
|
||||
?>
|
||||
<tr class="form-field">
|
||||
<th scope="row">
|
||||
<label for="archive_category_color"><?php esc_html_e('Archive Color', 'kadence'); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text" name="archive_category_color" id="archive_category_color" class="color-field" value="<?php echo esc_attr($value); ?>" />
|
||||
<p class="description"><?php esc_html_e('Color for the archive category label.', 'kadence'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
});
|
||||
|
||||
// Save the selected color when creating a new category
|
||||
add_action('create_category', function ($term_id) {
|
||||
if (isset($_POST['archive_category_color'])) {
|
||||
// Validate and update color value
|
||||
update_term_meta($term_id, 'archive_category_color', sanitize_hex_color($_POST['archive_category_color']));
|
||||
}
|
||||
if (isset($_POST['archive_category_hover_color'])) {
|
||||
// Validate and update hover color value
|
||||
update_term_meta($term_id, 'archive_category_hover_color', sanitize_hex_color($_POST['archive_category_hover_color']));
|
||||
}
|
||||
});
|
||||
|
||||
// Save the selected color when editing an existing category
|
||||
add_action('edited_category', function ($term_id) {
|
||||
if (isset($_POST['archive_category_color'])) {
|
||||
// Validate and update color value
|
||||
update_term_meta($term_id, 'archive_category_color', sanitize_hex_color($_POST['archive_category_color']));
|
||||
}
|
||||
if (isset($_POST['archive_category_hover_color'])) {
|
||||
// Validate and update hover color value
|
||||
update_term_meta($term_id, 'archive_category_hover_color', sanitize_hex_color($_POST['archive_category_hover_color']));
|
||||
}
|
||||
});
|
||||
|
||||
// Add the hover color picker to the 'Add New Category' screen
|
||||
add_action('category_add_form_fields', function ($taxonomy) {
|
||||
?>
|
||||
<div class="form-field">
|
||||
<label for="archive_category_hover_color"><?php esc_html_e('Archive Hover Color', 'kadence'); ?></label>
|
||||
<input type="text" name="archive_category_hover_color" id="archive_category_hover_color" class="color-field" value="" />
|
||||
<p class="description"><?php esc_html_e('Hover color for the archive category label.', 'kadence'); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
});
|
||||
// Add the hover color picker to the 'Edit Category' screen
|
||||
add_action('category_edit_form_fields', function ($term) {
|
||||
$hover_value = get_term_meta($term->term_id, 'archive_category_hover_color', true); // Get the current hover color value
|
||||
?>
|
||||
<tr class="form-field">
|
||||
<th scope="row">
|
||||
<label for="archive_category_hover_color"><?php esc_html_e('Archive Hover Color', 'kadence'); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text" name="archive_category_hover_color" id="archive_category_hover_color" class="color-field" value="<?php echo esc_attr($hover_value); ?>" />
|
||||
<p class="description"><?php esc_html_e('Hover color for the archive category label.', 'kadence'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
});
|
||||
}
|
||||
}
|
||||
Kadence_Dashboard_Settings::get_instance();
|
||||
1
wp-content/themes/kadence/inc/dashboard/react/dash-controls.min.css
vendored
Normal file
1
wp-content/themes/kadence/inc/dashboard/react/dash-controls.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
const { Fragment } = wp.element;
|
||||
const { withFilters } = wp.components;
|
||||
|
||||
export const ChangelogItem = ( version ) => {
|
||||
return (
|
||||
<div className="changelog-version">
|
||||
<h3 className="version-head">{ version.item.head }</h3>
|
||||
{ version.item.add && (
|
||||
<Fragment>
|
||||
{ version.item.add.map( ( adds, index ) => {
|
||||
return <div className="version-add">{ adds }</div>;
|
||||
} ) }
|
||||
</Fragment>
|
||||
) }
|
||||
{ version.item.update && (
|
||||
<Fragment>
|
||||
{ version.item.update.map( ( updates, index ) => {
|
||||
return <div className="version-update">{ updates }</div>;
|
||||
} ) }
|
||||
</Fragment>
|
||||
) }
|
||||
{ version.item.fix && (
|
||||
<Fragment>
|
||||
{ version.item.fix.map( ( fixes, index ) => {
|
||||
return <div className="version-fix">{ fixes }</div>;
|
||||
} ) }
|
||||
</Fragment>
|
||||
) }
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default withFilters( 'kadence_theme_changelog' )( ChangelogItem );
|
||||
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
const { Fragment } = wp.element;
|
||||
const { withFilters } = wp.components;
|
||||
const { TabPanel, Panel, PanelBody } = wp.components;
|
||||
import ChangelogItem from './changelog-item';
|
||||
|
||||
export const ChangelogTab = () => {
|
||||
const tabs = [
|
||||
{
|
||||
name: 'kadence',
|
||||
title: __( 'Changelog', 'kadence' ),
|
||||
className: 'kadence-changelog-tab',
|
||||
},
|
||||
{
|
||||
name: 'pro',
|
||||
title: __( 'Pro Changelog', 'kadence' ),
|
||||
className: 'kadence-pro-changelog-tab',
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
{ kadenceDashboardParams.changelog && (
|
||||
<Fragment>
|
||||
{ kadenceDashboardParams.proChangelog && kadenceDashboardParams.proChangelog.length && (
|
||||
<TabPanel className="kadence-dashboard-changelog-tab-panel"
|
||||
activeClass="active-tab"
|
||||
tabs={ tabs }>
|
||||
{
|
||||
( tab ) => {
|
||||
switch ( tab.name ) {
|
||||
case 'kadence':
|
||||
return (
|
||||
<Panel className="kadence-changelog-section tab-section">
|
||||
<PanelBody
|
||||
opened={ true }
|
||||
>
|
||||
{ kadenceDashboardParams.changelog.map( ( item, index ) => {
|
||||
return <ChangelogItem
|
||||
item={ item }
|
||||
index={ item }
|
||||
/>;
|
||||
} ) }
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
);
|
||||
|
||||
case 'pro':
|
||||
return (
|
||||
<Panel className="pro-changelog-section tab-section">
|
||||
<PanelBody
|
||||
opened={ true }
|
||||
>
|
||||
{ kadenceDashboardParams.proChangelog.map( ( item, index ) => {
|
||||
return <ChangelogItem
|
||||
item={ item }
|
||||
index={ item }
|
||||
/>;
|
||||
} ) }
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
</TabPanel>
|
||||
) }
|
||||
{ ( '' == kadenceDashboardParams.proChangelog || ( Array.isArray( kadenceDashboardParams.proChangelog ) && ! kadenceDashboardParams.proChangelog.length ) ) && (
|
||||
<Fragment>
|
||||
{ kadenceDashboardParams.changelog.map( ( item, index ) => {
|
||||
return <ChangelogItem
|
||||
item={ item }
|
||||
index={ item }
|
||||
/>;
|
||||
} ) }
|
||||
</Fragment>
|
||||
) }
|
||||
</Fragment>
|
||||
) }
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default withFilters( 'kadence_theme_changelog' )( ChangelogTab );
|
||||
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
const { Fragment } = wp.element;
|
||||
import map from 'lodash/map';
|
||||
const { withFilters, TabPanel, Panel, PanelBody, PanelRow, Button } = wp.components;
|
||||
|
||||
export const CustomizerLinks = () => {
|
||||
const headerLinks = [
|
||||
{
|
||||
title: __( 'Global Colors', 'kadence' ),
|
||||
description: __( 'Setup the base color scheme for your site.', 'kadence' ),
|
||||
focus: 'kadence_customizer_general_colors',
|
||||
type: 'section',
|
||||
setting: false
|
||||
},
|
||||
{
|
||||
title: __( 'Branding', 'kadence' ),
|
||||
description: __( 'Upload your logo and favicon.', 'kadence' ),
|
||||
focus: 'title_tagline',
|
||||
type: 'section',
|
||||
setting: false
|
||||
},
|
||||
{
|
||||
title: __( 'Typography', 'kadence' ),
|
||||
description: __( 'Choose the perfect font family, style and sizes.', 'kadence' ),
|
||||
focus: 'kadence_customizer_general_typography',
|
||||
type: 'section',
|
||||
setting: false
|
||||
},
|
||||
{
|
||||
title: __( 'Header Layout', 'kadence' ),
|
||||
description: __( 'Add elements and arrange them how you want.', 'kadence' ),
|
||||
focus: 'kadence_customizer_header',
|
||||
type: 'panel',
|
||||
setting: false
|
||||
},
|
||||
{
|
||||
title: __( 'Page Layout', 'kadence' ),
|
||||
description: __( 'Define your sites general page look and feel for page title, and content style.', 'kadence' ),
|
||||
focus: 'kadence_customizer_page_layout',
|
||||
type: 'section',
|
||||
setting: false
|
||||
},
|
||||
{
|
||||
title: __( 'Footer Layout', 'kadence' ),
|
||||
description: __( 'Customize the columns and place widget areas in unlimited configurations', 'kadence' ),
|
||||
focus: 'kadence_customizer_footer_layout',
|
||||
type: 'section',
|
||||
setting: false
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<h2 className="section-header">{ __( 'Customize Your Site', 'kadence' ) }</h2>
|
||||
<div className="two-col-grid">
|
||||
{ map( headerLinks, ( link ) => {
|
||||
return (
|
||||
<div className="link-item">
|
||||
<h4>{ link.title }</h4>
|
||||
<p>{ link.description }</p>
|
||||
<div className="link-item-foot">
|
||||
<a href={ `${kadenceDashboardParams.adminURL}customize.php?autofocus%5B${ link.type }%5D=${ link.focus }` }>
|
||||
{ __( 'Customize', 'kadence') }
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
} ) }
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default withFilters( 'kadence_theme_customizer' )( CustomizerLinks );
|
||||
@@ -0,0 +1,282 @@
|
||||
$color-primary: #007cba;
|
||||
$color-gray-200: #EDF2F7;
|
||||
$color-gray-300: #E2E8F0;
|
||||
$color-gray-400: #CBD5E0;
|
||||
$color-gray-500: #A0AEC0;
|
||||
$color-gray-600: #718096;
|
||||
$color-gray-700: #4A5568;
|
||||
$color-gray-800: #2D3748;
|
||||
.appearance_page_kadence #wpcontent {
|
||||
padding: 0;
|
||||
}
|
||||
.kadence_theme_dash_head {
|
||||
background: white;
|
||||
padding: 10px;
|
||||
height: 50px;
|
||||
h1 {
|
||||
color: $color-gray-800;
|
||||
line-height: 50px;
|
||||
padding:0;
|
||||
height: 50px;
|
||||
margin:0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.subtext {
|
||||
font-size: 16px;
|
||||
color: $color-gray-600;
|
||||
display: inline-block;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.kadence_theme_dash_head_container {
|
||||
margin: 0 auto;
|
||||
max-width: 1260px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.kadence_theme_dash_logo{
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
padding-right: 10px;
|
||||
img {
|
||||
width: 50px;
|
||||
}
|
||||
}
|
||||
.kadence_theme_dash_version {
|
||||
flex-grow: 1;
|
||||
text-align: right;
|
||||
}
|
||||
.kadence_theme_dash_version span {
|
||||
padding: 5px;
|
||||
background: $color-gray-700;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
.wrap.kadence_theme_dash {
|
||||
margin: 20px 20px 0;
|
||||
}
|
||||
.kadence_theme_dashboard {
|
||||
margin: 0 auto;
|
||||
max-width: 1260px;
|
||||
}
|
||||
.page-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 260px;
|
||||
grid-gap: 3em;
|
||||
}
|
||||
.sidebar-section .components-panel__body.is-opened {
|
||||
padding: 20px;
|
||||
}
|
||||
.sidebar-section h2:first-child, .tab-section h2:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.side-panel .components-panel+.components-panel {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.tab-section .components-panel__body.is-opened {
|
||||
padding: 25px;
|
||||
}
|
||||
.kadence-dashboard-tab-panel {
|
||||
.components-tab-panel__tabs {
|
||||
.components-button {
|
||||
border: 1px solid transparent;
|
||||
background: transparent;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
cursor: pointer;
|
||||
height: 48px;
|
||||
padding: 3px 16px;
|
||||
margin-left: 0;
|
||||
font-weight: 500;
|
||||
&:hover {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
&:not(.active-tab):hover {
|
||||
color: $color-primary !important;
|
||||
background: transparent !important;;
|
||||
}
|
||||
}
|
||||
.components-button.active-tab {
|
||||
background: white;
|
||||
border: 1px solid #e2e4e7;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
}
|
||||
.components-tab-panel__tabs {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
}
|
||||
.two-col-grid {
|
||||
display: grid;
|
||||
grid-gap: 1rem;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
h3.section-sub-head {
|
||||
background: $color-gray-200;
|
||||
padding: 10px;
|
||||
color: $color-gray-700;
|
||||
font-size: 14px;
|
||||
text-transform: uppercase;
|
||||
margin-bottom:1rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
.link-item {
|
||||
border: 1px solid $color-gray-300;
|
||||
padding: 20px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
}
|
||||
.link-item h4 {
|
||||
margin: 0;
|
||||
}
|
||||
.dashboard-pro-settings {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
.link-item .link-item-foot {
|
||||
margin-top: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.components-spinner {
|
||||
margin-top: 0;
|
||||
}
|
||||
.components-toggle-control .components-base-control__field {
|
||||
margin-bottom: 0;
|
||||
.components-form-toggle {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.link-item .link-item-foot > *:first-child {
|
||||
flex-grow: 2;
|
||||
}
|
||||
.link-item a {
|
||||
display: block;
|
||||
background: transparent;
|
||||
color: $color-gray-700;
|
||||
&:hover {
|
||||
color:$color-primary;
|
||||
}
|
||||
}
|
||||
span.kt-license-status {
|
||||
padding: 4px;
|
||||
margin-left: 10px;
|
||||
font-size: 14px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
span.kt-license-status.k-inactive {
|
||||
color: #c05621!important;
|
||||
background: #fffaf0!important;
|
||||
}
|
||||
span.kt-license-status.k-active {
|
||||
color: #2b6cb0!important;
|
||||
background: #ebf8ff!important;
|
||||
}
|
||||
.license-section h2 {
|
||||
display: flex;
|
||||
margin-top: 0;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.license-section table.form-table {
|
||||
display: block;
|
||||
}
|
||||
.license-section table.form-table tbody {
|
||||
display: block;
|
||||
}
|
||||
.license-section table.form-table td, .license-section table.form-table tr {
|
||||
display: block;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.license-section .form-table th {
|
||||
padding:0;
|
||||
width: 100%;
|
||||
margin-bottom: 4px;
|
||||
display: block;
|
||||
color: $color-gray-700;
|
||||
}
|
||||
.license-section p.submit {
|
||||
padding: 0;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.license-section table.form-table input[type="text"] {
|
||||
width:100%;
|
||||
}
|
||||
.kadence-desk-help-inner {
|
||||
max-width: 600px;
|
||||
margin: 20px auto;
|
||||
text-align: center;
|
||||
}
|
||||
.kadence_theme_dashboard_main .kadence-desk-button {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 10px;
|
||||
display: inline-block;
|
||||
padding: 10px 12px;
|
||||
background: #005ab3;
|
||||
border-radius: 3px;
|
||||
font-size: 17px;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
transition: all .2s ease;
|
||||
border: 2px solid #005ab3;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.kadence_theme_dashboard_main .kadence-desk-button:hover {
|
||||
background: #0073e6;
|
||||
border-color: #0073e6;
|
||||
}
|
||||
.kadence_theme_dashboard_main .kadence-desk-button.kadence-desk-button-second {
|
||||
margin-left: 30px;
|
||||
border: 2px solid #005ab3;
|
||||
color: #005ab3;
|
||||
background: transparent;
|
||||
}
|
||||
.kadence_theme_dashboard_main .kadence-desk-button.kadence-desk-button-second:hover {
|
||||
border: 2px solid#0073e6;
|
||||
color: #0073e6;
|
||||
background: transparent;
|
||||
}
|
||||
.kadence_theme_dashboard_main .kadence-desk-button .components-spinner {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
margin: 0 0 -2px 10px;
|
||||
}
|
||||
.kadence-desk-help-inner h2, .kadence-desk-starter-inner h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
.kadence-desk-starter-inner p {
|
||||
max-width: 600px;
|
||||
margin: 1em auto;
|
||||
}
|
||||
.kadence-desk-help-inner .video-container {
|
||||
margin-top: 2em;
|
||||
}
|
||||
.changelog-version {
|
||||
padding: 2em;
|
||||
margin-bottom: 2em;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
.dashboard-pro-settings .link-item.locked-item {
|
||||
background: #fbfdff;
|
||||
position: relative;
|
||||
}
|
||||
.link-item.locked-item .lock-icon svg {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
fill: #acb4bf;
|
||||
}
|
||||
.link-item.locked-item .lock-icon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 25px;
|
||||
}
|
||||
.kadence-desk-help-inner .video-container img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
21
wp-content/themes/kadence/inc/dashboard/react/src/help.js
Normal file
21
wp-content/themes/kadence/inc/dashboard/react/src/help.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
const { Fragment } = wp.element;
|
||||
const { withFilters } = wp.components;
|
||||
|
||||
export const HelpTab = () => {
|
||||
return (
|
||||
<div className="kadence-desk-help-inner">
|
||||
<h2>{ __( 'Welcome to Kadence!', 'kadence' ) }</h2>
|
||||
<p>{ __( 'You are going to love working with this theme! View the video below to get started with our video tutorials or click the view knowledge base button below to see all the documentation.', 'kadence' ) }</p>
|
||||
<div className="video-container">
|
||||
<a href="https://www.youtube.com/watch?v=GqEecMF7WtE"><img width="1280" height="720" src={ kadenceDashboardParams.videoImage } alt={ __( 'Kadence Theme Getting Started Tutorial - 10 Minute Quick Start Guide', 'kadence' ) } /></a>
|
||||
</div>
|
||||
<a href="https://kadence-theme.com/learn-kadence" className="kadence-desk-button" target="_blank">{ __( 'Video Tutorials', 'kadence' ) }</a><a href="https://kadence-theme.com/knowledge-base/" className="kadence-desk-button kadence-desk-button-second" target="_blank">{ __( 'View Knowledge Base', 'kadence' ) }</a>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default withFilters( 'kadence_theme_help' )( HelpTab );
|
||||
142
wp-content/themes/kadence/inc/dashboard/react/src/index.js
Normal file
142
wp-content/themes/kadence/inc/dashboard/react/src/index.js
Normal file
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import HelpTab from './help';
|
||||
import ChangelogTab from './changelog';
|
||||
import ProSettings from './pro-extension';
|
||||
import RecommendedTab from './recomended';
|
||||
import StarterTab from './starter';
|
||||
import Sidebar from './sidebar';
|
||||
import CustomizerLinks from './customizer';
|
||||
import Notices from './notices';
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import { __, sprintf } from '@wordpress/i18n';
|
||||
import { Fragment, Component, createRoot } from '@wordpress/element';
|
||||
import { TabPanel, Panel, PanelBody, PanelRow, Button } from '@wordpress/components';
|
||||
|
||||
class KadenceDashboard extends Component {
|
||||
render() {
|
||||
const tabs = [
|
||||
{
|
||||
name: 'dashboard',
|
||||
title: __( 'Dashboard', 'kadence' ),
|
||||
className: 'kadence-dash-tab',
|
||||
},
|
||||
{
|
||||
name: 'help',
|
||||
title: __( 'Getting Started', 'kadence' ),
|
||||
className: 'kadence-help-tab',
|
||||
},
|
||||
{
|
||||
name: 'changelog',
|
||||
title: __( 'Changelog', 'kadence' ),
|
||||
className: 'kadence-changelog-tab',
|
||||
},
|
||||
// {
|
||||
// name: 'recommended',
|
||||
// title: __( 'Recommended Plugins', 'kadence' ),
|
||||
// className: 'kadence-recommended-tab',
|
||||
// },
|
||||
{
|
||||
name: 'starter',
|
||||
title: __( 'Starter Templates', 'kadence' ),
|
||||
className: 'kadence-starter-tab',
|
||||
},
|
||||
];
|
||||
|
||||
const KadenceDashTabPanel = () => (
|
||||
<TabPanel className="kadence-dashboard-tab-panel"
|
||||
activeClass="active-tab"
|
||||
tabs={ tabs }>
|
||||
{
|
||||
( tab ) => {
|
||||
switch ( tab.name ) {
|
||||
case 'dashboard':
|
||||
return (
|
||||
<Panel className="dashboard-section tab-section">
|
||||
<PanelBody
|
||||
opened={ true }
|
||||
>
|
||||
<div className="dashboard-modules-wrapper">
|
||||
<div className="dashboard-customizer-settings">
|
||||
<CustomizerLinks />
|
||||
</div>
|
||||
<div className="dashboard-pro-settings">
|
||||
<ProSettings />
|
||||
</div>
|
||||
</div>
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
);
|
||||
|
||||
case 'help':
|
||||
return (
|
||||
<Panel className="help-section tab-section">
|
||||
<PanelBody
|
||||
opened={ true }
|
||||
>
|
||||
<HelpTab />
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
);
|
||||
case 'changelog':
|
||||
return (
|
||||
<Panel className="changelog-section tab-section">
|
||||
<PanelBody
|
||||
opened={ true }
|
||||
>
|
||||
<ChangelogTab />
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
);
|
||||
|
||||
case 'recommended':
|
||||
return (
|
||||
<Panel className="recommended-section tab-section">
|
||||
<PanelBody
|
||||
opened={ true }
|
||||
>
|
||||
<RecommendedTab />
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
);
|
||||
|
||||
case 'starter':
|
||||
return (
|
||||
<Panel className="starter-section tab-section">
|
||||
<PanelBody
|
||||
opened={ true }
|
||||
>
|
||||
<StarterTab />
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
</TabPanel>
|
||||
);
|
||||
|
||||
const MainPanel = () => (
|
||||
<div className="tab-panel">
|
||||
<KadenceDashTabPanel />
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<MainPanel />
|
||||
<Notices />
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
wp.domReady( () => {
|
||||
const container = document.querySelector( '.kadence_theme_dashboard_main' );
|
||||
const root = createRoot( container );
|
||||
|
||||
root.render(<KadenceDashboard />);
|
||||
} );
|
||||
23
wp-content/themes/kadence/inc/dashboard/react/src/notices.js
Normal file
23
wp-content/themes/kadence/inc/dashboard/react/src/notices.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
const { useSelect, useDispatch } = wp.data;
|
||||
const { SnackbarList } = wp.components;
|
||||
|
||||
export default function Notices() {
|
||||
const notices = useSelect(
|
||||
( select ) =>
|
||||
select( 'core/notices' )
|
||||
.getNotices()
|
||||
.filter( ( notice ) => notice.type === 'snackbar' ),
|
||||
[]
|
||||
);
|
||||
const { removeNotice } = useDispatch( 'core/notices' );
|
||||
return (
|
||||
<SnackbarList
|
||||
className="components-editor-notices__snackbar"
|
||||
notices={ notices }
|
||||
onRemove={ removeNotice }
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { withFilters } from '@wordpress/components';
|
||||
const lockIcon = <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
|
||||
<path d="M34 23h-2v-4c0-3.9-3.1-7-7-7s-7 3.1-7 7v4h-2v-4c0-5 4-9 9-9s9 4 9 9v4z"></path>
|
||||
<path d="M33 40H17c-1.7 0-3-1.3-3-3V25c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v12c0 1.7-1.3 3-3 3zM17 24c-.6 0-1 .4-1 1v12c0 .6.4 1 1 1h16c.6 0 1-.4 1-1V25c0-.6-.4-1-1-1H17z"></path>
|
||||
<circle cx="25" cy="28" r="2"></circle>
|
||||
<path d="M25.5 28h-1l-1 6h3z"></path>
|
||||
</svg>;
|
||||
/**
|
||||
* Internal block libraries
|
||||
*/
|
||||
import map from 'lodash/map';
|
||||
|
||||
export const ProModules = () => {
|
||||
const proLinks = [
|
||||
{
|
||||
title: __( 'Header Addons', 'kadence' ),
|
||||
description: __( 'Adds 19 elements to the header builder.', 'kadence' ),
|
||||
setting: 'header_addon',
|
||||
},
|
||||
{
|
||||
title: __( 'Conditional Headers', 'kadence' ),
|
||||
description: __( 'Build Extra Headers to display conditionally.', 'kadence' ),
|
||||
setting: 'conditional_headers',
|
||||
},
|
||||
{
|
||||
title: __( 'Ultimate Menu', 'kadence' ),
|
||||
description: __( 'Adds menu options for mega menus, highlight tags, icons and more.', 'kadence' ),
|
||||
setting: 'mega_menu',
|
||||
},
|
||||
{
|
||||
title: __( 'Header/Footer Scripts', 'kadence' ),
|
||||
description: __( 'Adds Options into the customizer to add header and footer scripts', 'kadence' ),
|
||||
setting: 'scripts',
|
||||
},
|
||||
{
|
||||
title: __( 'Hooked Elements', 'kadence' ),
|
||||
description: __( 'Add content anywhere into your site conditionally.', 'kadence' ),
|
||||
setting: 'hooks',
|
||||
},
|
||||
{
|
||||
title: __( 'WooCommerce Addons', 'kadence' ),
|
||||
description: __( 'Adds new options into the customizer for WooCommerce stores.', 'kadence' ),
|
||||
setting: 'woocommerce',
|
||||
},
|
||||
{
|
||||
title: __( 'Infinite Scroll', 'kadence' ),
|
||||
description: __( 'Adds Infinite Scroll for archives.', 'kadence' ),
|
||||
setting: 'infinite_scroll',
|
||||
},
|
||||
{
|
||||
title: __( 'Color Palette Switch (Dark Mode)', 'kadence' ),
|
||||
description: __( 'Adds a color palette switch so you can create a "dark" mode for your website.', 'kadence' ),
|
||||
setting: 'dark_mode',
|
||||
},
|
||||
{
|
||||
title: __( 'Local Gravatars', 'kadence' ),
|
||||
description: __( 'Loads Gravatars from your servers to improve site performance.', 'kadence' ),
|
||||
setting: 'local_gravatars',
|
||||
},
|
||||
{
|
||||
title: __( 'Archive Custom Page Title Backgrounds', 'kadence' ),
|
||||
description: __( 'Allows you to assign a custom image for a taxonomy background.', 'kadence' ),
|
||||
setting: 'archive_custom',
|
||||
},
|
||||
];
|
||||
return (
|
||||
<>
|
||||
<h2 className="section-header">{ __( 'Do more with the Kadence Pro Addon', 'kadence' ) }</h2>
|
||||
<div className="two-col-grid">
|
||||
{ map( proLinks, ( link ) => {
|
||||
return (
|
||||
<div className="link-item locked-item">
|
||||
<span className="lock-icon">{ lockIcon }</span>
|
||||
<h4>{ link.title }</h4>
|
||||
<p>{ link.description }</p>
|
||||
<div className="link-item-foot">
|
||||
<a href={ `${kadenceDashboardParams.proURL}&utm_campaign=${ link.setting }` } target="_blank">
|
||||
{ __( 'Learn More', 'kadence') }
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
} ) }
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default withFilters( 'kadence_theme_pro_modules' )( ProModules );
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
const { Fragment } = wp.element;
|
||||
|
||||
export const RecommendedTab = () => {
|
||||
return (
|
||||
<Fragment>
|
||||
<p>{ __( 'This area is for Recommended Plugins.', 'kadence' ) }</p>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default RecommendedTab;
|
||||
32
wp-content/themes/kadence/inc/dashboard/react/src/sidebar.js
Normal file
32
wp-content/themes/kadence/inc/dashboard/react/src/sidebar.js
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
const { Fragment } = wp.element;
|
||||
const { withFilters, TabPanel, Panel, PanelBody, PanelRow, Button } = wp.components;
|
||||
export const Sidebar = () => {
|
||||
return (
|
||||
<Fragment>
|
||||
<Panel className="community-section sidebar-section">
|
||||
<PanelBody
|
||||
opened={ true }
|
||||
>
|
||||
<h2>{ __( 'Web Creators Community', 'kadence' ) }</h2>
|
||||
<p>{ __( 'Join our community of fellow kadence users creating effective websites! Share your site, ask a question and help others.', 'kadence' ) }</p>
|
||||
<a href="https://www.facebook.com/groups/webcreatorcommunity" target="_blank" class="sidebar-link">{ __( 'Join our Facebook Group', 'kadence' ) }</a>
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
<Panel className="support-section sidebar-section">
|
||||
<PanelBody
|
||||
opened={ true }
|
||||
>
|
||||
<h2>{ __( 'Support', 'kadence' ) }</h2>
|
||||
<p>{ __( 'Have a question, we are happy to help! Get in touch with our support team.', 'kadence' ) }</p>
|
||||
<a href="https://www.kadencewp.com/free-support/" target="_blank" class="sidebar-link">{ __( 'Submit a Ticket', 'kadence' ) }</a>
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default withFilters( 'kadence_theme_sidebar' )( Sidebar );
|
||||
72
wp-content/themes/kadence/inc/dashboard/react/src/starter.js
Normal file
72
wp-content/themes/kadence/inc/dashboard/react/src/starter.js
Normal file
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* Activate a plugin
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function kadence_starter_activatePlugin() {
|
||||
var data = new FormData();
|
||||
data.append( 'action', 'kadence_install_starter' );
|
||||
data.append( 'security', kadenceDashboardParams.ajax_nonce );
|
||||
data.append( 'status', kadenceDashboardParams.status );
|
||||
jQuery.ajax({
|
||||
method: 'POST',
|
||||
url: kadenceDashboardParams.ajax_url,
|
||||
data: data,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
})
|
||||
.done( function( response, status, stately ) {
|
||||
if ( response.success ) {
|
||||
location.replace( kadenceDashboardParams.starterURL );
|
||||
}
|
||||
})
|
||||
.fail( function( error ) {
|
||||
console.log( error );
|
||||
});
|
||||
}
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { useState, useEffect, Fragment } from '@wordpress/element';
|
||||
const { withFilters, TabPanel, Panel, PanelBody, PanelRow, Button, Spinner } = wp.components;
|
||||
export const StarterTab = () => {
|
||||
const [ working, setWorking ] = useState( null );
|
||||
const handleClick = () => {
|
||||
setWorking( true );
|
||||
kadence_starter_activatePlugin();
|
||||
};
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="kadence-desk-starter-inner" style={{ margin: '20px auto', textAlign:'center' }}>
|
||||
<h2>{ __( 'Starter Templates', 'kadence' ) }</h2>
|
||||
<p>{ __( 'Create and customize professionally designed websites in minutes. Simply choose your template, choose your colors, and import. Done!', 'kadence' ) }</p>
|
||||
<div className="image-container">
|
||||
<img width="772" height="250" alt={ __( 'Starter Templates', 'kadence' ) } src={ kadenceDashboardParams.starterImage } />
|
||||
</div>
|
||||
{ kadenceDashboardParams.starterTemplates && (
|
||||
<a
|
||||
className="kt-action-starter kadence-desk-button"
|
||||
href={ kadenceDashboardParams.starterURL }
|
||||
>
|
||||
{ kadenceDashboardParams.starterLabel }
|
||||
</a>
|
||||
) }
|
||||
{ ! kadenceDashboardParams.starterTemplates && (
|
||||
<Button
|
||||
className="kt-action-starter kadence-desk-button"
|
||||
onClick={ () => handleClick() }
|
||||
>
|
||||
{ kadenceDashboardParams.starterLabel }
|
||||
{ working && (
|
||||
<Spinner />
|
||||
) }
|
||||
</Button>
|
||||
|
||||
) }
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default withFilters( 'kadence_theme_starters' )( StarterTab );
|
||||
Reference in New Issue
Block a user