This commit is contained in:
Alexander Agnarson 2019-02-17 14:28:35 +01:00
parent b14ccb1b03
commit 7e3774b663
168 changed files with 2453 additions and 2788 deletions

View file

@ -5,8 +5,8 @@
* @package Kirki
* @category Modules
* @subpackage Custom Sections Module
* @author Aristeides Stathopoulos
* @copyright Copyright (c) 2017, Aristeides Stathopoulos
* @author Ari Stathopoulos (@aristath)
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.0
*/
@ -81,6 +81,7 @@ class Kirki_Modules_Custom_Sections {
'kirki-default' => 'Kirki_Sections_Default_Section',
'kirki-expanded' => 'Kirki_Sections_Expanded_Section',
'kirki-nested' => 'Kirki_Sections_Nested_Section',
'kirki-link' => 'Kirki_Sections_Link_Section',
);
return array_merge( $section_types, $new_types );
}
@ -116,12 +117,12 @@ class Kirki_Modules_Custom_Sections {
if ( ! class_exists( $class ) ) {
$path = wp_normalize_path( $folder_path . 'class-kirki-sections-' . $id . '-section.php' );
if ( file_exists( $path ) ) {
include_once $path;
include_once $path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
continue;
}
$path = str_replace( 'class-kirki-sections-kirki-', 'class-kirki-sections-', $path );
if ( file_exists( $path ) ) {
include_once $path;
include_once $path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
}
}
}
@ -134,12 +135,12 @@ class Kirki_Modules_Custom_Sections {
if ( ! class_exists( $class ) ) {
$path = wp_normalize_path( $folder_path . 'class-kirki-panels-' . $id . '-panel.php' );
if ( file_exists( $path ) ) {
include_once $path;
include_once $path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
continue;
}
$path = str_replace( 'class-kirki-panels-kirki-', 'class-kirki-panels-', $path );
if ( file_exists( $path ) ) {
include_once $path;
include_once $path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
}
}
}

View file

@ -4,7 +4,7 @@
*
* @package Kirki
* @subpackage Custom Sections Module
* @copyright Copyright (c) 2017, Aristeides Stathopoulos
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.0
*/
@ -41,7 +41,8 @@ class Kirki_Panels_Nested_Panel extends WP_Customize_Panel {
*/
public function json() {
$array = wp_array_slice_assoc(
(array) $this, array(
(array) $this,
array(
'id',
'description',
'priority',

View file

@ -1,26 +1,22 @@
#customize-theme-controls .control-section-kirki-expanded .accordion-section-title {
display: none;
}
display: none; }
#customize-theme-controls .control-section-kirki-expanded .customize-section-back {
display: none;
}
display: none; }
#customize-theme-controls .customize-pane-child.control-section-kirki-expanded {
position: relative;
visibility: visible;
height: auto;
margin-left: -100%;
}
#customize-theme-controls .customize-pane-child.control-section-kirki-expanded h3 .customize-action {
display: none;
}
margin-left: -100%; }
#customize-theme-controls .customize-pane-child.control-section-kirki-expanded h3 .customize-action {
display: none; }
#customize-theme-controls .control-section-kirki-link .button {
margin-top: -3px; }
#customize-theme-controls .customize-pane-child.current-section-parent,
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent {
transform: translateX(-100%);
}
transform: translateX(-100%); }
.control-section-kirki-nested {
margin: 0 -12px;
}
margin: 0 -12px; }
/*# sourceMappingURL=sections.css.map */

View file

@ -15,9 +15,20 @@ jQuery( document ).ready( function() {
}
} );
} );
/**
* See https://github.com/justintadlock/trt-customizer-pro
*/
( function() {
wp.customize.sectionConstructor['kirki-link'] = wp.customize.Section.extend( {
attachEvents: function() {},
isContextuallyActive: function() {
return true;
}
} );
} () );
/**
* @see https://wordpress.stackexchange.com/a/256103/17078
*/

View file

@ -4,7 +4,7 @@
*
* @package Kirki
* @subpackage Custom Sections Module
* @copyright Copyright (c) 2017, Aristeides Stathopoulos
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 2.2.0
*/

View file

@ -4,7 +4,7 @@
*
* @package Kirki
* @subpackage Custom Sections Module
* @copyright Copyright (c) 2017, Aristeides Stathopoulos
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 2.2.0
*/

View file

@ -0,0 +1,78 @@
<?php
/**
* The default section.
* Inspired from https://github.com/justintadlock/trt-customizer-pro
*
* @package Kirki
* @subpackage Custom Sections Module
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.36
*/
/**
* Link Section.
*/
class Kirki_Sections_Link_Section extends WP_Customize_Section {
/**
* The section type.
*
* @since 3.0.36
* @access public
* @var string
*/
public $type = 'kirki-link';
/**
* Button Text
*
* @since 3.0.36
* @access public
* @var string
*/
public $button_text = '';
/**
* Button URL.
*
* @since 3.0.36
* @access public
* @var string
*/
public $button_url = '';
/**
* Gather the parameters passed to client JavaScript via JSON.
*
* @access public
* @since 3.0.36
* @return array The array to be exported to the client as JSON.
*/
public function json() {
$json = parent::json();
$json['button_text'] = $this->button_text;
$json['button_url'] = esc_url( $this->button_url );
return $json;
}
/**
* Outputs the Underscore.js template.
*
* @since 3.0.36
* @access public
* @return void
*/
protected function render_template() {
?>
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
<h3 class="accordion-section-title">
{{ data.title }}
<a href="{{ data.button_url }}" class="button alignright" target="_blank" rel="nofollow">{{ data.button_text }}</a>
</h3>
</li>
<?php
}
}

View file

@ -4,7 +4,7 @@
*
* @package Kirki
* @subpackage Custom Sections Module
* @copyright Copyright (c) 2017, Aristeides Stathopoulos
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 2.2.0
*/
@ -41,7 +41,8 @@ class Kirki_Sections_Nested_Section extends WP_Customize_Section {
*/
public function json() {
$array = wp_array_slice_assoc(
(array) $this, array(
(array) $this,
array(
'id',
'description',
'priority',