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:
Malin
2026-05-19 19:25:59 +02:00
commit f3ff7b7186
6119 changed files with 1984255 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
<?php
/**
* Backward-compatibility functions for when theme requirements are not met
*
* This file must be parseable by PHP 5.2.
*
* @package kadence
*/
/**
* Gets the message to warn the user about the theme requirements not being met.
*
* @global string $wp_version WordPress version.
*
* @return string Message to show to the user.
*/
function kadence_get_insufficient_requirements_message() {
global $wp_version;
$insufficient_wp = version_compare( $wp_version, KADENCE_MINIMUM_WP_VERSION, '<' );
$insufficient_php = version_compare( phpversion(), KADENCE_MINIMUM_PHP_VERSION, '<' );
if ( $insufficient_wp && $insufficient_php ) {
/* translators: 1: required WP version number, 2: required PHP version number, 3: available WP version number, 4: available PHP version number */
return sprintf( __( 'Kadence requires at least WordPress version %1$s and PHP version %2$s. You are running versions %3$s and %3$s respectively. Please update and try again.', 'kadence' ), KADENCE_MINIMUM_WP_VERSION, KADENCE_MINIMUM_PHP_VERSION, $wp_version, phpversion() );
}
if ( $insufficient_wp ) {
/* translators: 1: required WP version number, 2: available WP version number */
return sprintf( __( 'Kadence requires at least WordPress version %1$s. You are running version %2$s. Please update and try again.', 'kadence' ), KADENCE_MINIMUM_WP_VERSION, $wp_version );
}
if ( $insufficient_php ) {
/* translators: 1: required PHP version number, 2: available PHP version number */
return sprintf( __( 'Kadence requires at least PHP version %1$s. You are running version %2$s. Please update and try again.', 'kadence' ), KADENCE_MINIMUM_PHP_VERSION, phpversion() );
}
return '';
}
/**
* Prevents switching to the theme when requirements are not met.
*
* Switches to the default theme.
*/
function kadence_switch_theme() {
switch_theme( WP_DEFAULT_THEME );
unset( $_GET['activated'] );
add_action( 'admin_notices', 'kadence_upgrade_notice' );
}
add_action( 'after_switch_theme', 'kadence_switch_theme' );
/**
* Adds a message for unsuccessful theme switch.
*
* Prints an update nag after an unsuccessful attempt to switch to the theme
* when requirements are not met.
*/
function kadence_upgrade_notice() {
printf( '<div class="error"><p>%s</p></div>', esc_html( kadence_get_insufficient_requirements_message() ) );
}
/**
* Prevents the Customizer from being loaded when requirements are not met.
*/
function kadence_customize() {
wp_die(
esc_html( kadence_get_insufficient_requirements_message() ),
'',
array(
'back_link' => true,
)
);
}
add_action( 'load-customize.php', 'kadence_customize' );
/**
* Prevents the Theme Preview from being loaded when requirements are not met.
*/
function kadence_preview() {
if ( isset( $_GET['preview'] ) ) {
wp_die( esc_html( kadence_get_insufficient_requirements_message() ) );
}
}
add_action( 'template_redirect', 'kadence_preview' );

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,775 @@
<?php
/**
* Download webfonts locally. Package from the WPTT Team.
*
* @package wptt/font-loader
* @license https://opensource.org/licenses/MIT
* @version 1.1
*/
namespace Kadence;
use function Kadence\kadence;
if ( ! class_exists( 'WebFont_Loader' ) ) {
/**
* Download webfonts locally.
*/
class WebFont_Loader {
/**
* The font-format.
*
* Use "woff" or "woff2".
* This will change the user-agent user to make the request.
*
* @access protected
* @since 1.0.0
* @var string
*/
protected $font_format = 'woff2';
/**
* The remote URL.
*
* @access protected
* @since 1.1.0
* @var string
*/
protected $remote_url;
/**
* Base path.
*
* @access protected
* @since 1.1.0
* @var string
*/
protected $base_path;
/**
* Base URL.
*
* @access protected
* @since 1.1.0
* @var string
*/
protected $base_url;
/**
* Subfolder name.
*
* @access protected
* @since 1.1.0
* @var string
*/
protected $subfolder_name;
/**
* The fonts folder.
*
* @access protected
* @since 1.1.0
* @var string
*/
protected $fonts_folder;
/**
* The local stylesheet's path.
*
* @access protected
* @since 1.1.0
* @var string
*/
protected $local_stylesheet_path;
/**
* The local stylesheet's URL.
*
* @access protected
* @since 1.1.0
* @var string
*/
protected $local_stylesheet_url;
/**
* The remote CSS.
*
* @access protected
* @since 1.1.0
* @var string
*/
protected $remote_styles;
/**
* The final CSS.
*
* @access protected
* @since 1.1.0
* @var string
*/
protected $css;
/**
* Cleanup routine frequency.
*/
const CLEANUP_FREQUENCY = 'monthly';
/**
* Constructor.
*
* Get a new instance of the object for a new URL.
*
* @access public
* @since 1.1.0
* @param string $url The remote URL.
*/
public function __construct( $url = '' ) {
$this->remote_url = $url;
// Add a cleanup routine.
$this->schedule_cleanup();
add_action( 'delete_fonts_folder', array( $this, 'delete_fonts_folder' ) );
}
/**
* Get the local URL which contains the styles.
*
* Fallback to the remote URL if we were unable to write the file locally.
*
* @access public
* @since 1.1.0
* @return string
*/
public function get_url() {
// Check if the local stylesheet exists.
if ( $this->local_file_exists() ) {
// Attempt to update the stylesheet. Return the local URL on success.
if ( $this->write_stylesheet() ) {
return $this->get_local_stylesheet_url();
}
}
// If the local file exists, return its URL, with a fallback to the remote URL.
return file_exists( $this->get_local_stylesheet_path() )
? $this->get_local_stylesheet_url()
: $this->remote_url;
}
/**
* Get the local stylesheet URL.
*
* @access public
* @since 1.1.0
* @return string
*/
public function get_local_stylesheet_url() {
if ( ! $this->local_stylesheet_url ) {
$this->local_stylesheet_url = str_replace(
$this->get_base_path(),
$this->get_base_url(),
$this->get_local_stylesheet_path()
);
}
return $this->local_stylesheet_url;
}
/**
* Get styles with fonts downloaded locally.
*
* @access public
* @since 1.0.0
* @return string
*/
public function get_styles() {
// If we already have the local file, return its contents.
$local_stylesheet_contents = $this->get_local_stylesheet_contents();
if ( $local_stylesheet_contents ) {
return $local_stylesheet_contents;
}
// Get the remote URL contents.
$this->remote_styles = $this->get_remote_url_contents();
// Get an array of locally-hosted files.
$files = $this->get_local_files_from_css();
// Convert paths to URLs.
foreach ( $files as $remote => $local ) {
$files[ $remote ] = str_replace(
$this->get_base_path(),
$this->get_base_url(),
$local
);
}
$this->css = str_replace(
array_keys( $files ),
array_values( $files ),
$this->remote_styles
);
$this->write_stylesheet();
return $this->css;
}
/**
* Get the font files and preload them.
*
* @access public
*/
public function print_preload_fonts() {
// Make sure variables are set.
// Get the remote URL contents.
$styles = $this->get_styles();
// Get an array of locally-hosted files.
$local = array();
$font_files = $this->get_main_files_from_css( $styles );
foreach ( $font_files as $font_family => $files ) {
if ( is_array( $files ) ) {
foreach ( $files as $key => $single_file ) {
$local[] = $single_file;
}
}
}
foreach ( $local as $key => $local ) {
if ( $local ) {
echo '<link rel="preload" href="' . esc_url( $local ) . '" as="font" type="font/' . esc_attr( $this->font_format ) . '" crossorigin>';
}
}
}
/**
* Get font files from the CSS.
*
* @access public
* @since 1.0.0
* @return array Returns an array of font-families and the font-files used.
*/
public function get_main_files_from_css( $css ) {
//Capture Latin Subsets.
$main_fonts = explode( '* latin */', $css );
// Remove first item in array (that doesn't contain a latin subset).
array_shift( $main_fonts );
$result = array();
// Loop all our latin subset chucks declarations.
foreach ( $main_fonts as $key => $main_font ) {
// Capture sections by @font-face.
$font_faces = explode( '@font-face', $main_font );
// Make sure it's not empty.
if ( isset( $font_faces[1] ) && ! empty( $font_faces[1] ) ) {
// Make sure we only process styles inside this declaration.
$style = explode( '}', $font_faces[1] )[0];
// Sanity check.
if ( false === strpos( $style, 'font-family' ) ) {
continue;
}
// Get an array of our font-families.
preg_match_all( '/font-family.*?\;/', $style, $matched_font_families );
// Get an array of our font-files.
preg_match_all( '/url\(.*?\)/i', $style, $matched_font_files );
// Get the font-family name.
$font_family = 'unknown';
if ( isset( $matched_font_families[0] ) && isset( $matched_font_families[0][0] ) ) {
$font_family = rtrim( ltrim( $matched_font_families[0][0], 'font-family:' ), ';' );
$font_family = trim( str_replace( array( "'", ';' ), '', $font_family ) );
$font_family = sanitize_key( strtolower( str_replace( ' ', '-', $font_family ) ) );
}
// Make sure the font-family is set in our array.
if ( ! isset( $result[ $font_family ] ) ) {
$result[ $font_family ] = array();
}
// Get files for this font-family and add them to the array.
foreach ( $matched_font_files as $match ) {
// Sanity check.
if ( ! isset( $match[0] ) ) {
continue;
}
// Add the file URL.
$result[ $font_family ][] = rtrim( ltrim( $match[0], 'url(' ), ')' );
}
// Make sure we have unique items.
// We're using array_flip here instead of array_unique for improved performance.
$result[ $font_family ] = array_flip( array_flip( $result[ $font_family ] ) );
}
}
return $result;
}
/**
* Get local stylesheet contents.
*
* @access public
* @since 1.1.0
* @return string|false Returns the remote URL contents.
*/
public function get_local_stylesheet_contents() {
$local_path = $this->get_local_stylesheet_path();
// Check if the local stylesheet exists.
if ( $this->local_file_exists() ) {
// Attempt to update the stylesheet. Return false on fail.
if ( ! $this->write_stylesheet() ) {
return false;
}
}
ob_start();
include $local_path;
return ob_get_clean();
}
/**
* Get remote file contents.
*
* @access public
* @since 1.0.0
* @return string Returns the remote URL contents.
*/
public function get_remote_url_contents() {
/**
* The user-agent we want to use.
*
* The default user-agent is the only one compatible with woff (not woff2)
* which also supports unicode ranges.
*/
$user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8';
// Switch to a user-agent supporting woff2 if we don't need to support IE.
if ( 'woff2' === $this->font_format ) {
$user_agent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0';
}
// Get the response.
$response = wp_remote_get( $this->remote_url, array( 'user-agent' => $user_agent ) );
// Early exit if there was an error.
if ( is_wp_error( $response ) || 200 !== (int) wp_remote_retrieve_response_code( $response ) ) {
return '';
}
// Get the CSS from our response.
$contents = wp_remote_retrieve_body( $response );
// Early exit if there was an error.
if ( is_wp_error( $contents ) ) {
return;
}
return $contents;
}
/**
* Download files mentioned in our CSS locally.
*
* @access public
* @since 1.0.0
* @return array Returns an array of remote URLs and their local counterparts.
*/
public function get_local_files_from_css() {
$font_files = $this->get_remote_files_from_css();
$stored = get_site_option( 'downloaded_font_files', array() );
$change = false; // If in the end this is true, we need to update the cache option.
// If the fonts folder don't exist, create it.
if ( ! file_exists( $this->get_fonts_folder() ) ) {
$this->get_filesystem()->mkdir( $this->get_fonts_folder(), FS_CHMOD_DIR );
}
foreach ( $font_files as $font_family => $files ) {
// The folder path for this font-family.
$folder_path = $this->get_fonts_folder() . '/' . $font_family;
// If the folder doesn't exist, create it.
if ( ! file_exists( $folder_path ) ) {
$this->get_filesystem()->mkdir( $folder_path, FS_CHMOD_DIR );
}
foreach ( $files as $url ) {
// Get the filename.
$filename = basename( wp_parse_url( $url, PHP_URL_PATH ) );
$font_path = $folder_path . '/' . $filename;
// Check if the file already exists.
if ( file_exists( $font_path ) ) {
// Skip if already cached.
if ( isset( $stored[ $url ] ) ) {
continue;
}
// Add file to the cache and change the $changed var to indicate we need to update the option.
$stored[ $url ] = $font_path;
$change = true;
// Since the file exists we don't need to proceed with downloading it.
continue;
}
/**
* If we got this far, we need to download the file.
*/
// require file.php if the download_url function doesn't exist.
if ( ! function_exists( 'download_url' ) ) {
require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' );
}
// Download file to temporary location.
$tmp_path = download_url( $url );
// Make sure there were no errors.
if ( is_wp_error( $tmp_path ) ) {
continue;
}
// Move temp file to final destination.
$success = $this->get_filesystem()->move( $tmp_path, $font_path, true );
if ( $success ) {
$stored[ $url ] = $font_path;
$change = true;
}
}
}
// If there were changes, update the option.
if ( $change ) {
// Cleanup the option and then save it.
foreach ( $stored as $url => $path ) {
if ( ! file_exists( $path ) ) {
unset( $stored[ $url ] );
}
}
update_site_option( 'downloaded_font_files', $stored );
}
return $stored;
}
/**
* Get font files from the CSS.
*
* @access public
* @since 1.0.0
* @return array Returns an array of font-families and the font-files used.
*/
public function get_remote_files_from_css() {
$font_faces = explode( '@font-face', $this->remote_styles );
$result = array();
// Loop all our font-face declarations.
foreach ( $font_faces as $font_face ) {
// Make sure we only process styles inside this declaration.
$style = explode( '}', $font_face )[0];
// Sanity check.
if ( false === strpos( $style, 'font-family' ) ) {
continue;
}
// Get an array of our font-families.
preg_match_all( '/font-family.*?\;/', $style, $matched_font_families );
// Get an array of our font-files.
preg_match_all( '/url\(.*?\)/i', $style, $matched_font_files );
// Get the font-family name.
$font_family = 'unknown';
if ( isset( $matched_font_families[0] ) && isset( $matched_font_families[0][0] ) ) {
$font_family = rtrim( ltrim( $matched_font_families[0][0], 'font-family:' ), ';' );
$font_family = trim( str_replace( array( "'", ';' ), '', $font_family ) );
$font_family = sanitize_key( strtolower( str_replace( ' ', '-', $font_family ) ) );
}
// Make sure the font-family is set in our array.
if ( ! isset( $result[ $font_family ] ) ) {
$result[ $font_family ] = array();
}
// Get files for this font-family and add them to the array.
foreach ( $matched_font_files as $match ) {
// Sanity check.
if ( ! isset( $match[0] ) ) {
continue;
}
// Add the file URL.
$result[ $font_family ][] = rtrim( ltrim( $match[0], 'url(' ), ')' );
}
// Make sure we have unique items.
// We're using array_flip here instead of array_unique for improved performance.
$result[ $font_family ] = array_flip( array_flip( $result[ $font_family ] ) );
}
return $result;
}
/**
* Write the CSS to the filesystem.
*
* @access protected
* @since 1.1.0
* @return string|false Returns the absolute path of the file on success, or false on fail.
*/
protected function write_stylesheet() {
$file_path = $this->get_local_stylesheet_path();
$filesystem = $this->get_filesystem();
// If the folder doesn't exist, create it.
if ( ! file_exists( $this->get_fonts_folder() ) ) {
$this->get_filesystem()->mkdir( $this->get_fonts_folder(), FS_CHMOD_DIR );
}
// If the file doesn't exist, create it. Return false if it can not be created.
if ( ! $filesystem->exists( $file_path ) && ! $filesystem->touch( $file_path ) ) {
return false;
}
// If we got this far, we need to write the file.
// Get the CSS.
if ( ! $this->css ) {
$this->get_styles();
}
// Put the contents in the file. Return false if that fails.
if ( ! $filesystem->put_contents( $file_path, $this->css ) ) {
return false;
}
return $file_path;
}
/**
* Get the stylesheet path.
*
* @access public
* @since 1.1.0
* @return string
*/
public function get_local_stylesheet_path() {
if ( ! $this->local_stylesheet_path ) {
$this->local_stylesheet_path = $this->get_fonts_folder() . '/' . $this->get_local_stylesheet_filename() . '.css';
}
return $this->local_stylesheet_path;
}
/**
* Get the local stylesheet filename.
*
* This is a hash, generated from the site-URL, the wp-content path and the URL.
* This way we can avoid issues with sites changing their URL, or the wp-content path etc.
*
* @access public
* @since 1.1.0
* @return string
*/
public function get_local_stylesheet_filename() {
return md5( $this->get_base_url() . $this->get_base_path() . $this->remote_url . $this->font_format );
}
/**
* Set the font-format to be used.
*
* @access public
* @since 1.0.0
* @param string $format The format to be used. Use "woff" or "woff2".
* @return void
*/
public function set_font_format( $format = 'woff2' ) {
$this->font_format = $format;
}
/**
* Check if the local stylesheet exists.
*
* @access public
* @since 1.1.0
* @return bool
*/
public function local_file_exists() {
return ( ! file_exists( $this->get_local_stylesheet_path() ) );
}
/**
* Get the base path.
*
* @access public
* @since 1.1.0
* @return string
*/
public function get_base_path() {
if ( ! $this->base_path ) {
$this->base_path = apply_filters( 'wptt_get_local_fonts_base_path', $this->get_filesystem()->wp_content_dir() );
}
return $this->base_path;
}
/**
* Get the base URL.
*
* @access public
* @since 1.1.0
* @return string
*/
public function get_base_url() {
if ( ! $this->base_url ) {
$this->base_url = apply_filters( 'wptt_get_local_fonts_base_url', content_url() );
}
return $this->base_url;
}
/**
* Get the subfolder name.
*
* @access public
* @since 1.1.0
* @return string
*/
public function get_subfolder_name() {
if ( ! $this->subfolder_name ) {
$this->subfolder_name = apply_filters( 'wptt_get_local_fonts_subfolder_name', 'fonts' );
}
return $this->subfolder_name;
}
/**
* Get the folder for fonts.
*
* @access public
* @return string
*/
public function get_fonts_folder() {
if ( ! $this->fonts_folder ) {
$this->fonts_folder = $this->get_base_path();
if ( $this->get_subfolder_name() ) {
$this->fonts_folder .= '/' . $this->get_subfolder_name();
}
}
return $this->fonts_folder;
}
/**
* Schedule a cleanup.
*
* Deletes the fonts files on a regular basis.
* This way font files will get updated regularly,
* and we avoid edge cases where unused files remain in the server.
*
* @access public
* @since 1.1.0
* @return void
*/
public function schedule_cleanup() {
if ( ! is_multisite() || ( is_multisite() && is_main_site() ) ) {
if ( ! wp_next_scheduled( 'delete_fonts_folder' ) && ! wp_installing() ) {
wp_schedule_event( time(), self::CLEANUP_FREQUENCY, 'delete_fonts_folder' );
}
}
}
/**
* Delete the fonts folder.
*
* This runs as part of a cleanup routine.
*
* @access public
* @since 1.1.0
* @return bool
*/
public function delete_fonts_folder() {
return $this->get_filesystem()->delete( $this->get_fonts_folder(), true );
}
/**
* Get the filesystem.
*
* @access protected
* @since 1.0.0
* @return WP_Filesystem
*/
protected function get_filesystem() {
global $wp_filesystem;
// If the filesystem has not been instantiated yet, do it here.
if ( ! $wp_filesystem ) {
if ( ! function_exists( 'WP_Filesystem' ) ) {
require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' );
}
WP_Filesystem();
}
return $wp_filesystem;
}
}
}
if ( ! function_exists( 'get_webfont_styles' ) ) {
/**
* Get styles for a webfont.
*
* This will get the CSS from the remote API,
* download any fonts it contains,
* replace references to remote URLs with locally-downloaded assets,
* and finally return the resulting CSS.
*
* @since 1.0.0
*
* @param string $url The URL of the remote webfont.
* @param string $format The font-format. If you need to support IE, change this to "woff".
*
* @return string Returns the CSS.
*/
function get_webfont_styles( $url, $format = 'woff2' ) {
$font = new WebFont_Loader( $url );
$font->set_font_format( $format );
return $font->get_styles();
}
}
if ( ! function_exists( 'get_webfont_url' ) ) {
/**
* Get a stylesheet URL for a webfont.
*
* @since 1.1.0
*
* @param string $url The URL of the remote webfont.
* @param string $format The font-format. If you need to support IE, change this to "woff".
*
* @return string Returns the CSS.
*/
function get_webfont_url( $url, $format = 'woff2' ) {
$font = new WebFont_Loader( $url );
$font->set_font_format( $format );
return $font->get_url();
}
}
if ( ! function_exists( 'print_webfont_preload' ) ) {
/**
* Get the file preloads.
*
* @param string $url The URL of the remote webfont.
* @param string $format The font-format. If you need to support IE, change this to "woff".
*/
function print_webfont_preload( $url, $format = 'woff2' ) {
$font = new WebFont_Loader( $url );
$font->set_font_format( $format );
$font->print_preload_fonts();
}
}

View File

@@ -0,0 +1,344 @@
<?php
/**
* Kadence\Theme class
*
* @package kadence
*/
namespace Kadence;
use InvalidArgumentException;
/**
* Main class for the theme.
*
* This class takes care of initializing theme features and available template tags.
*/
class Theme {
/**
* Instance Control
*
* @var null
*/
private static $instance = null;
/**
* Associative array of theme components, keyed by their slug.
*
* @var array
*/
public $components = array();
/**
* The template tags instance, providing access to all available template tags.
*
* @var Template_Tags
*/
protected $template_tags;
/**
* Main Kadence\Theme Class Instance.
*
* Insures that only one instance of Kadence Class exists in memory at any one
* time. Also prevents needing to define globals all over the place.
*
* @static
* @static var array $instance
*
* @return Kadence\Theme Class
*/
public static function instance() {
// Return if already instantiated.
if ( self::is_instantiated() ) {
return self::$instance;
}
// Setup the singleton.
self::setup_instance();
self::$instance->initialize();
// Return the instance.
return self::$instance;
}
/**
* Setup the singleton instance
*
* @access private
*/
private static function setup_instance() {
self::$instance = new Theme();
}
/**
* Return whether the main loading class has been instantiated or not.
*
* @access private
* @return boolean True if instantiated. False if not.
*/
private static function is_instantiated() {
// Return true if instance is correct class.
if ( ! empty( self::$instance ) && ( self::$instance instanceof Theme ) ) {
return true;
}
// Return false if not instantiated correctly.
return false;
}
/**
* Constructor.
*
* Sets the theme components.
*
* @param array $components Optional. List of theme components. Only intended for custom initialization, typically
* the theme components are declared by the theme itself. Each theme component must
* implement the Component_Interface interface.
*
* @throws InvalidArgumentException Thrown if one of the $components does not implement Component_Interface.
*/
public function __construct( array $components = array() ) {
spl_autoload_register( array( $this, 'autoload' ) );
if ( empty( $components ) ) {
$components = $this->get_default_components();
}
// Set the components.
foreach ( $components as $component ) {
// Bail if a component is invalid.
if ( ! $component instanceof Component_Interface ) {
throw new InvalidArgumentException(
sprintf(
/* translators: 1: classname/type of the variable, 2: interface name */
__( 'The theme component %1$s does not implement the %2$s interface.', 'kadence' ),
gettype( $component ),
Component_Interface::class
)
);
}
$this->components[ $component->get_slug() ] = $component;
}
// Instantiate the template tags instance for all theme templating components.
$this->template_tags = new Template_Tags(
array_filter(
$this->components,
function( Component_Interface $component ) {
return $component instanceof Templating_Component_Interface;
}
)
);
}
/**
* Custom autoloader function for theme classes.
*
* @access private
*
* @param string $class_name Class name to load.
* @return bool True if the class was loaded, false otherwise.
*/
private function autoload( $class_name ) {
$namespace = 'Kadence';
if ( strpos( $class_name, $namespace . '\\' ) !== 0 ) {
return false;
}
$parts = explode( '\\', substr( $class_name, strlen( $namespace . '\\' ) ) );
$path = get_template_directory() . '/inc/components';
foreach ( $parts as $part ) {
$path .= '/' . strtolower( $part );
}
$path .= '.php';
if ( ! file_exists( $path ) ) {
return false;
}
require_once $path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
return true;
}
/**
* Throw error on object clone.
*
* The whole idea of the singleton design pattern is that there is a single
* object therefore, we don't want the object to be cloned.
*
* @return void
*/
public function __clone() {
// Cloning instances of the class is forbidden.
_doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'kadence' ), '1.0' );
}
/**
* Disable un-serializing of the class.
*
* @return void
*/
public function __wakeup() {
// Unserializing instances of the class is forbidden.
_doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'kadence' ), '1.0' );
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*
* This method must only be called once in the request lifecycle.
*/
public function initialize() {
array_walk(
$this->components,
function( Component_Interface $component ) {
$component->initialize();
}
);
}
/**
* Retrieves the template tags instance, the entry point exposing template tag methods.
*
* Calling `kadence()` is a short-hand for calling this method on the main theme instance. The instance then allows
* for actual template tag methods to be called. For example, if there is a template tag called `posted_on`, it can
* be accessed via `kadence()->posted_on()`.
*
* @return Template_Tags Template tags instance.
*/
public function template_tags() : Template_Tags {
return $this->template_tags;
}
/**
* Retrieves the component for a given slug.
*
* This should typically not be used from outside of the theme classes infrastructure.
*
* @param string $slug Slug identifying the component.
* @return Component_Interface Component for the slug.
*
* @throws InvalidArgumentException Thrown when no theme component with the given slug exists.
*/
public function component( string $slug ) : Component_Interface {
if ( ! isset( $this->components[ $slug ] ) ) {
throw new InvalidArgumentException(
sprintf(
/* translators: %s: slug */
__( 'No theme component with the slug %s exists.', 'kadence' ),
$slug
)
);
}
return $this->components[ $slug ];
}
/**
* Gets the default theme components.
*
* This method is called if no components are passed to the constructor, which is the common scenario.
*
* @return array List of theme components to use by default.
*/
protected function get_default_components() : array {
$components = array(
new Options\Component(),
new Localization\Component(),
new Base_Support\Component(),
new Editor\Component(),
new Accessibility\Component(),
new Image_Sizes\Component(),
new AMP\Component(),
new Microdata\Component(),
//new PWA\Component(),
new Comments\Component(),
new Nav_Menus\Component(),
new Custom_Header\Component(),
new Custom_Footer\Component(),
new Custom_Logo\Component(),
new Color_Palette\Component(),
new Styles\Component(),
new Scripts\Component(),
new Breadcrumbs\Component(),
new Template_Parts\Component(),
new Clean_Frontend\Component(),
new Icons\Component(),
new Layout\Component(),
new Entry_Title\Component(),
new Archive_Title\Component(),
new Third_Party\Component(),
new Style_Guide\Component(),
);
if ( class_exists( '\Elementor\Plugin' ) ) {
$components[] = new Elementor\Component();
}
if ( class_exists( 'ElementorPro\Modules\ThemeBuilder\Module' ) ) {
$components[] = new Elementor_Pro\Component();
}
if ( class_exists( 'FLThemeBuilderLayoutData' ) ) {
$components[] = new BeaverThemer\Component();
}
if ( class_exists( 'FLBuilderModel' ) ) {
$components[] = new Beaver\Component();
}
if ( class_exists( 'TUTOR\Tutor' ) ) {
$components[] = new TutorLMS\Component();
}
if ( class_exists( 'woocommerce' ) ) {
$components[] = new Woocommerce\Component();
}
if ( class_exists( 'HT_Knowledge_Base' ) ) {
$components[] = new Heroic_Kb\Component();
}
if ( defined( 'JETPACK__VERSION' ) ) {
$components[] = new Jetpack\Component();
}
if ( class_exists( 'LifterLMS' ) ) {
$components[] = new LifterLMS\Component();
}
if ( defined( 'LEARNDASH_VERSION' ) ) {
$components[] = new LearnDash\Component();
}
if ( class_exists( 'Essential_Real_Estate' ) ) {
$components[] = new Essential_Real_Estate\Component();
}
if ( class_exists( 'Restrict_Content_Pro' ) ) {
$components[] = new Restrict_Content_Pro\Component();
}
if ( class_exists( 'Estatik' ) ) {
$components[] = new Estatik\Component();
}
if ( class_exists( 'BBPress' ) && apply_filters( 'kadence_theme_enable_bbpress_component', true ) ) {
$components[] = new BBPress\Component();
}
if ( defined( 'BP_PLATFORM_VERSION' ) ) {
$components[] = new BuddyBoss\Component();
}
if ( defined( 'POLYLANG_VERSION' ) ) {
$components[] = new Polylang\Component();
}
if ( defined( 'RANK_MATH_VERSION' ) ) {
$components[] = new Rankmath\Component();
}
if ( defined( 'TRIBE_EVENTS_FILE' ) ) {
$components[] = new The_Events_Calendar\Component();
}
if ( defined( 'GIVE_VERSION' ) ) {
$components[] = new Give\Component();
}
if ( defined( 'WPZOOM_RCB_VERSION' ) ) {
$components[] = new Zoom_Recipe_Card\Component();
}
if ( class_exists( '\SureCart' ) ) {
$components[] = new Surecart\Component();
}
return $components;
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* Kadence\Accessibility\Component class
*
* @package kadence
*/
namespace Kadence\Accessibility;
use Kadence\Component_Interface;
use function Kadence\kadence;
use WP_Post;
use function add_action;
use function add_filter;
use function wp_enqueue_script;
use function get_theme_file_uri;
use function get_theme_file_path;
use function wp_script_add_data;
use function wp_localize_script;
/**
* Class for improving accessibility among various core features.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'accessibility';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_filter( 'nav_menu_link_attributes', array( $this, 'filter_nav_menu_link_attributes_aria_current' ), 10, 2 );
add_filter( 'page_menu_link_attributes', array( $this, 'filter_nav_menu_link_attributes_aria_current' ), 10, 2 );
add_filter( 'kadence_before_header', array( $this, 'skip_to_content_link' ), 2 );
}
/**
* Prints a link to allow screen readers to skip to content.
*/
public function skip_to_content_link() {
?>
<a class="skip-link screen-reader-text scroll-ignore" href="#main"><?php esc_html_e( 'Skip to content', 'kadence' ); ?></a>
<?php
}
/**
* Filters the HTML attributes applied to a menu item's anchor element.
*
* Checks if the menu item is the current menu item and adds the aria "current" attribute.
*
* @param array $atts The HTML attributes applied to the menu item's `<a>` element.
* @param object $item The current menu item.
* @return array Modified HTML attributes
*/
public function filter_nav_menu_link_attributes_aria_current( array $atts, $item ) {
if ( isset( $item->current ) ) {
if ( $item->current ) {
$atts['aria-current'] = 'page';
}
} elseif ( ! empty( $item->ID ) ) {
global $post;
if ( ! empty( $post->ID ) && (int) $post->ID === (int) $item->ID ) {
$atts['aria-current'] = 'page';
}
}
return $atts;
}
}

View File

@@ -0,0 +1,96 @@
<?php
/**
* Kadence\AMP\Component class
*
* @package kadence
*/
namespace Kadence\AMP;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function add_action;
use function add_theme_support;
use function get_theme_support;
/**
* Class for managing AMP support.
*
* Exposes template tags:
* * `kadence()->is_amp()`
* * `kadence()->using_amp_live_list_comments()`
*
* @link https://wordpress.org/plugins/amp/
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'amp';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'after_setup_theme', array( $this, 'action_add_amp_support' ) );
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'is_amp' => array( $this, 'is_amp' ),
'using_amp_live_list_comments' => array( $this, 'using_amp_live_list_comments' ),
);
}
/**
* Adds theme support for AMP.
*
* From here you can control how the plugin, when activated, impacts the the theme.
*/
public function action_add_amp_support() {
add_theme_support(
'amp',
array(
'comments_live_list' => true,
)
);
}
/**
* Determines whether this is an AMP response.
*
* Note that this must only be called after the parse_query action.
*
* @return bool Whether the AMP plugin is active and the current request is for an AMP endpoint.
*/
public function is_amp() : bool {
return function_exists( 'is_amp_endpoint' ) && \is_amp_endpoint();
}
/**
* Determines whether amp-live-list should be used for the comment list.
*
* @return bool Whether to use amp-live-list.
*/
public function using_amp_live_list_comments() : bool {
if ( ! $this->is_amp() ) {
return false;
}
$amp_theme_support = get_theme_support( 'amp' );
return ! empty( $amp_theme_support[0]['comments_live_list'] );
}
}

View File

@@ -0,0 +1,126 @@
<?php
/**
* Kadence\Archive_Title\Component class
*
* @package kadence
*/
namespace Kadence\Archive_Title;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function add_action;
use function apply_filters;
use function Kadence\kadence;
use function get_template_part;
/**
* Class for adding custom title area support.
*
* Exposes template tags:
* * `kadence()->render_archive_title()`
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'archive_title';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_filter( 'get_the_archive_title', array( $this, 'filter_archive_title' ) );
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'render_archive_title' => array( $this, 'render_archive_title' ),
);
}
/**
* Update the archives to a better naming.
*
* @param string $title the name of the archive.
*/
public function filter_archive_title( $title ) {
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
if ( is_home() && is_front_page() ) {
$title = get_bloginfo( 'name' );
} elseif ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
} elseif ( is_author() ) {
/* translators: 1: Author Name */
$title = sprintf( esc_html__( 'Author: %s', 'kadence' ), get_the_author() );
} elseif ( is_day() ) {
/* translators: 1: Day */
$title = sprintf( esc_html__( 'Day: %s', 'kadence' ), get_the_date() );
} elseif ( is_month() ) {
/* translators: 1: Month */
$title = sprintf( esc_html__( 'Month: %s', 'kadence' ), get_the_date( 'F Y' ) );
} elseif ( is_year() ) {
/* translators: 1: Year */
$title = sprintf( esc_html__( 'Year: %s', 'kadence' ), get_the_date( 'Y' ) );
} elseif ( class_exists( 'woocommerce' ) && is_shop() ) {
$shop_page_id = wc_get_page_id( 'shop' );
$title = get_the_title( $shop_page_id );
} elseif ( is_tax( array( 'product_cat', 'product_tag' ) ) ) {
$title = single_term_title( '', false );
} elseif ( $term ) {
$title = $term->name;
} elseif ( function_exists( 'is_bbpress' ) ) {
if ( is_bbpress() ) {
if ( bbp_is_forum_archive() ) {
$title = bbp_get_forum_archive_title();
} else {
$title = bbp_title();
}
}
} elseif ( function_exists( 'tribe_is_month' ) && ( tribe_is_month() || tribe_is_past() || tribe_is_upcoming() || tribe_is_day() ) ) {
$title = tribe_get_event_label_plural();
} elseif ( function_exists( 'tribe_is_photo' ) && ( tribe_is_map() || tribe_is_photo() || tribe_is_week() ) ) {
$title = tribe_get_event_label_plural();
} elseif ( is_post_type_archive( 'course' ) && function_exists( 'llms_get_page_id' ) ) {
$title = get_the_title( llms_get_page_id( 'courses' ) );
} elseif ( is_post_type_archive( 'llms_membership' ) && function_exists( 'llms_get_page_id' ) ) {
$title = get_the_title( llms_get_page_id( 'memberships' ) );
} elseif ( is_post_type_archive( 'ht_kb' ) ) {
$title = get_the_title();
} elseif ( is_post_type_archive() ) {
$title = post_type_archive_title( '', false );
}
return $title;
}
/**
* Adds support to render header columns.
*
* @param string $archive_type the name of the row.
* @param string $area the name of the area.
*/
public function render_archive_title( $archive_type = 'post_archive', $area = 'normal' ) {
$elements = kadence()->option( $archive_type . '_title_elements' );
if ( isset( $elements ) && is_array( $elements ) && ! empty( $elements ) ) {
foreach ( $elements as $item ) {
if ( kadence()->sub_option( $archive_type . '_title_element_' . $item, 'enabled' ) ) {
$template = apply_filters( 'kadence_title_elements_template_path', 'template-parts/archive-title/' . $item, $item, $area );
get_template_part( $template );
}
}
} else {
get_template_part( 'template-parts/archive-title/title' );
}
}
}

View File

@@ -0,0 +1,929 @@
<?php
/**
* Kadence\Base_Support\Component class
*
* @package kadence
*/
namespace Kadence\Base_Support;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use Kadence_Blocks_Frontend;
use Kadence_Blocks_Pro_Frontend;
use WP_Upgrader;
use WP_Ajax_Upgrader_Skin;
use Plugin_Upgrader;
use function Kadence\kadence;
use function add_action;
use function add_filter;
use function add_theme_support;
use function is_singular;
use function pings_open;
use function esc_url;
use function get_bloginfo;
use function wp_scripts;
use function wp_get_theme;
use function get_template;
use function plugins_api;
use function activate_plugin;
use function get_site_option;
use function is_customize_preview;
/**
* Class for adding basic theme support, most of which is mandatory to be implemented by all themes.
*
* Exposes template tags:
* * `kadence()->get_version()`
* * `kadence()->get_post_types()`
* * `kadence()->get_asset_version( string $filepath )`
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Holds post types.
*
* @var values of all the post types.
*/
protected static $post_types = null;
/**
* Holds post types.
*
* @var values of all the post types.
*/
protected static $post_types_objects = null;
/**
* Holds ignore post types.
*
* @var values of all the post types.
*/
protected static $ignore_post_types = null;
/**
* Holds ignore post types.
*
* @var values of all the post types.
*/
protected static $public_ignore_post_types = null;
/**
* Holds ignore post types.
*
* @var values of all the post types.
*/
protected static $transparent_ignore_post_types = null;
/**
* Static var active plugins
*
* @var $active_plugins
*/
private static $active_plugins;
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'base_support';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'after_setup_theme', array( $this, 'action_essential_theme_support' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'install_starter_script' ) );
// 05/06/2026: this banner is temporarily commented out until kadence starter templates experience is updated.
// add_action( 'admin_notices', array( $this, 'kadence_starter_templates_notice' ) );
add_action( 'admin_notices', array( $this, 'kadence_turn_off_gutenberg_plugin_notice' ) );
add_action( 'wp_ajax_kadence_dismiss_notice', array( $this, 'ajax_dismiss_starter_notice' ) );
add_action( 'wp_ajax_kadence_dismiss_gutenberg_notice', array( $this, 'ajax_dismiss_gutenberg_notice' ) );
add_action( 'wp_ajax_kadence_install_starter', array( $this, 'install_plugin_ajax_callback' ) );
add_action( 'wp_head', array( $this, 'action_add_pingback_header' ) );
add_action( 'wp_head', array( $this, 'action_add_no_js_remove_script' ), 2 );
add_action( 'wp_footer', array( $this, 'action_add_scrollbar_offset_script' ), 2 );
add_filter( 'body_class', array( $this, 'filter_body_classes_add_hfeed' ) );
add_filter( 'embed_defaults', array( $this, 'filter_embed_dimensions' ) );
add_filter( 'theme_scandir_exclusions', array( $this, 'filter_scandir_exclusions_for_optional_templates' ) );
add_filter( 'script_loader_tag', array( $this, 'filter_script_loader_tag' ), 10, 2 );
add_filter( 'body_class', array( $this, 'filter_body_classes_add_link_style' ) );
add_filter( 'get_search_form', array( $this, 'add_search_icon' ), 99 );
add_filter( 'get_product_search_form', array( $this, 'add_search_icon' ), 99 );
add_filter( 'embed_oembed_html', array( $this, 'classic_embed_wrap' ), 90, 4 );
add_filter( 'excerpt_length', array( $this, 'custom_excerpt_length' ) );
add_filter( 'the_author_description', 'wpautop' );
add_action( 'admin_init', array( $this, 'set_theme_initial_version' ) );
add_action( 'init', array( $this, 'setup_content_filter' ), 9 );
add_action( 'wp', array( $this, 'setup_header_block_css' ), 99 );
}
/**
* Add the header block css to the head tag.
*/
public function setup_header_block_css() {
if ( is_admin() ) {
return;
}
if ( kadence()->option( 'blocks_header' ) && defined( 'KADENCE_BLOCKS_VERSION' ) ) {
$header_id = kadence()->option( 'blocks_header_id' );
if ( ! empty( $header_id ) ) {
$header_block = get_post( $header_id );
if ( ! $header_block || 'kadence_header' !== $header_block->post_type ) {
return;
}
if ( 'publish' !== $header_block->post_status || ! empty( $header_block->post_password ) ) {
return;
}
$header_block->post_content = '<!-- wp:kadence/header {"uniqueID":"header-replace","id":' . $header_id . '} /-->';
if ( class_exists( 'Kadence_Blocks_Frontend' ) ) {
$kadence_blocks = \Kadence_Blocks_Frontend::get_instance();
if ( method_exists( $kadence_blocks, 'frontend_build_css' ) ) {
$kadence_blocks->frontend_build_css( $header_block );
}
if ( class_exists( 'Kadence_Blocks_Pro_Frontend' ) ) {
$kadence_blocks_pro = \Kadence_Blocks_Pro_Frontend::get_instance();
if ( method_exists( $kadence_blocks_pro, 'frontend_build_css' ) ) {
$kadence_blocks_pro->frontend_build_css( $header_block );
}
}
}
}
}
}
/**
* Add filters for element content output.
*/
public function setup_content_filter() {
global $wp_embed;
add_filter( 'kadence_theme_the_content', array( $wp_embed, 'run_shortcode' ), 8 );
add_filter( 'kadence_theme_the_content', array( $wp_embed, 'autoembed' ), 8 );
add_filter( 'kadence_theme_the_content', 'do_blocks' );
add_filter( 'kadence_theme_the_content', 'wptexturize' );
add_filter( 'kadence_theme_the_content', 'shortcode_unautop' );
add_filter( 'kadence_theme_the_content', 'wp_filter_content_tags' );
add_filter( 'kadence_theme_the_content', 'do_shortcode', 11 );
add_filter( 'kadence_theme_the_content', 'convert_smilies', 20 );
}
/**
* Set the initial theme version.
*/
public function set_theme_initial_version() {
$initial_version = get_theme_mod( 'initial_version', false );
if ( ! $initial_version ) {
set_theme_mod( 'initial_version', KADENCE_VERSION );
}
}
/**
* Add Notice for Kadence Starter templates
*/
public function kadence_starter_templates_notice() {
if ( defined( 'KADENCE_STARTER_TEMPLATES_VERSION' ) || get_option( 'kadence_starter_plugin_notice' ) || ! current_user_can( 'install_plugins' ) ) {
return;
}
$installed_plugins = get_plugins();
if ( ! isset( $installed_plugins['kadence-starter-templates/kadence-starter-templates.php'] ) ) {
$button_label = esc_html__( 'Install AI Starter Templates', 'kadence' );
$data_action = 'install';
} elseif ( ! self::active_plugin_check( 'kadence-starter-templates/kadence-starter-templates.php' ) ) {
$button_label = esc_html__( 'Activate AI Starter Templates', 'kadence' );
$data_action = 'activate';
} else {
return;
}
$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;
}
}
$starter_link = $use_site_assist || class_exists( '\\KadenceWP\\KadenceBlocks\\StellarWP\\Uplink\\Register' ) ? admin_url( 'admin.php?page=kadence-starter-templates' ) : admin_url( 'themes.php?page=kadence-starter-templates' );
?>
<div id="kadence-notice-starter-templates" class="notice is-dismissible notice-info">
<div class="sub-notice-title"><?php echo esc_html__( 'Thanks for choosing the Kadence Theme!', 'kadence' ); ?></div>
<h2 class="notice-title"><?php echo esc_html__( 'Get Started with an AI Powered Website!', 'kadence' ); ?></h2>
<p class="kadence-notice-description"><?php /* translators: %s: <strong> <a> */ printf( esc_html__( 'Want to get started with a beautiful AI Powered %1$sstarter template%2$s? Install the Kadence AI Powered Starter Templates plugin to launch an AI optimized website in minutes.', 'kadence' ), '<a href="https://wordpress.org/plugins/kadence-starter-templates/" target="_blank">', '</a>', '<strong>', '</strong>' ); ?></p>
<p class="install-submit">
<button class="button button-primary kadence-install-starter-btn" data-redirect-url="<?php echo esc_url( $starter_link ); ?>" data-activating-label="<?php echo esc_attr__( 'Activating...', 'kadence' ); ?>" data-activated-label="<?php echo esc_attr__( 'Activated', 'kadence' ); ?>" data-installing-label="<?php echo esc_attr__( 'Installing...', 'kadence' ); ?>" data-installed-label="<?php echo esc_attr__( 'Installed', 'kadence' ); ?>" data-action="<?php echo esc_attr( $data_action ); ?>"><?php echo esc_html( $button_label ); ?></button>
</p>
</div>
<style>#kadence-notice-starter-templates {padding: 24px;}#kadence-notice-starter-templates .kadence-notice-description {max-width: 600px;font-size: 15px;margin-bottom: 12px;}#kadence-notice-starter-templates button.kadence-install-starter-btn {padding: 4px 16px;font-size: 15px;}#kadence-notice-starter-templates h2.notice-title {font-size: 24px;margin-bottom: 8px;}</style>
<?php
wp_enqueue_script( 'kadence-starter-install' );
wp_localize_script(
'kadence-starter-install',
'kadenceStarterInstall',
array(
'ajax_url' => admin_url( 'admin-ajax.php' ),
'ajax_nonce' => wp_create_nonce( 'kadence-ajax-verification' ),
'status' => $data_action,
)
);
}
/**
* Add Notice for to not use the Gutenberg Plugin
*/
public function kadence_turn_off_gutenberg_plugin_notice() {
if ( ! defined( 'GUTENBERG_VERSION' ) || get_option( 'kadence_disable_gutenberg_notice' ) || ! current_user_can( 'install_plugins' ) ) {
return;
}
?>
<div id="kadence-notice-gutenberg-plugin" class="notice is-dismissible notice-warning">
<h2 class="notice-title"><?php echo esc_html__( 'Gutenberg Plugin Detected', 'kadence' ); ?></h2>
<p class="kadence-notice-description"><?php /* translators: %s: <a> */ printf( esc_html__( 'The %1$sGutenberg plugin%2$s is not recommended for use in a production site. Many things may be broken by using this plugin. Please deactivate.', 'kadence' ), '<a href="https://wordpress.org/plugins/gutenberg/" target="_blank">', '</a>' ); ?></p>
</div>
<?php
wp_enqueue_script( 'kadence-gutenberg-deactivate' );
wp_localize_script(
'kadence-gutenberg-deactivate',
'kadenceGutenbergDeactivate',
array(
'ajax_url' => admin_url( 'admin-ajax.php' ),
'ajax_nonce' => wp_create_nonce( 'kadence-ajax-verification' ),
)
);
}
/**
* Run check to see if we need to dismiss the notice.
* If all tests are successful then call the dismiss_notice() method.
*
* @access public
* @since 1.0
* @return void
*/
public function ajax_dismiss_gutenberg_notice() {
// Sanity check: Early exit if we're not on a wptrt_dismiss_notice action.
if ( ! isset( $_POST['action'] ) || 'kadence_dismiss_gutenberg_notice' !== $_POST['action'] ) {
return;
}
// Security check: Make sure nonce is OK.
check_ajax_referer( 'kadence-ajax-verification', 'security', true );
// If we got this far, we need to dismiss the notice.
update_option( 'kadence_disable_gutenberg_notice', true, false );
}
/**
* Run check to see if we need to dismiss the notice.
* If all tests are successful then call the dismiss_notice() method.
*
* @access public
* @since 1.0
* @return void
*/
public function ajax_dismiss_starter_notice() {
// Sanity check: Early exit if we're not on a wptrt_dismiss_notice action.
if ( ! isset( $_POST['action'] ) || 'kadence_dismiss_notice' !== $_POST['action'] ) {
return;
}
// Security check: Make sure nonce is OK.
check_ajax_referer( 'kadence-ajax-verification', 'security', true );
// If we got this far, we need to dismiss the notice.
update_option( 'kadence_starter_plugin_notice', true, false );
}
/**
* Option to Install Starter Templates
*/
public function install_starter_script() {
wp_register_script( 'kadence-starter-install', get_template_directory_uri() . '/assets/js/admin-activate.min.js', array( 'jquery' ), KADENCE_VERSION, false );
wp_register_script( 'kadence-gutenberg-deactivate', get_template_directory_uri() . '/assets/js/gutenberg-notice.min.js', array( 'jquery' ), KADENCE_VERSION, false );
}
/**
* 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 );
}
/**
* 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() ) );
}
}
/**
* AJAX callback to install a plugin.
*/
public function install_plugin_ajax_callback() {
if ( ! check_ajax_referer( 'kadence-ajax-verification', 'security', false ) ) {
wp_send_json_error( __( 'Security Error, Please reload the page.', 'kadence' ) );
}
if ( ! current_user_can( 'install_plugins' ) ) {
wp_send_json_error( __( 'Security Error, Need higher Permissions to install plugin.', 'kadence' ) );
}
// Get selected file index or set it to 0.
$status = empty( $_POST['status'] ) ? 'install' : sanitize_text_field( $_POST['status'] );
if ( ! function_exists( 'plugins_api' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
}
if ( ! class_exists( 'WP_Upgrader' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
}
$install = true;
if ( 'install' === $status ) {
$api = plugins_api(
'plugin_information',
array(
'slug' => 'kadence-starter-templates',
'fields' => array(
'short_description' => false,
'sections' => false,
'requires' => false,
'rating' => false,
'ratings' => false,
'downloaded' => false,
'last_updated' => false,
'added' => false,
'tags' => false,
'compatibility' => false,
'homepage' => false,
'donate_link' => false,
),
)
);
if ( ! is_wp_error( $api ) ) {
// Use AJAX upgrader skin instead of plugin installer skin.
// ref: function wp_ajax_install_plugin().
$upgrader = new \Plugin_Upgrader( new \WP_Ajax_Upgrader_Skin() );
$installed = $upgrader->install( $api->download_link );
if ( $installed ) {
$activate = activate_plugin( 'kadence-starter-templates/kadence-starter-templates.php', '', false, true );
if ( is_wp_error( $activate ) ) {
$install = false;
}
} else {
$install = false;
}
} else {
$install = false;
}
} elseif ( 'activate' === $status ) {
$activate = activate_plugin( 'kadence-starter-templates/kadence-starter-templates.php', '', false, true );
if ( is_wp_error( $activate ) ) {
$install = false;
}
}
if ( false === $install ) {
wp_send_json_error( __( 'Error, plugin could not be installed, please install manually.', 'kadence' ) );
} else {
wp_send_json_success();
}
}
/**
* Filter the excerpt length to 30 words.
*
* @param int $length Excerpt length.
* @return int (Maybe) modified excerpt length.
*/
public function custom_excerpt_length( $length ) {
if ( is_admin() ) {
return $length;
}
if ( is_search() ) {
if ( kadence()->sub_option( 'search_archive_element_excerpt', 'words' ) ) {
$length = intval( kadence()->sub_option( 'search_archive_element_excerpt', 'words' ) );
}
} else if ( 'post' === get_post_type() ) {
if ( kadence()->sub_option( 'post_archive_element_excerpt', 'words' ) ) {
$length = intval( kadence()->sub_option( 'post_archive_element_excerpt', 'words' ) );
}
} else {
if ( kadence()->sub_option( get_post_type() . '_archive_element_excerpt', 'words' ) ) {
$length = intval( kadence()->sub_option( get_post_type() . '_archive_element_excerpt', 'words' ) );
}
}
return $length;
}
/**
* Remove comment date.
*
* @param string|int $date The comment time, formatted as a date string or Unix timestamp.
* @param string $format Date format.
* @param bool $gmt Whether the GMT date is in use.
* @param bool $translate Whether the time is translated.
* @param WP_Comment $comment The comment object.
*/
public function remove_comment_time( $date, $format, $gmt, $translate, $comment ) {
if ( ! is_admin() ) {
return '';
}
return $date;
}
/**
* Remove comment date.
*
* @param string|int $date Formatted date string or Unix timestamp.
* @param string $format The format of the date.
* @param WP_Comment $comment The comment object.
*/
public function remove_comment_date( $date, $format, $comment ) {
if ( ! is_admin() ) {
return '';
}
return $date;
}
/**
* Wrap embedded media for responsive embeds, pre blocks.
*
* @param string $cache The oEmbed markup.
* @param string $url The URL being embedded.
* @param array $attr An array of attributes.
* @param string $post_ID the post id.
*/
public function classic_embed_wrap( $cache, $url, $attr = array(), $post_ID = '' ) {
if ( doing_filter( 'the_content' ) && ! has_blocks() && ! empty( $cache ) && ! empty( $url ) ) {
$do_wrap = false;
$patterns = array(
'#http://((m|www)\.)?youtube\.com/watch.*#i',
'#https://((m|www)\.)?youtube\.com/watch.*#i',
'#http://((m|www)\.)?youtube\.com/playlist.*#i',
'#https://((m|www)\.)?youtube\.com/playlist.*#i',
'#http://youtu\.be/.*#i',
'#https://youtu\.be/.*#i',
'#https?://(.+\.)?vimeo\.com/.*#i',
'#https?://(www\.)?dailymotion\.com/.*#i',
'#https?://dai.ly/*#i',
'#https?://(www\.)?hulu\.com/watch/.*#i',
'#https?://wordpress.tv/.*#i',
'#https?://(www\.)?funnyordie\.com/videos/.*#i',
'#https?://vine.co/v/.*#i',
'#https?://(www\.)?collegehumor\.com/video/.*#i',
'#https?://(www\.|embed\.)?ted\.com/talks/.*#i'
);
$patterns = apply_filters( 'kadence_maybe_wrap_embed_patterns', $patterns );
foreach ( $patterns as $pattern ) {
$do_wrap = preg_match( $pattern, $url );
if ( $do_wrap ) {
return '<div class="entry-content-asset videofit">' . $cache . '</div>';
}
}
}
return $cache;
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'get_version' => array( $this, 'get_version' ),
'get_asset_version' => array( $this, 'get_asset_version' ),
'get_post_types' => array( $this, 'get_post_types' ),
'get_post_types_objects' => array( $this, 'get_post_types_objects' ),
'get_post_types_to_ignore' => array( $this, 'get_post_types_to_ignore' ),
'get_transparent_post_types_to_ignore' => array( $this, 'get_transparent_post_types_to_ignore' ),
'get_public_post_types_to_ignore' => array( $this, 'get_public_post_types_to_ignore' ),
'customizer_quick_link' => array( $this, 'customizer_quick_link' ),
);
}
/**
* If in customizer output the quicklink.
*/
public static function customizer_quick_link() {
if ( is_customize_preview() ) {
?>
<div class="customize-partial-edit-shortcut kadence-custom-partial-edit-shortcut">
<button aria-label="<?php esc_attr_e( 'Click to edit this element.', 'kadence' ); ?>" title="<?php esc_attr_e( 'Click to edit this element.', 'kadence' ); ?>" class="customize-partial-edit-shortcut-button item-customizer-focus"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M13.89 3.39l2.71 2.72c.46.46.42 1.24.03 1.64l-8.01 8.02-5.56 1.16 1.16-5.58s7.6-7.63 7.99-8.03c.39-.39 1.22-.39 1.68.07zm-2.73 2.79l-5.59 5.61 1.11 1.11 5.54-5.65zm-2.97 8.23l5.58-5.6-1.07-1.08-5.59 5.6z"></path></svg></button>
</div>
<?php
}
}
/**
* Get array of post types we want to exclude from use in customizer custom post type settings.
*
* @return array of post types.
*/
public static function get_post_types_to_ignore() {
if ( is_null( self::$ignore_post_types ) ) {
$ignore_post_types = array(
'post',
'page',
'product',
'kadence_element',
'kadence_adv_page',
'kadence_conversions',
'kadence_cloud',
'kadence_wootemplate',
'elementor_library',
'kt_size_chart',
'kt_cart_notice',
'kt_reviews',
'kt_product_tabs',
'ele-product-template',
'ele-p-arch-template',
'ele-p-loop-template',
'ele-check-template',
'shop_order',
'jet-menu',
'jet-popup',
'jet-smart-filters',
'jet-theme-core',
'jet-woo-builder',
'jet-engine',
'course',
'lesson',
'llms_quiz',
'llms_membership',
'llms_certificate',
'llms_my_certificate',
'sfwd-quiz',
'sfwd-certificates',
'sfwd-lessons',
'sfwd-topic',
'sfwd-transactions',
'sfwd-essays',
'sfwd-assignment',
'sfwd-courses',
'tutor_quiz',
'tutor_assignments',
'courses',
'groups',
'forum',
'topic',
'reply',
'tribe_events',
);
self::$ignore_post_types = apply_filters( 'kadence_customizer_post_type_ignore_array', $ignore_post_types );
}
return self::$ignore_post_types;
}
/**
* Get array of post types we want to exclude from use in customizer transparent header settings.
*
* @return array of post types.
*/
public static function get_transparent_post_types_to_ignore() {
if ( is_null( self::$transparent_ignore_post_types ) ) {
$transparent_ignore_post_types = array(
'post',
'page',
'product',
'kadence_element',
'kadence_adv_page',
'kadence_conversions',
'kadence_cloud',
'kadence_wootemplate',
'elementor_library',
'fl-theme-layout',
'kt_size_chart',
'kt_cart_notice',
'kt_reviews',
'kt_product_tabs',
'shop_order',
'ele-product-template',
'ele-p-arch-template',
'ele-p-loop-template',
'ele-check-template',
'jet-menu',
'jet-popup',
'jet-smart-filters',
'jet-theme-core',
'jet-woo-builder',
'jet-engine',
'llms_certificate',
'llms_my_certificate',
'sfwd-quiz',
'ld-exam',
'sfwd-certificates',
'sfwd-lessons',
'sfwd-topic',
'sfwd-transactions',
'sfwd-essays',
'sfwd-assignment',
'tutor_quiz',
'tutor_assignments',
);
self::$transparent_ignore_post_types = apply_filters( 'kadence_transparent_post_type_ignore_array', $transparent_ignore_post_types );
}
return self::$transparent_ignore_post_types;
}
/**
* Get array of post types we want to exclude from use in non public areas.
*
* @return array of post types.
*/
public static function get_public_post_types_to_ignore() {
if ( is_null( self::$public_ignore_post_types ) ) {
$public_ignore_post_types = array(
'elementor_library',
'fl-theme-layout',
'kt_size_chart',
'kt_cart_notice',
'kt_reviews',
'kt_product_tabs',
'shop_order',
'kadence_element',
'kadence_adv_page',
'kadence_conversions',
'kadence_cloud',
'kadence_wootemplate',
'ele-product-template',
'ele-p-arch-template',
'ele-p-loop-template',
'ele-check-template',
'jet-menu',
'jet-popup',
'jet-smart-filters',
'jet-theme-core',
'jet-woo-builder',
'jet-engine',
'llms_certificate',
'llms_my_certificate',
'sfwd-certificates',
'sfwd-transactions',
'reply',
);
self::$public_ignore_post_types = apply_filters( 'kadence_public_post_type_ignore_array', $public_ignore_post_types );
}
return self::$public_ignore_post_types;
}
/**
* Get all public post types.
*
* @return array of post types.
*/
public static function get_post_types() {
if ( is_null( self::$post_types ) ) {
$args = array(
'public' => true,
'show_in_rest' => true,
'_builtin' => false,
);
$builtin = array(
'post',
'page',
);
$output = 'names'; // names or objects, note names is the default.
$operator = 'and';
$post_types = get_post_types( $args, $output, $operator );
self::$post_types = apply_filters( 'kadence_public_post_type_array', array_merge( $builtin, $post_types ) );
}
return self::$post_types;
}
/**
* Get all public post types.
*
* @return array of post types.
*/
public static function get_post_types_objects() {
if ( is_null( self::$post_types_objects ) ) {
$args = array(
'public' => true,
'_builtin' => false,
);
$output = 'objects'; // names or objects, note names is the default.
$operator = 'and';
$post_types = get_post_types( $args, $output, $operator );
self::$post_types_objects = apply_filters( 'kadence_public_post_type_objects', $post_types );
}
return self::$post_types_objects;
}
/**
* Adds theme support for essential features.
*/
public function action_essential_theme_support() {
if ( 'em' === kadence()->sub_option( 'content_width', 'unit' ) || 'rem' === kadence()->sub_option( 'content_width', 'unit' ) ) {
$kadence_content_width = intval( kadence()->sub_option( 'content_width', 'size' ) * 17 );
} else {
$kadence_content_width = kadence()->sub_option( 'content_width', 'size' );
}
$GLOBALS['content_width'] = intval( $kadence_content_width ); // phpcs:ignore WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedVariableFound
// Add default RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Ensure WordPress manages the document title.
add_theme_support( 'title-tag' );
// Ensure WordPress theme features render in HTML5 markup.
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'script',
'style',
)
);
add_theme_support( 'custom-units' );
add_theme_support( 'custom-line-height' );
// Add support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add support for responsive embedded content.
add_theme_support( 'responsive-embeds' );
if ( ! kadence()->option( 'post_comments_date' ) ) {
add_filter( 'get_comment_date', array( $this, 'remove_comment_date' ), 20, 3 );
add_filter( 'get_comment_time', array( $this, 'remove_comment_time' ), 20, 5 );
}
}
/**
* Adds a tiny script to remove no-js class.
*/
public function action_add_no_js_remove_script() {
if ( ! kadence()->is_amp() ) {
?>
<script>document.documentElement.classList.remove( 'no-js' );</script>
<?php
}
}
/**
* Adds a tiny script to set scrollbar offset.
*/
public function action_add_scrollbar_offset_script() {
if ( ! kadence()->is_amp() ) {
?>
<script>document.documentElement.style.setProperty('--scrollbar-offset', window.innerWidth - document.documentElement.clientWidth + 'px' );</script>
<?php
}
}
/**
* Adds a pingback url auto-discovery header for singularly identifiable articles.
*/
public function action_add_pingback_header() {
if ( is_singular() && pings_open() ) {
echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">';
}
}
/**
* Add
*
* @param string $markup search form markup.
*
* @return mixed
*/
public function add_search_icon( $markup ) {
$markup = str_replace( '</form>', '<div class="kadence-search-icon-wrap">' . kadence()->get_icon( 'search', '', false ) . '</div></form>', $markup );
return $markup;
}
/**
* Adds a 'hfeed' class to the array of body classes for non-singular pages.
*
* @param array $classes Classes for the body element.
* @return array Filtered body classes.
*/
public function filter_body_classes_add_hfeed( array $classes ) : array {
// Check if we should add the hfeed class.
if ( ! kadence()->option( 'microdata' ) || ! apply_filters( 'kadence_microdata', true, 'body-class' ) ) {
return $classes;
}
if ( ! is_singular() ) {
$classes[] = 'hfeed';
}
return $classes;
}
/**
* Adds a link style class to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array Filtered body classes.
*/
public function filter_body_classes_add_link_style( array $classes ) : array {
if ( ! kadence()->option( 'enable_scroll_to_id' ) ) {
$classes[] = 'no-anchor-scroll';
}
if ( kadence()->option( 'enable_footer_on_bottom' ) ) {
$classes[] = 'footer-on-bottom';
}
if ( kadence()->option( 'enable_popup_body_animate' ) ) {
$classes[] = 'animate-body-popup';
}
if ( '' !== kadence()->option( 'header_social_brand' ) || '' !== kadence()->option( 'header_mobile_social_brand' ) || '' !== kadence()->option( 'footer_social_brand' ) ) {
$classes[] = 'social-brand-colors';
}
$classes[] = 'hide-focus-outline';
$classes[] = 'link-style-' . kadence()->sub_option( 'link_color', 'style' );
return $classes;
}
/**
* Sets the embed width in pixels, based on the theme's design and stylesheet.
*
* @param array $dimensions An array of embed width and height values in pixels (in that order).
* @return array Filtered dimensions array.
*/
public function filter_embed_dimensions( array $dimensions ) : array {
$dimensions['width'] = 720;
return $dimensions;
}
/**
* Excludes any directory named 'optional' from being scanned for theme template files.
*
* @link https://developer.wordpress.org/reference/hooks/theme_scandir_exclusions/
*
* @param array $exclusions the default directories to exclude.
* @return array Filtered exclusions.
*/
public function filter_scandir_exclusions_for_optional_templates( array $exclusions ) : array {
return array_merge(
$exclusions,
array( 'optional' )
);
}
/**
* Adds async/defer attributes to enqueued / registered scripts.
*
* If #12009 lands in WordPress, this function can no-op since it would be handled in core.
*
* @link https://core.trac.wordpress.org/ticket/12009
*
* @param string $tag The script tag.
* @param string $handle The script handle.
* @return string Script HTML string.
*/
public function filter_script_loader_tag( $tag, $handle ) {
foreach ( array( 'async', 'defer' ) as $attr ) {
if ( ! wp_scripts()->get_data( $handle, $attr ) ) {
continue;
}
// Prevent adding attribute when already added in #12009.
if ( ! preg_match( ":\s$attr(=|>|\s):", $tag ) ) {
$tag = preg_replace( ':(?=></script>):', " $attr", $tag, 1 );
}
// Only allow async or defer, not both.
break;
}
return $tag;
}
/**
* Gets the theme version.
*
* @return string Theme version number.
*/
public function get_version() : string {
static $theme_version = null;
if ( null === $theme_version ) {
$theme_version = wp_get_theme( get_template() )->get( 'Version' );
}
return $theme_version;
}
/**
* Gets the version for a given asset.
*
* Returns filemtime when WP_DEBUG is true, otherwise the theme version.
*
* @param string $filepath Asset file path.
* @return string Asset version number.
*/
public function get_asset_version( string $filepath ) : string {
if ( WP_DEBUG ) {
return (string) filemtime( $filepath );
}
return $this->get_version();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
<?php
/**
* Kadence\Beaver\Component class
*
* @package kadence
*/
namespace Kadence\Beaver;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function have_posts;
use function the_post;
use function is_search;
use function get_template_part;
use function get_post_type;
use FLBuilderModel;
/**
* Class for adding Woocommerce plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'beaver';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_filter( 'kadence_entry_content_class', array( $this, 'filter_content_entry_class' ) );
}
/**
* Filters the content entry class for beaver builder so css doesn't conflict.
*
* @param string $class the entry container class.
*/
public function filter_content_entry_class( $class ) {
if ( FLBuilderModel::is_builder_enabled() ) {
$class = 'entry-content';
}
return $class;
}
}

View File

@@ -0,0 +1,101 @@
<?php
/**
* Kadence\BeaverThemer\Component class
*
* @package kadence
*/
namespace Kadence\BeaverThemer;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function add_theme_support;
use function have_posts;
use function the_post;
use function is_search;
use function get_template_part;
use function get_post_type;
use FLThemeBuilderLayoutData;
/**
* Class for adding Woocommerce plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'beaverthemer';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'after_setup_theme', array( $this, 'action_add_beaver_support' ) );
add_filter( 'fl_theme_builder_part_hooks', array( $this, 'register_part_hooks' ) );
add_action( 'wp', array( $this, 'header_footer_render' ) );
}
/**
* Adds theme support for the Beaver builder plugin.
*/
public function action_add_beaver_support() {
add_theme_support( 'fl-theme-builder-headers' );
add_theme_support( 'fl-theme-builder-footers' );
add_theme_support( 'fl-theme-builder-parts' );
}
/**
* Adds theme support for the Beaver hooks.
*/
public function header_footer_render() {
// Get the header ID.
$header_ids = FLThemeBuilderLayoutData::get_current_page_header_ids();
// If we have a header, remove the theme header and hook in Theme Builder's.
if ( ! empty( $header_ids ) ) {
remove_action( 'kadence_header', 'Kadence\header_markup' );
add_action( 'kadence_header', 'FLThemeBuilderLayoutRenderer::render_header' );
}
// Get the footer ID.
$footer_ids = FLThemeBuilderLayoutData::get_current_page_footer_ids();
// If we have a footer, remove the theme footer and hook in Theme Builder's.
if ( ! empty( $footer_ids ) ) {
remove_action( 'kadence_footer', 'Kadence\footer_markup' );
add_action( 'kadence_footer', 'FLThemeBuilderLayoutRenderer::render_footer' );
}
}
/**
* Adds theme support for the Beaver hooks.
*/
public function register_part_hooks() {
return array(
array(
'label' => 'Header',
'hooks' => array(
'kadence_before_header' => 'Before Header',
'kadence_after_header' => 'After Header',
),
),
array(
'label' => 'Content',
'hooks' => array(
'kadence_before_main_content' => 'Before Content',
'kadence_after_main_content' => 'After Content',
),
),
array(
'label' => 'Footer',
'hooks' => array(
'kadence_before_footer' => 'Before Footer',
'kadence_after_footer' => 'After Footer',
),
),
);
}
}

View File

@@ -0,0 +1,823 @@
<?php
/**
* Kadence\Breadcrumbs\Component class
*
* @package kadence
*/
namespace Kadence\Breadcrumbs;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function Kadence\kadence;
use WPSEO_Primary_Term;
use WPSEO_Taxonomy_Meta;
use WP_Post;
use function add_action;
use function add_filter;
use function wp_enqueue_script;
use function get_theme_file_uri;
use function get_theme_file_path;
use function wp_script_add_data;
use function wp_localize_script;
use function rank_math_the_breadcrumbs;
use function yoast_breadcrumb;
use function seopress_display_breadcrumbs;
use function is_bbpress;
use function bbp_breadcrumb;
/**
* Class for adding custom header support.
*
* Exposes template tags:
* * `kadence()->get_breadcrumb()`
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Instance Control
*
* @var array
*/
protected static $instance = null;
/**
* Breadcrumb separator.
*
* @var string/null
*/
private $sep = null;
/**
* Breadcrumb link.
*
* @var string/null
*/
private $link = null;
/**
* Breadcrumb settings.
*
* @var array
*/
private $settings = array();
/**
* Local breadcrumb args.
*
* @var array
*/
private $args = array();
/**
* Breadcrumb post types.
*
* @var array
*/
private $post_types = array();
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'breadcrumbs';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'get_breadcrumb' => array( $this, 'get_breadcrumb' ),
'print_breadcrumb' => array( $this, 'print_breadcrumb' ),
);
}
/**
* Get the breadcrumbs.
*
* @param array $args Arguments.
*/
public function print_breadcrumb( $args = array() ) {
if ( 'rankmath' === kadence()->option( 'breadcrumb_engine' ) ) {
if ( function_exists( 'rank_math_the_breadcrumbs' ) ) {
echo '<div class="kadence-breadcrumbs rankmath-bc-wrap">';
rank_math_the_breadcrumbs();
echo '</div>';
}
} elseif ( 'yoast' === kadence()->option( 'breadcrumb_engine' ) ) {
if ( function_exists( 'yoast_breadcrumb' ) ) {
yoast_breadcrumb( '<div class="kadence-breadcrumbs yoast-bc-wrap">','</div>' );
}
} elseif ( 'seopress' === kadence()->option( 'breadcrumb_engine' ) ) {
if ( function_exists( 'seopress_display_breadcrumbs' ) ) {
echo '<div class="kadence-breadcrumbs seopress-bc-wrap">';
seopress_display_breadcrumbs();
echo '</div>';
}
} else {
if ( function_exists( 'is_bbpress' ) && is_bbpress() && function_exists( 'bbp_breadcrumb' ) ) {
echo '<div class="kadence-breadcrumbs bbpress-topic-meta">';
bbp_breadcrumb();
echo '</div>';
} else {
echo kadence()->get_breadcrumb( $args );
}
}
}
/**
* Get the breadcrumbs.
*
* @param array $args Arguments.
* @return string
*/
public function get_breadcrumb( $args = array() ) {
$this->args = apply_filters(
'kadence_local_breadcrumb_args',
wp_parse_args(
$args,
array(
'home_title' => __( 'Home', 'kadence' ),
'404_title' => __( 'Error 404', 'kadence' ),
'search_title' => __( 'Search results for', 'kadence' ),
'page' => __( 'Page', 'kadence' ),
'show_shop' => true,
'show_title' => true,
'color_style' => '',
'blog_id' => '',
'portfolio_id' => '',
'staff_id' => '',
'testimonial_id' => '',
'gallery_id' => 'none',
)
)
);
$this->settings = wp_parse_args(
apply_filters( 'kadence_breadcrumb_args', array() ),
array(
'home' => true,
'home_icon' => kadence()->option( 'breadcrumb_home_icon' ),
'before' => '<span class="kadence-bread-current">',
'after' => '</span>',
'home_link' => home_url( '/' ),
'wrap_before' => '<nav id="kadence-breadcrumbs" aria-label="' . esc_attr__( 'Breadcrumbs', 'kadence' ) . '" class="kadence-breadcrumbs"><div class="kadence-breadcrumb-container"' . ( $this->args['color_style'] ? ' style="' . esc_attr( $this->args['color_style'] ) . '"' : '' ) . '>',
'wrap_after' => '</div></nav>',
'delimiter' => apply_filters( 'kadence_breadcrumb_delimiter', '/' ),
'delimiter_before' => '<span class="bc-delimiter">',
'delimiter_after' => '</span>',
'link_before' => '<span>',
'link_after' => '</span>',
'link_in_before' => '<span>',
'link_in_after' => '</span>',
)
);
$this->post_types = wp_parse_args(
apply_filters( 'kadence_breadcrumb_post_types', array() ),
array(
'product' => array(
'post_type' => 'product',
'taxonomy' => 'product_cat',
'archive_page' => 'shop',
'archive_label' => '',
),
'portfolio' => array(
'post_type' => 'portfolio',
'taxonomy' => 'portfolio-type',
'archive_page' => $this->args['portfolio_id'],
'archive_label' => '',
),
'post' => array(
'post_type' => 'post',
'taxonomy' => 'category',
'archive_page' => $this->args['blog_id'],
'archive_label' => '',
),
'staff' => array(
'post_type' => 'staff',
'taxonomy' => 'staff-group',
'archive_page' => $this->args['staff_id'],
'archive_label' => '',
),
'testimonial' => array(
'post_type' => 'testimonial',
'taxonomy' => 'testimonial-group',
'archive_page' => $this->args['testimonial_id'],
'archive_label' => '',
),
'kt_gallery' => array(
'post_type' => 'kt_gallery',
'taxonomy' => 'kt_album',
'archive_page' => $this->args['gallery_id'],
'archive_label' => '',
),
'tribe_events' => array(
'post_type' => 'tribe_events',
'taxonomy' => 'tribe_events_cat',
'archive_page' => 'tribe_events',
'archive_label' => '',
),
'event' => array(
'post_type' => 'event',
'taxonomy' => 'event-category',
'archive_page' => '',
'archive_label' => '',
),
'podcast' => array(
'post_type' => 'podcast',
'taxonomy' => 'series',
'archive_page' => '',
'archive_label' => '',
),
'course' => array(
'post_type' => 'course',
'taxonomy' => 'course_cat',
'archive_page' => get_option( 'lifterlms_shop_page_id' ),
'archive_label' => '',
),
'lesson' => array(
'post_type' => 'lesson',
'taxonomy' => '',
'custom' => 'liferlms',
'archive_page' => get_option( 'lifterlms_shop_page_id' ),
'archive_label' => '',
),
'ht_kb' => array(
'post_type' => 'ht_kb',
'taxonomy' => 'ht_kb_category',
'archive_page' => 'archive',
'archive_label' => esc_html__( 'Knowledge Base', 'kadence' ),
),
)
);
$html = '';
if ( ! is_front_page() ) {
$html .= $this->settings['wrap_before'];
if ( $this->settings['home'] ) {
$html .= $this->get_crumbs_frontpage() . $this->get_sep();
}
$html = apply_filters( 'kadence_breadcrumbs_after_home', $html );
if ( is_home() ) {
$html .= $this->get_crumbs_home();
} elseif ( is_404() ) {
$html .= $this->get_crumbs_404();
} elseif ( is_search() ) {
$html .= $this->get_crumbs_search();
} elseif ( is_attachment() ) {
$html .= $this->get_crumbs_attachment();
} elseif ( function_exists( 'is_shop' ) && is_shop() ) {
$html .= $this->get_crumbs_shop();
} elseif ( is_single() ) {
$html .= $this->get_crumbs_single();
} elseif ( is_page() ) {
$html .= $this->get_crumbs_page();
} elseif ( is_singular() && ! is_attachment() ) {
$html .= $this->get_crumbs_single();
} elseif ( function_exists( 'is_product_category' ) && is_product_category() ) {
$html .= $this->get_crumbs_product_category();
} elseif ( function_exists( 'is_product_tag' ) && is_product_tag() ) {
$html .= $this->get_crumbs_product_tag();
} elseif ( $this->is_wc_attribute() ) {
$html .= $this->get_crumbs_product_attribute();
} elseif ( function_exists( 'dokan_is_store_page' ) && dokan_is_store_page() ) {
$html .= $this->get_crumbs_dokan_store();
} elseif ( is_category() ) {
$html .= $this->get_crumbs_category();
} elseif ( is_tag() ) {
$html .= $this->get_crumbs_tag();
} elseif ( is_tax() ) {
$html .= $this->get_crumbs_tax();
} elseif ( is_date() ) {
$html .= $this->get_crumbs_date();
} elseif ( is_author() ) {
$html .= $this->get_crumbs_author();
} elseif ( is_archive() ) {
$html .= $this->get_crumbs_archive();
} else {
$html .= $this->settings['before'] . get_the_title() . $this->settings['after'];
}
if ( get_query_var( 'paged' ) ) {
$html .= ' - ' . $this->args['page'] . ' ' . esc_html( get_query_var( 'paged' ) );
}
$html .= $this->settings['wrap_after'];
}
/**
* Change the breadcrumbs HTML output.
*
* @param string $html HTML output.
*/
return apply_filters( 'kadence_breadcrumb_html', $html );
}
/**
* Check for wc_attribute_archive.
*/
public function is_wc_attribute() {
/**
* Attributes are proper taxonomies, therefore first thing is
* to check if we are on a taxonomy page using the is_tax().
* Also, a further check if the taxonomy_is_product_attribute
* function exists is necessary, in order to ensure that this
* function does not produce fatal errors when the WooCommerce
* is not activated
*/
if ( is_tax() && function_exists( 'taxonomy_is_product_attribute') ) {
// now we know for sure that the queried object is a taxonomy
$tax_obj = get_queried_object();
return taxonomy_is_product_attribute( $tax_obj->taxonomy );
}
return false;
}
/**
* Get Separator
*/
public function get_sep() {
if ( is_null( $this->sep ) ) {
$this->sep = ' ' . $this->settings['delimiter_before'] . $this->settings['delimiter'] . $this->settings['delimiter_after'] . ' ';
}
return $this->sep;
}
/**
* Get link string
*/
public function get_link() {
if ( is_null( $this->link ) ) {
$this->link = $this->settings['link_before'] . '<a href="%1$s" itemprop="url" ' . ( $this->args['color_style'] ? 'style="' . esc_attr( $this->args['color_style'] ) . '"' : '' ) . '>' . $this->settings['link_in_before'] . '%2$s' . $this->settings['link_in_after'] . '</a>' . $this->settings['link_after'];
}
return $this->link;
}
/**
* Get Breadcrumb Term Title
*
* @param object $term the current term.
*/
private function get_breadcrumb_term_title( $term ) {
$title = '';
if ( class_exists( 'WPSEO_Taxonomy_Meta' ) ) {
$title = WPSEO_Taxonomy_Meta::get_term_meta( $term, $term->taxonomy, 'bctitle' );
} elseif ( class_exists( 'RankMath' ) ) {
$title = get_metadata( 'term', $term->term_id, 'rank_math_breadcrumb_title', false );
if ( is_array( $title ) && ! empty( $title ) ) {
$title = $title[0];
}
}
if ( ! is_string( $title ) || '' === $title ) {
$title = $term->name;
}
return $title;
}
/**
* Get Home Breadcrumb
*/
private function get_crumbs_frontpage() {
if ( $this->settings['home_icon'] ) {
$output = $this->settings['link_before'] . '<a href="' . esc_url( $this->settings['home_link'] ) . '" title="'. esc_attr( $this->args['home_title'] ) . '" itemprop="url" class="kadence-bc-home kadence-bc-home-icon" ' . ( $this->args['color_style'] ? 'style="' . esc_attr( $this->args['color_style'] ) . '"' : '' ) . '>' . $this->settings['link_in_before'] . kadence()->get_icon( 'home' ) . $this->settings['link_in_after'] . '</a>' . $this->settings['link_after'];
} else {
$output = $this->settings['link_before'] . '<a href="' . esc_url( $this->settings['home_link'] ) . '" itemprop="url" class="kadence-bc-home" ' . ( $this->args['color_style'] ? 'style="' . esc_attr( $this->args['color_style'] ) . '"' : '' ) . '>' . $this->settings['link_in_before'] . esc_html( $this->args['home_title'] ) . $this->settings['link_in_after'] . '</a>' . $this->settings['link_after'];
}
return $output;
}
/**
* Get Home Breadcrumb
*/
private function get_crumbs_home() {
return $this->settings['before'] . get_the_title( get_option( 'page_for_posts' ) ) . $this->settings['after'];
}
/**
* Get 404 Breadcrumb
*/
private function get_crumbs_404() {
return $this->settings['before'] . $this->args['404_title'] . $this->settings['after'];
}
/**
* Get search Breadcrumb
*/
private function get_crumbs_search() {
$html = '';
if ( array_key_exists( 'ht-kb-search', $_REQUEST ) ) {
if ( $this->post_types['ht_kb']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['ht_kb']['archive_page'], $this->post_types['ht_kb']['archive_label'] );
}
}
return $html . $this->settings['before'] . $this->args['search_title'] . ' "' . get_search_query() . '"' . $this->settings['after'];
}
/**
* Get attachment Breadcrumb
*/
private function get_crumbs_attachment() {
global $post;
$parent_id = $post->post_parent;
$html = '';
$parentcrumbs = array();
if ( $parent_id ) {
while ( $parent_id ) {
$page = get_page( $parent_id );
$parentcrumbs[] = sprintf( $this->get_link(), get_permalink( $page->ID ), get_the_title( $page->ID ) ) . $this->get_sep();
$parent_id = $page->post_parent;
}
}
$parentcrumbs = array_reverse( $parentcrumbs );
foreach ( $parentcrumbs as $parentcrumb ) {
$html .= $parentcrumb;
}
$html .= $this->settings['before'] . get_the_title() . $this->settings['after'];
return $html;
}
/**
* Get shop page Breadcrumb
*/
private function get_crumbs_shop() {
$shop_page_id = wc_get_page_id( 'shop' );
$page_title = get_the_title( $shop_page_id );
return $this->settings['before'] . $page_title . $this->settings['after'];
}
/**
* Get shop Breadcrumb
*/
private function get_shop_crumb() {
$shop_page_id = wc_get_page_id( 'shop' );
$shop_page = get_post( $shop_page_id );
$shop_bread = '';
if ( get_option( 'page_on_front' ) !== $shop_page_id ) {
$shop_bread = sprintf( $this->get_link(), get_permalink( $shop_page ), get_the_title( $shop_page_id ) ) . $this->get_sep();
}
return $shop_bread;
}
/**
* Get product category
*/
private function get_crumbs_product_category() {
$html = '';
if ( $this->args['show_shop'] ) {
$html .= $this->get_shop_crumb();
}
$ancestors = get_ancestors( get_queried_object()->term_id, 'product_cat' );
$ancestors = array_reverse( $ancestors );
foreach ( $ancestors as $ancestor ) {
$ancestor = get_term( $ancestor, 'product_cat' );
$html .= sprintf( $this->get_link(), get_term_link( $ancestor->slug, 'product_cat' ), $this->get_breadcrumb_term_title( $ancestor ) ) . $this->get_sep();
}
return $html . $this->settings['before'] . $this->get_breadcrumb_term_title( get_queried_object() ) . $this->settings['after'];
}
/**
* Get product tag
*/
private function get_crumbs_product_tag() {
$html = '';
if ( $this->args['show_shop'] ) {
$html .= $this->get_shop_crumb();
}
return $html . $this->settings['before'] . $this->get_breadcrumb_term_title( get_queried_object() ) . $this->settings['after'];
}
/**
* Get product attributes.
*/
private function get_crumbs_product_attribute() {
$html = '';
if ( $this->args['show_shop'] ) {
$html .= $this->get_shop_crumb();
}
return $html . $this->settings['before'] . $this->get_breadcrumb_term_title( get_queried_object() ) . $this->settings['after'];
}
/**
* Get dokan store.
*/
private function get_crumbs_dokan_store() {
$html = '';
$store_user = dokan()->vendor->get( get_query_var( 'author' ) );
return $html . $this->settings['before'] . $store_user->get_shop_name() . $this->settings['after'];
}
/**
* Check if has post archive.
*
* @param string $post_type the post type.
*/
private function check_has_archive( $post_type ) {
if ( ! isset( $post_type ) ) {
return false;
}
// find custom post types with archives.
$args = array(
'has_archive' => true,
'_builtin' => false,
);
$output = 'names';
$archived_custom_post_types = get_post_types( $args, $output );
// if there are no custom post types, then the current post can't be one.
if ( empty( $archived_custom_post_types ) ) {
return false;
}
// check if post type is a supports archives.
if ( in_array( $post_type, $archived_custom_post_types ) ) {
return true;
} else {
return false;
}
// if all else fails, return false.
return false;
}
/**
* Get archive Breadcrumb
*
* @param mixed $archive_page the archive page for breadcrumbs.
* @param string $archive_label the archive page label for breadcrumbs.
*/
private function get_archive_crumb( $archive_page, $archive_label = '' ) {
$html = '';
if ( is_numeric( $archive_page ) ) {
// Check if page ID.
$parent_page_link = get_page_link( $archive_page );
if ( $parent_page_link ) {
$html .= sprintf( $this->get_link(), $parent_page_link, get_the_title( $archive_page ) ) . $this->get_sep();
}
} elseif ( 'shop' === $archive_page ) {
if ( ! is_archive() && ! $this->args['show_shop'] ) {
$html .= '';
} else {
$html .= $this->get_shop_crumb();
}
} elseif ( 'tribe_events' === $archive_page ) {
// Check for tribe.
$html .= sprintf( $this->get_link(), tribe_get_events_link(), tribe_get_event_label_plural() ) . $this->get_sep();
} elseif ( 'none' === $archive_page ) {
// Check for none.
$html .= '';
} elseif ( 'archive' === $archive_page ) {
$parent_title = ( ! empty( $archive_label ) ? $archive_label : 'Archive' );
$html .= sprintf( $this->get_link(), get_post_type_archive_link( get_post_type() ), $parent_title ) . $this->get_sep();
} elseif ( filter_var( $archive_page, FILTER_VALIDATE_URL ) ) {
// Check if url.
$parent_title = ( ! empty( $archive_label ) ? $archive_label : 'Archive' );
$html .= sprintf( $this->get_link(), $archive_page, $parent_title ) . $this->get_sep();
} elseif ( $this->check_has_archive( get_post_type() ) ) {
$post_type_obj = get_post_type_object( get_post_type() );
$parent_title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, get_post_type() );
$html .= sprintf( $this->get_link(), get_post_type_archive_link( get_post_type() ), $parent_title ) . $this->get_sep();
}
return $html;
}
/**
* Get main tax.
*
* @param string $taxonomy the taxonomy name.
* @param number $post_id the post id.
*/
private function get_taxonomy_main( $taxonomy, $post_id ) {
$main_term = '';
$terms = wp_get_post_terms(
$post_id,
$taxonomy,
array(
'orderby' => 'parent',
'order' => 'DESC',
)
);
if ( $terms && ! is_wp_error( $terms ) ) {
if ( is_array( $terms ) ) {
$main_term = $terms[0];
}
}
return $main_term;
}
/**
* Get tax Breadcrumb
*
* @param string $taxonomy the taxonomy type for breadcrumbs.
*/
private function get_taxonomy_crumb( $taxonomy ) {
global $post;
$html = '';
$main_term = '';
if ( class_exists( 'WPSEO_Primary_Term' ) ) {
$wpseo_term = new WPSEO_Primary_Term( $taxonomy, $post->ID );
$wpseo_term = $wpseo_term->get_primary_term();
$wpseo_term = get_term( $wpseo_term );
if ( is_wp_error( $wpseo_term ) ) {
$main_term = $this->get_taxonomy_main( $taxonomy, $post->ID );
} else {
$main_term = $wpseo_term;
}
} elseif ( class_exists( 'RankMath' ) ) {
$wpseo_term = get_post_meta( $post->ID, 'rank_math_primary_' . $taxonomy, true );
if ( $wpseo_term ) {
$wpseo_term = get_term( $wpseo_term );
if ( is_wp_error( $wpseo_term ) ) {
$main_term = $this->get_taxonomy_main( $taxonomy, $post->ID );
} else {
$main_term = $wpseo_term;
}
} else {
$main_term = $this->get_taxonomy_main( $taxonomy, $post->ID );
}
} else {
$main_term = $this->get_taxonomy_main( $taxonomy, $post->ID );
}
if ( $main_term && ! is_wp_error( $main_term ) ) {
$ancestors = get_ancestors( $main_term->term_id, $taxonomy );
$ancestors = array_reverse( $ancestors );
foreach ( $ancestors as $ancestor ) {
$ancestor = get_term( $ancestor, $taxonomy );
$html .= sprintf( $this->get_link(), get_term_link( $ancestor->slug, $taxonomy ), $this->get_breadcrumb_term_title( $ancestor ) ) . $this->get_sep();
}
$term_link = get_term_link( $main_term->slug, $taxonomy );
if ( $term_link && ! is_wp_error( $term_link ) ) {
$html .= sprintf( $this->get_link(), $term_link, $this->get_breadcrumb_term_title( $main_term ) ) . $this->get_sep();
}
}
return $html;
}
/**
* Get Custom Breadcrumb
*
* @param string $custom the custom string for breadcrumbs.
*/
private function get_custom_crumb( $custom ) {
global $post;
$html = '';
if ( 'liferlms' === $custom ) {
$parent_course = get_post_meta( $post->ID, '_llms_parent_course', true );
if ( $parent_course ) {
$html .= sprintf( $this->get_link(), get_permalink( $parent_course ), get_the_title( $parent_course ) ) . $this->get_sep();
}
}
return $html;
}
/**
* Get category
*/
private function get_crumbs_category() {
$html = '';
if ( $this->post_types['post']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['post']['archive_page'], $this->post_types['post']['archive_label'] );
}
$ancestors = get_ancestors( get_queried_object()->term_id, 'category' );
$ancestors = array_reverse( $ancestors );
foreach ( $ancestors as $ancestor ) {
$ancestor = get_term( $ancestor, 'category' );
$html .= sprintf( $this->get_link(), get_term_link( $ancestor->slug, 'category' ), $this->get_breadcrumb_term_title( $ancestor ) ) . $this->get_sep();
}
$title_output = ( $this->args['show_title'] ? $this->settings['before'] . $this->get_breadcrumb_term_title( get_queried_object() ) . $this->settings['after'] : '' );
return $html . $title_output;
}
/**
* Get tag
*/
private function get_crumbs_tag() {
$html = '';
if ( $this->post_types['post']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['post']['archive_page'], $this->post_types['post']['archive_label'] );
}
$title_output = ( $this->args['show_title'] ? $this->settings['before'] . $this->get_breadcrumb_term_title( get_queried_object() ) . $this->settings['after'] : '' );
return $html . $title_output;
}
/**
* Get author
*/
private function get_crumbs_author() {
global $author;
$html = '';
if ( $this->post_types['post']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['post']['archive_page'], $this->post_types['post']['archive_label'] );
}
$userdata = get_userdata( $author );
$title_output = ( $this->args['show_title'] ? $this->settings['before'] . $userdata->display_name . $this->settings['after'] : '' );
return $html . $title_output;
}
/**
* Get author
*/
private function get_crumbs_archive() {
$html = '';
$title_output = ( $this->args['show_title'] ? $this->settings['before'] . get_the_archive_title() . $this->settings['after'] : '' );
return $html . $title_output;
}
/**
* Get date
*/
private function get_crumbs_date() {
$html = '';
if ( $this->post_types['post']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['post']['archive_page'], $this->post_types['post']['archive_label'] );
}
if ( is_day() ) {
$html .= sprintf( $this->get_link(), get_year_link( get_the_time( 'Y' ) ), get_the_time( 'Y' ) ) . $this->get_sep();
$html .= sprintf( $this->get_link(), get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ), get_the_time( 'F' ) ) . $this->get_sep();
$title = get_the_time( 'd' );
} elseif ( is_month() ) {
$html .= sprintf( $this->get_link(), get_year_link( get_the_time( 'Y' ) ), get_the_time( 'Y' ) ) . $this->get_sep();
$title = get_the_time( 'F' );
} else {
$title = get_the_time( 'Y' );
}
$title_output = ( $this->args['show_title'] ? $this->settings['before'] . $title . $this->settings['after'] : '' );
return $html . $title_output;
}
/**
* Get tax
*/
private function get_crumbs_tax() {
$html = '';
if ( is_tax( 'portfolio-type' ) || is_tax( 'portfolio-tag' ) ) {
if ( $this->post_types['portfolio']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['portfolio']['archive_page'], $this->post_types['portfolio']['archive_label'] );
}
} elseif ( is_tax( 'staff-group' ) ) {
if ( $this->post_types['staff']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['staff']['archive_page'], $this->post_types['staff']['archive_label'] );
}
} elseif ( is_tax( 'testimonial-group' ) ) {
if ( $this->post_types['testimonial']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['testimonial']['archive_page'], $this->post_types['testimonial']['archive_label'] );
}
} elseif ( is_tax( 'event-category' ) ) {
if ( $this->post_types['event']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['event']['archive_page'], $this->post_types['event']['archive_label'] );
}
} elseif ( is_tax( 'series' ) ) {
if ( $this->post_types['podcast']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['podcast']['archive_page'], $this->post_types['podcast']['archive_label'] );
}
} elseif ( is_tax( 'ht_kb_category' ) ) {
if ( $this->post_types['ht_kb']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['ht_kb']['archive_page'], $this->post_types['ht_kb']['archive_label'] );
}
} elseif ( is_tax( 'course_cat' ) || is_tax( 'course_tag' ) || is_tax( 'course_track' ) ) {
if ( $this->post_types['course']['archive_page'] ) {
$html .= $this->get_archive_crumb( $this->post_types['course']['archive_page'], $this->post_types['course']['archive_label'] );
}
}
$title = ( $this->args['show_title'] ? $this->settings['before'] . $this->get_breadcrumb_term_title( get_queried_object() ) . $this->settings['after'] : '' );
return $html . $title;
}
/**
* Get page
*/
private function get_crumbs_page() {
global $post;
$html = '';
$parent_id = $post->post_parent;
$parentcrumbs = array();
if ( $parent_id ) {
while ( $parent_id ) {
$page = get_page( $parent_id );
$parentcrumbs[] = sprintf( $this->get_link(), get_permalink( $page->ID ), get_the_title( $page->ID ) ) . $this->get_sep();
$parent_id = $page->post_parent;
}
}
$parentcrumbs = array_reverse( $parentcrumbs );
foreach ( $parentcrumbs as $parentcrumb ) {
$html .= $parentcrumb;
}
$title = ( $this->args['show_title'] ? $this->settings['before'] . get_the_title() . $this->settings['after'] : '' );
return $html . $title;
}
/**
* Get single
*/
private function get_crumbs_single() {
$html = '';
$post_type = get_post_type();
if ( isset( $this->post_types[ $post_type ] ) ) {
// Archive Page.
$html .= $this->get_archive_crumb( $this->post_types[ $post_type ]['archive_page'], $this->post_types[ $post_type ]['archive_label'] );
// Tax Page.
$html .= $this->get_taxonomy_crumb( $this->post_types[ $post_type ]['taxonomy'] );
// Custom Parent.
if ( isset( $this->post_types[ $post_type ]['custom'] ) ) {
$html .= $this->get_custom_crumb( $this->post_types[ $post_type ]['custom'] );
}
} else {
// Archive Page.
$html .= $this->get_archive_crumb( '', '' );
}
$title = ( $this->args['show_title'] ? $this->settings['before'] . get_the_title() . $this->settings['after'] : '' );
return $html . $title;
}
}

View File

@@ -0,0 +1,103 @@
<?php
/**
* Kadence\BuddyBoss\Component class
*
* @package kadence
*/
namespace Kadence\BuddyBoss;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function add_theme_support;
use function have_posts;
use function the_post;
use function is_search;
use function bp_core_get_directory_page_id;
use function bp_current_component;
/**
* Class for adding BuddyBoss plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'buddyboss';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_filter( 'kadence_post_layout', array( $this, 'filter_layout_for_component_pages' ) );
}
/**
* Filters the layout array to check the pages which are component pages for buddyboss
*
* @param string $layout the entry container class.
*/
public function filter_layout_for_component_pages( $layout ) {
if ( is_page() && bp_current_component() ) {
$component_id = bp_core_get_directory_page_id();
if ( $component_id ) {
// Layout.
$postlayout = get_post_meta( $component_id, '_kad_post_layout', true );
if ( isset( $postlayout ) && ( 'narrow' === $postlayout || 'fullwidth' === $postlayout ) ) {
$layout['layout'] = $postlayout;
}
// Sidebar ID.
$postsidebar = get_post_meta( $component_id, '_kad_post_sidebar_id', true );
if ( isset( $postsidebar ) && ! empty( $postsidebar ) && 'defualt' !== $postsidebar && 'default' !== $postsidebar ) {
$layout['sidebar_id'] = $postsidebar;
}
// Boxed Style.
$postboxed = get_post_meta( $component_id, '_kad_post_content_style', true );
if ( isset( $postboxed ) && ( 'unboxed' === $postboxed || 'boxed' === $postboxed ) ) {
$layout['boxed'] = $postboxed;
}
// Post Feature.
$postfeature = get_post_meta( $component_id, '_kad_post_feature', true );
if ( isset( $postfeature ) && ( 'show' === $postfeature || 'hide' === $postfeature ) ) {
$layout['feature'] = $postfeature;
}
// Post Feature position.
$postf_position = get_post_meta( $component_id, '_kad_post_feature_position', true );
if ( isset( $postf_position ) && ( 'above' === $postf_position || 'behind' === $postf_position || 'below' === $postf_position ) ) {
$layout['feature_position'] = $postf_position;
}
// Post title.
$posttitle = get_post_meta( $component_id, '_kad_post_title', true );
if ( isset( $posttitle ) && ( 'above' === $posttitle || 'normal' === $posttitle || 'hide' === $posttitle ) ) {
$layout['title'] = $posttitle;
}
// Post transparent.
$posttrans = get_post_meta( $component_id, '_kad_post_transparent', true );
if ( isset( $posttrans ) && ( 'enable' === $posttrans || 'disable' === $posttrans ) ) {
$layout['transparent'] = $posttrans;
}
// Post Vertical Padding.
$postvpadding = get_post_meta( $component_id, '_kad_post_vertical_padding', true );
if ( isset( $postvpadding ) && ( 'show' === $postvpadding || 'hide' === $postvpadding || 'top' === $postvpadding || 'bottom' === $postvpadding ) ) {
$layout['vpadding'] = $postvpadding;
}
// header.
$postheader = get_post_meta( $component_id, '_kad_post_header', true );
if ( isset( $postheader ) && true == $postheader ) {
$layout['header'] = 'disable';
}
// Footer.
$postfooter = get_post_meta( $component_id, '_kad_post_footer', true );
if ( isset( $postfooter ) && true == $postfooter ) {
$layout['footer'] = 'disable';
}
}
}
return $layout;
}
}

View File

@@ -0,0 +1,46 @@
<?php
/**
* Kadence\Clean_Frontend\Component class
*
* @package kadence
*/
namespace Kadence\Clean_Frontend;
use Kadence\Component_Interface;
use function add_action;
use function add_filter;
/**
* Class for adding custom functions to clean up the front end.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'clean_frontend';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_filter( 'excerpt_more', array( $this, 'excerpt_more' ) );
}
/**
* Removes strange box around ... in excerpts.
*
* @param string $more the excerpt more text.
*/
public function excerpt_more( $more ) {
if ( is_admin() ) {
return $more;
}
return '...';
}
}

View File

@@ -0,0 +1,162 @@
<?php
/**
* Kadence\Color_Palette\Component class
*
* @package kadence
*/
namespace Kadence\Color_Palette;
use Kadence\Component_Interface;
use Kadence_Control_Color_Palette;
use function Kadence\kadence;
use function add_action;
use function add_theme_support;
use function apply_filters;
/**
* Class for adding custom logo support.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'color_palette';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'customize_register', array( $this, 'color_palette_register' ), 80 );
add_action( 'after_setup_theme', array( $this, 'action_add_editor_support' ) );
}
/**
* Add settings
*
* @access public
* @param object $wp_customize the customizer object.
* @return void
*/
public function color_palette_register( $wp_customize ) {
$wp_customize->add_setting(
'kadence_global_palette',
array(
'transport' => 'postMessage',
'type' => 'option',
'default' => kadence()->get_palette_for_customizer(),
'capability' => apply_filters( 'kadence_palette_customizer_capability', 'manage_options' ),
'sanitize_callback' => 'wp_kses',
)
);
$wp_customize->add_control(
new Kadence_Control_Color_Palette(
$wp_customize,
'kadence_color_palette',
array(
'label' => __( 'Global Palette', 'kadence' ),
'description' => __( 'Learn how to use this', 'kadence' ),
'section' => 'kadence_customizer_general_colors',
'settings' => 'kadence_global_palette',
'priority' => 8,
)
)
);
}
/**
* Adds support for various editor features.
*/
public function action_add_editor_support() {
/**
* Add support for color palettes.
*/
add_theme_support(
'editor-color-palette',
array(
array(
'name' => __( 'Accent', 'kadence' ),
'slug' => 'theme-palette1',
'color' => kadence()->palette_option( 'palette1' ),
),
array(
'name' => __( 'Accent - alt', 'kadence' ),
'slug' => 'theme-palette2',
'color' => kadence()->palette_option( 'palette2' ),
),
array(
'name' => __( 'Strongest text', 'kadence' ),
'slug' => 'theme-palette3',
'color' => kadence()->palette_option( 'palette3' ),
),
array(
'name' => __( 'Strong Text', 'kadence' ),
'slug' => 'theme-palette4',
'color' => kadence()->palette_option( 'palette4' ),
),
array(
'name' => __( 'Medium text', 'kadence' ),
'slug' => 'theme-palette5',
'color' => kadence()->palette_option( 'palette5' ),
),
array(
'name' => __( 'Subtle Text', 'kadence' ),
'slug' => 'theme-palette6',
'color' => kadence()->palette_option( 'palette6' ),
),
array(
'name' => __( 'Subtle Background', 'kadence' ),
'slug' => 'theme-palette7',
'color' => kadence()->palette_option( 'palette7' ),
),
array(
'name' => __( 'Lighter Background', 'kadence' ),
'slug' => 'theme-palette8',
'color' => kadence()->palette_option( 'palette8' ),
),
array(
'name' => __( 'White or offwhite', 'kadence' ),
'slug' => 'theme-palette9',
'color' => kadence()->palette_option( 'palette9' ),
),
array(
'name' => __( 'Accent - Complement', 'kadence' ),
'slug' => 'theme-palette10',
'color' => kadence()->palette_option( 'palette10' ),
),
array(
'name' => __( 'Notices - Success', 'kadence' ),
'slug' => 'theme-palette11',
'color' => kadence()->palette_option( 'palette11' ),
),
array(
'name' => __( 'Notices - Info', 'kadence' ),
'slug' => 'theme-palette12',
'color' => kadence()->palette_option( 'palette12' ),
),
array(
'name' => __( 'Notices - Alert', 'kadence' ),
'slug' => 'theme-palette13',
'color' => kadence()->palette_option( 'palette13' ),
),
array(
'name' => __( 'Notices - Warning', 'kadence' ),
'slug' => 'theme-palette14',
'color' => kadence()->palette_option( 'palette14' ),
),
array(
'name' => __( 'Notices - Rating', 'kadence' ),
'slug' => 'theme-palette15',
'color' => kadence()->palette_option( 'palette15' ),
)
)
);
}
}

View File

@@ -0,0 +1,193 @@
<?php
/**
* Kadence\Comments\Component class
*
* @package kadence
*/
namespace Kadence\Comments;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function Kadence\kadence;
use function add_action;
use function apply_filters;
use function is_singular;
use function comments_open;
use function get_option;
use function wp_enqueue_script;
use function the_ID;
use function esc_attr;
use function wp_list_comments;
use function the_comments_navigation;
use function add_filter;
use function remove_filter;
/**
* Class for managing comments UI.
*
* Exposes template tags:
* * `kadence()->the_comments( array $args = [] )`
*
* @link https://wordpress.org/plugins/amp/
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'comments';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'wp_enqueue_scripts', array( $this, 'action_enqueue_comment_reply_script' ) );
add_filter( 'comment_form_default_fields', array( $this, 'filter_default_fields_markup' ) );
add_filter( 'comment_form_defaults', array( $this, 'filter_default_markup' ) );
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'the_comments' => array( $this, 'the_comments' ),
);
}
/**
* Enqueues the WordPress core 'comment-reply' script as necessary.
*/
public function action_enqueue_comment_reply_script() {
// If the AMP plugin is active, return early.
if ( kadence()->is_amp() ) {
return;
}
// Enqueue comment script on singular post/page views only.
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
/**
* Displays the list of comments for the current post.
*
* Internally this method calls `wp_list_comments()`. However, in addition to that it will render the wrapping
* element for the list, so that must not be added manually. The method will also take care of generating the
* necessary markup if amp-live-list should be used for comments.
*
* @param array $args Optional. Array of arguments. See `wp_list_comments()` documentation for a list of supported
* arguments.
*/
public function the_comments( array $args = array() ) {
$args = array_merge(
$args,
array(
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 60,
)
);
$amp_live_list = kadence()->using_amp_live_list_comments();
if ( $amp_live_list ) {
$comment_order = get_option( 'comment_order' );
$comments_per_page = get_option( 'page_comments' ) ? (int) get_option( 'comments_per_page' ) : 10000;
$poll_inverval = MINUTE_IN_SECONDS * 1000;
?>
<amp-live-list
id="amp-live-comments-list-<?php the_ID(); ?>"
<?php echo ( 'asc' === $comment_order ) ? ' sort="ascending" ' : ''; ?>
data-poll-interval="<?php echo esc_attr( $poll_inverval ); ?>"
data-max-items-per-page="<?php echo esc_attr( $comments_per_page ); ?>"
>
<?php
add_filter( 'navigation_markup_template', array( $this, 'filter_add_amp_live_list_pagination_attribute' ) );
}
?>
<ol class="comment-list"<?php echo $amp_live_list ? ' items' : ''; ?>>
<?php wp_list_comments( $args ); ?>
</ol><!-- .comment-list -->
<?php
the_comments_navigation();
if ( $amp_live_list ) {
remove_filter( 'navigation_markup_template', array( $this, 'filter_add_amp_live_list_pagination_attribute' ) );
?>
<div update>
<button class="button" on="tap:amp-live-comments-list-<?php the_ID(); ?>.update"><?php esc_html_e( 'New comment(s)', 'kadence' ); ?></button>
</div>
</amp-live-list>
<?php
}
}
/**
* Adds a div wrapper around the author, email and url fields.
*
* @param array $fields the contact form fields.
* @return array Filtered markup.
*/
public function filter_default_fields_markup( $fields ) {
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true' required='required'" : '' );
$label_req = ( $req ? ' <span class="required">*</span>' : '' );
$show_web = kadence()->option( 'comment_form_remove_web' );
$fields['author'] = '<div class="comment-input-wrap ' . ( $show_web ? 'no-url-field' : 'has-url-field' ) . '"><p class="comment-form-author"><input aria-label="' . esc_attr__( 'Name', 'kadence' ) . '" id="author" name="author" type="text" placeholder="' . esc_attr__( 'John Doe', 'kadence' ) . '" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . ' /><label class="float-label" for="author">' . esc_html__( 'Name', 'kadence' ) . $label_req . '</label></p>';
$fields['email'] = '<p class="comment-form-email"><input aria-label="' . esc_attr__( 'Email', 'kadence' ) . '" id="email" name="email" type="email" placeholder="' . esc_attr__( 'john@example.com', 'kadence' ) . '" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . ' /><label class="float-label" for="email">' . esc_html__( 'Email', 'kadence' ) . $label_req . '</label></p>';
if ( $show_web ) {
$fields['url'] = '</div>';
} else {
$fields['url'] = '<p class="comment-form-url"><input aria-label="' . esc_attr__( 'Website', 'kadence' ) . '" id="url" name="url" type="url" placeholder="' . esc_attr__( 'https://www.example.com', 'kadence' ) . '" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /><label class="float-label" for="url">' . esc_html__( 'Website', 'kadence' ) . '</label></p></div>';
}
return apply_filters( 'kadence_comment_fields', $fields );
}
/**
* Adds a div wrapper around the author, email and url fields.
*
* @param array $args the contact form args.
* @return array Filtered markup.
*/
public function filter_default_markup( $args ) {
$commenter = wp_get_current_commenter();
$args['comment_field'] = '<p class="comment-form-comment comment-form-float-label"><textarea id="comment" name="comment" placeholder="' . esc_attr__( 'Leave a comment...', 'kadence' ) . '" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea><label class="float-label" for="comment">' . esc_html__( 'Comment', 'kadence' ) . ' <span class="required">*</span></label></p>';
return apply_filters( 'kadence_comment_args', $args );
}
/**
* Adds a pagination reference point attribute for amp-live-list when theme supports AMP.
*
* This is used by the navigation_markup_template filter in the comments template.
*
* @link https://www.ampproject.org/docs/reference/components/amp-live-list#pagination
*
* @param string $markup Navigation markup.
* @return string Filtered markup.
*/
public function filter_add_amp_live_list_pagination_attribute( string $markup ) : string {
return preg_replace( '/(\s*<[a-z0-9_-]+)/i', '$1 pagination ', $markup, 1 );
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Kadence\Component_Interface interface
*
* @package kadence
*/
namespace Kadence;
/**
* Interface for a theme component.
*/
interface Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string;
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize();
}

View File

@@ -0,0 +1,101 @@
<?php
/**
* Kadence\Custom_Footer\Component class
*
* @package kadence
*/
namespace Kadence\Custom_Footer;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function add_action;
use function apply_filters;
use function Kadence\kadence;
use function get_template_part;
/**
* Class for adding custom footer support.
*
* Exposes template tags:
* * `kadence()->render_footer()`
* * `kadence()->display_footer_row()`
* * `kadence()->footer_column_item_count()`
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'custom_footer';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'render_footer' => array( $this, 'render_footer' ),
'display_footer_row' => array( $this, 'display_footer_row' ),
'footer_column_item_count' => array( $this, 'footer_column_item_count' ),
);
}
/**
* Checks to see if the row has any content.
*
* @param string $row the name of the row.
* @return bool
*/
public function display_footer_row( $row = 'middle' ) {
$display = false;
foreach ( array( '1', '2', '3', '4', '5' ) as $column ) {
$elements = kadence()->option( 'footer_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_' . $column ] ) && is_array( $elements[ $row ][ $row . '_' . $column ] ) && ! empty( $elements[ $row ][ $row . '_' . $column ] ) ) {
$display = true;
break;
}
}
return $display;
}
/**
* Adds support to render footer columns.
*
* @param string $row the name of the row.
* @param string $column the name of the column.
*/
public function render_footer( $row = 'middle', $column = '1' ) {
$elements = kadence()->option( 'footer_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_' . $column ] ) && is_array( $elements[ $row ][ $row . '_' . $column ] ) && ! empty( $elements[ $row ][ $row . '_' . $column ] ) ) {
foreach ( $elements[ $row ][ $row . '_' . $column ] as $key => $item ) {
$template = apply_filters( 'kadence_footer_elements_template_path', 'template-parts/footer/' . $item, $item, $row, $column );
get_template_part( $template );
}
}
}
/**
* Adds support to get the footer item count for a specific column.
*
* @param string $row the name of the row.
* @param string $column the name of the column.
*/
public function footer_column_item_count( $row = 'middle', $column = '1' ) {
$count = 0;
$elements = kadence()->option( 'footer_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_' . $column ] ) && is_array( $elements[ $row ][ $row . '_' . $column ] ) && ! empty( $elements[ $row ][ $row . '_' . $column ] ) ) {
$count = count( $elements[ $row ][ $row . '_' . $column ] );
}
return $count;
}
}

View File

@@ -0,0 +1,216 @@
<?php
/**
* Kadence\Custom_Header\Component class
*
* @package kadence
*/
namespace Kadence\Custom_Header;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function add_action;
use function apply_filters;
use function Kadence\kadence;
use function get_template_part;
/**
* Class for adding custom header support.
*
* Exposes template tags:
* * `kadence()->render_header()`
* * `kadence()->display_header_row()`
* * `kadence()->has_center_column()`
* * `kadence()->has_side_columns()`
* * `kadence()->display_mobile_header_row()`
* * `kadence()->has_mobile_center_column()`
* * `kadence()->has_mobile_side_columns()`
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Holds center column display.
*
* @var value for center column;
*/
protected static $center = array();
/**
* Holds sides column display.
*
* @var value for center column;
*/
protected static $sides = array();
/**
* Holds sides column display.
*
* @var value for center column;
*/
protected static $mobile_sides = array();
/**
* Holds center column display.
*
* @var value for center column;
*/
protected static $mobile_center = array();
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'custom_header';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'render_header' => array( $this, 'render_header' ),
'display_header_row' => array( $this, 'display_header_row' ),
'has_center_column' => array( $this, 'has_center_column' ),
'has_side_columns' => array( $this, 'has_side_columns' ),
'display_mobile_header_row' => array( $this, 'display_mobile_header_row' ),
'has_mobile_center_column' => array( $this, 'has_mobile_center_column' ),
'has_mobile_side_columns' => array( $this, 'has_mobile_side_columns' ),
);
}
/**
* Adds support to render header columns.
*
* @param string $row the name of the row.
*/
public function display_header_row( $row = 'main' ) {
$display = false;
foreach ( array( 'left', 'center', 'right' ) as $column ) {
$elements = kadence()->option( 'header_desktop_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_' . $column ] ) && is_array( $elements[ $row ][ $row . '_' . $column ] ) && ! empty( $elements[ $row ][ $row . '_' . $column ] ) ) {
$display = true;
break;
}
}
return $display;
}
/**
* Adds support to render header columns.
*
* @param string $row the name of the row.
*/
public function display_mobile_header_row( $row = 'main' ) {
$display = false;
foreach ( array( 'left', 'center', 'right' ) as $column ) {
$elements = kadence()->option( 'header_mobile_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_' . $column ] ) && is_array( $elements[ $row ][ $row . '_' . $column ] ) && ! empty( $elements[ $row ][ $row . '_' . $column ] ) ) {
$display = true;
break;
}
}
return $display;
}
/**
* Adds a check to see if the side columns should run.
*
* @param string $row the name of the row.
*/
public function has_side_columns( $row = 'main' ) {
if ( isset( self::$sides[ $row ] ) ) {
return self::$sides[ $row ];
}
$sides = false;
$elements = kadence()->option( 'header_desktop_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) ) {
if ( ( isset( $elements[ $row ][ $row . '_left' ] ) && is_array( $elements[ $row ][ $row . '_left' ] ) && ! empty( $elements[ $row ][ $row . '_left' ] ) ) || ( isset( $elements[ $row ][ $row . '_left_center' ] ) && is_array( $elements[ $row ][ $row . '_left_center' ] ) && ! empty( $elements[ $row ][ $row . '_left_center' ] ) ) || ( isset( $elements[ $row ][ $row . '_right_center' ] ) && is_array( $elements[ $row ][ $row . '_right_center' ] ) && ! empty( $elements[ $row ][ $row . '_right_center' ] ) ) || ( isset( $elements[ $row ][ $row . '_right' ] ) && is_array( $elements[ $row ][ $row . '_right' ] ) && ! empty( $elements[ $row ][ $row . '_right' ] ) ) ) {
$sides = true;
}
}
self::$sides[ $row ] = $sides;
return $sides;
}
/**
* Adds a check to see if the side columns should run.
*
* @param string $row the name of the row.
*/
public function has_mobile_side_columns( $row = 'main' ) {
if ( isset( self::$mobile_sides[ $row ] ) ) {
return self::$mobile_sides[ $row ];
}
$mobile_sides = false;
$elements = kadence()->option( 'header_mobile_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) ) {
if ( ( isset( $elements[ $row ][ $row . '_left' ] ) && is_array( $elements[ $row ][ $row . '_left' ] ) && ! empty( $elements[ $row ][ $row . '_left' ] ) ) || ( isset( $elements[ $row ][ $row . '_left_center' ] ) && is_array( $elements[ $row ][ $row . '_left_center' ] ) && ! empty( $elements[ $row ][ $row . '_left_center' ] ) ) || ( isset( $elements[ $row ][ $row . '_right_center' ] ) && is_array( $elements[ $row ][ $row . '_right_center' ] ) && ! empty( $elements[ $row ][ $row . '_right_center' ] ) ) || ( isset( $elements[ $row ][ $row . '_right' ] ) && is_array( $elements[ $row ][ $row . '_right' ] ) && ! empty( $elements[ $row ][ $row . '_right' ] ) ) ) {
$mobile_sides = true;
}
}
self::$mobile_sides[ $row ] = $mobile_sides;
return $mobile_sides;
}
/**
* Adds a check to see if the center column should run.
*
* @param string $row the name of the row.
*/
public function has_center_column( $row = 'main' ) {
if ( isset( self::$center[ $row ] ) ) {
return self::$center[ $row ];
}
$center = false;
$elements = kadence()->option( 'header_desktop_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_center' ] ) && is_array( $elements[ $row ][ $row . '_center' ] ) && ! empty( $elements[ $row ][ $row . '_center' ] ) ) {
$center = true;
}
self::$center[ $row ] = $center;
return $center;
}
/**
* Adds a check to see if the center column should run.
*
* @param string $row the name of the row.
*/
public function has_mobile_center_column( $row = 'main' ) {
if ( isset( self::$mobile_center[ $row ] ) ) {
return self::$mobile_center[ $row ];
}
$mobile_center = false;
$elements = kadence()->option( 'header_mobile_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_center' ] ) && is_array( $elements[ $row ][ $row . '_center' ] ) && ! empty( $elements[ $row ][ $row . '_center' ] ) ) {
$mobile_center = true;
}
self::$mobile_center[ $row ] = $mobile_center;
return $mobile_center;
}
/**
* Adds support to render header columns.
*
* @param string $row the name of the row.
* @param string $column the name of the column.
* @param string $header the name of the header.
*/
public function render_header( $row = 'main', $column = 'left', $header = 'desktop' ) {
$elements = kadence()->option( 'header_' . $header . '_items' );
if ( isset( $elements ) && isset( $elements[ $row ] ) && isset( $elements[ $row ][ $row . '_' . $column ] ) && is_array( $elements[ $row ][ $row . '_' . $column ] ) && ! empty( $elements[ $row ][ $row . '_' . $column ] ) ) {
foreach ( $elements[ $row ][ $row . '_' . $column ] as $key => $item ) {
$template = apply_filters( 'kadence_header_elements_template_path', 'template-parts/header/' . $item, $item, $row, $column );
get_template_part( $template );
}
}
}
}

View File

@@ -0,0 +1,55 @@
<?php
/**
* Kadence\Custom_Logo\Component class
*
* @package kadence
*/
namespace Kadence\Custom_Logo;
use Kadence\Component_Interface;
use function add_action;
use function add_theme_support;
use function apply_filters;
/**
* Class for adding custom logo support.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'custom_logo';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'after_setup_theme', array( $this, 'action_add_custom_logo_support' ) );
}
/**
* Adds support for the Custom Logo feature.
*/
public function action_add_custom_logo_support() {
add_theme_support(
'custom-logo',
apply_filters(
'kadence_custom_logo_args',
array(
'height' => 80,
'width' => 200,
'flex-width' => true,
'flex-height' => true,
)
)
);
}
}

View File

@@ -0,0 +1,394 @@
<?php
/**
* Kadence\Editor\Component class
*
* @package kadence
*/
namespace Kadence\Editor;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function add_filter;
use function add_theme_support;
/**
* Class for integrating with the block editor.
*
* @link https://wordpress.org/gutenberg/handbook/extensibility/theme-support/
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'editor';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'after_setup_theme', array( $this, 'action_add_editor_support' ) );
add_filter( 'admin_body_class', array( $this, 'filter_admin_body_class' ) );
remove_action( 'admin_head-post.php', 'kadence_blocks_admin_editor_width', 100 );
remove_action( 'admin_head-post-new.php', 'kadence_blocks_admin_editor_width', 100 );
add_filter( 'kadence_blocks_editor_width', array( $this, 'kadence_blocks_admin_editor_width_filter' ), 100 );
add_action( 'after_setup_theme', array( $this, 'google_font_add_editor_styles' ) );
add_filter( 'theme_file_path', array( $this, 'disable_json_optionally' ), 10, 2 );
add_filter( 'wp_theme_json_data_theme', array( $this, 'edit_theme_json' ), 10 );
}
/**
* Edit the theme.json file optionally.
*
* @param object $theme_json the path to the theme.json file.
*/
public function edit_theme_json( $theme_json ) {
$theme_mode = get_theme_mod( 'theme_json_mode', false );
if ( ! $theme_mode ) {
$new_data = array(
'version' => 2,
"settings" => array(
"appearanceTools" => true,
"border" => [
"color" => true,
"radius" => true,
"style" => true,
"width" => true
],
"color" => [
"custom" => true,
"defaultPalette" => false,
"link" => true,
"palette" => [
[
"name" => "Accent",
"slug" => "theme-palette1",
"color" => "var(--global-palette1)"
],
[
"name" => "Accent - alt",
"slug" => "theme-palette2",
"color" => "var(--global-palette2)"
],
[
"name" => "Strongest text",
"slug" => "theme-palette3",
"color" => "var(--global-palette3)"
],
[
"name" => "Strong Text",
"slug" => "theme-palette4",
"color" => "var(--global-palette4)"
],
[
"name" => "Medium text",
"slug" => "theme-palette5",
"color" => "var(--global-palette5)"
],
[
"name" => "Subtle Text",
"slug" => "theme-palette6",
"color" => "var(--global-palette6)"
],
[
"name" => "Subtle Background",
"slug" => "theme-palette7",
"color" => "var(--global-palette7)"
],
[
"name" => "Lighter Background",
"slug" => "theme-palette8",
"color" => "var(--global-palette8)"
],
[
"name" => "White or offwhite",
"slug" => "theme-palette9",
"color" => "var(--global-palette9)"
],
[
"name" => "Accent - Complement",
"slug" => "theme-palette10",
"color" => "var(--global-palette10)"
],
[
"name" => "Notices - Success",
"slug" => "theme-palette11",
"color" => "var(--global-palette11)"
],
[
"name" => "Notices - Info",
"slug" => "theme-palette12",
"color" => "var(--global-palette12)"
],
[
"name" => "Notices - Alert",
"slug" => "theme-palette13",
"color" => "var(--global-palette13)"
],
[
"name" => "Notices - Warning",
"slug" => "theme-palette14",
"color" => "var(--global-palette14)"
],
[
"name" => "Notices - Rating",
"slug" => "theme-palette15",
"color" => "var(--global-palette15)"
]
]
],
"layout" => [
"contentSize" => "var(--global-calc-content-width)",
"wideSize" => "var(--global-calc-wide-content-width)",
"fullSize" => "none"
],
"spacing" => [
"blockGap" => null,
"margin" => true,
"padding" => true,
"units" => [
"px",
"em",
"rem",
"vh",
"vw",
"%"
]
],
"typography" => [
"customFontSize" => true,
"fontSizes" => [
[
"name" => "Small",
"slug" => "small",
"size" => "var(--global-font-size-small)"
],
[
"name" => "Medium",
"slug" => "medium",
"size" => "var(--global-font-size-medium)"
],
[
"name" => "Large",
"slug" => "large",
"size" => "var(--global-font-size-large)"
],
[
"name" => "Larger",
"slug" => "larger",
"size" => "var(--global-font-size-larger)"
],
[
"name" => "XX-Large",
"slug" => "xxlarge",
"size" => "var(--global-font-size-xxlarge)"
]
],
"lineHeight" => true
]
),
"styles" => [
"elements" => [
"button" => [
"spacing" => [
"padding" => false
],
"border" => [
"width" => false
],
"color" => [
"background" => false,
"text" => false
],
"typography" => [
"fontFamily" => false,
"fontSize" => false,
"lineHeight" => false,
"textDecoration" => false
]
]
]
]
);
return $theme_json->update_with( $new_data );
}
return $theme_json;
}
/**
* Disables the theme.json file optionally.
*
* @param string $path the path to the theme.json file.
*/
public function disable_json_optionally( $path, $file ) {
$length = strlen( 'kadence/theme.json' );
if ( ! empty( $file ) && 'theme.json' === $file && substr( $path, -$length ) === 'kadence/theme.json' ) {
$theme_mode = get_theme_mod( 'theme_json_mode', false );
if ( ! $theme_mode ) {
// Set the path to a file that doesn't exist.
$new_path = str_replace( 'kadence/theme.json', 'kadence/missing-theme.json', $path );
return $new_path;
} else {
return $path;
}
}
return $path;
}
/**
* Registers an editor stylesheet for the current theme.
*/
public function google_font_add_editor_styles() {
if ( kadence()->sub_option( 'base_font', 'google' ) ) {
$font = kadence()->option( 'base_font' );
if ( $font['family'] ) {
$font_string = $font['family'] . ':' . ( $font['variant'] ? $font['variant'] : '400' ) . ',700';
if ( kadence()->sub_option( 'heading_font', 'google' ) ) {
$heading_font = kadence()->option( 'heading_font' );
if ( $heading_font['family'] ) {
$font_string .= '%7C' . $heading_font['family'] . ':400,700';
}
}
$font_url = str_replace( ',', '%2C', '//fonts.googleapis.com/css?family=' . $font_string );
add_editor_style( $font_url );
}
} elseif ( kadence()->sub_option( 'heading_font', 'google' ) ) {
$font = kadence()->option( 'heading_font' );
if ( $font['family'] ) {
$font_string = $font['family'] . ':400,700';
$font_url = str_replace( ',', '%2C', '//fonts.googleapis.com/css?family=' . $font_string );
add_editor_style( $font_url );
}
}
}
/**
* Adds filter for Kadence Editor Width.
*
* @param bool $enable the editor width enable.
*/
public function kadence_blocks_admin_editor_width_filter( $enable ) {
return false;
}
/**
* Adds filter for admin body class to add in layout information.
*
* @param string $classes the admin classes.
*/
public function filter_admin_body_class( $classes ) {
$screen = get_current_screen();
if ( 'post' == $screen->base ) {
global $post;
$post_type = get_post_type();
$post_layout = array(
'layout' => 'normal',
'boxed' => 'boxed',
'feature' => 'hide',
'comments' => 'hide',
'navigation' => 'hide',
'title' => 'normal',
'sidebar' => 'none',
'padding' => 'show',
);
$post_layout = apply_filters( 'kadence_post_layout', $post_layout );
$postlayout = get_post_meta( $post->ID, '_kad_post_layout', true );
$postboxed = get_post_meta( $post->ID, '_kad_post_content_style', true );
$postfeature = get_post_meta( $post->ID, '_kad_post_feature', true );
$vpadding = get_post_meta( $post->ID, '_kad_post_vertical_padding', true );
$postnav = get_post_meta( $post->ID, '_kad_post_navigation', true );
$posttitle = get_post_meta( $post->ID, '_kad_post_title', true );
$postsidebar = get_post_meta( $post->ID, '_kad_post_layout', true );
if ( isset( $postlayout ) && ( 'left' === $postsidebar || 'right' === $postsidebar ) ) {
$post_layout['sidebar'] = $postlayout;
} elseif ( ( isset( $postlayout ) && 'default' === $postlayout ) || empty( $postlayout ) ) {
$option_layout = kadence()->option( $post_type . '_layout' );
if ( 'left' === $option_layout || 'right' === $option_layout ) {
$post_layout['sidebar'] = $option_layout;
}
}
if ( isset( $posttitle ) && ( 'above' === $posttitle || 'normal' === $posttitle || 'hide' === $posttitle ) ) {
$post_layout['title'] = $posttitle;
} else {
$option_title = kadence()->option( $post_type . '_title' );
if ( false === $option_title ) {
$post_layout['title'] = 'hide';
} else {
$option_title_layout = kadence()->option( $post_type . '_title_layout' );
if ( 'above' === $option_title_layout || 'normal' === $option_title_layout ) {
$post_layout['title'] = $option_title_layout;
}
}
}
if ( isset( $postnav ) && ( 'show' === $postnav || 'hide' === $postnav ) ) {
$post_layout['navigation'] = $postnav;
} else {
$option_nav = kadence()->option( $post_type . '_navigation' );
if ( $option_nav ) {
$post_layout['navigation'] = 'show';
}
}
if ( isset( $vpadding ) && ( 'show' === $vpadding || 'hide' === $vpadding ) ) {
$post_layout['padding'] = $vpadding;
} else {
$option_padding = kadence()->option( $post_type . '_vertical_padding' );
if ( $option_padding ) {
$post_layout['padding'] = 'show';
}
}
if ( isset( $postboxed ) && ( 'unboxed' === $postboxed || 'boxed' === $postboxed ) ) {
$post_layout['boxed'] = $postboxed;
} else {
$option_boxed = kadence()->option( $post_type . '_content_style' );
if ( 'unboxed' === $option_boxed || 'boxed' === $option_boxed ) {
$post_layout['boxed'] = $option_boxed;
}
}
if ( isset( $postfeature ) && ( 'show' === $postfeature || 'hide' === $postfeature ) ) {
$post_layout['feature'] = $postfeature;
} else {
$option_feature = kadence()->option( $post_type . '_feature' );
if ( $option_feature ) {
$post_layout['feature'] = 'show';
}
}
if ( isset( $postlayout ) && ( 'narrow' === $postlayout || 'fullwidth' === $postlayout ) ) {
$post_layout['layout'] = $postlayout;
} else if ( isset( $postlayout ) && ( 'left' === $postlayout || 'right' === $postlayout ) ) {
$post_layout['layout'] = 'narrow';
} elseif ( ( isset( $postlayout ) && 'default' === $postlayout ) || empty( $postlayout ) ) {
$option_layout = kadence()->option( $post_type . '_layout' );
if ( 'narrow' === $option_layout || 'fullwidth' === $option_layout ) {
$post_layout['layout'] = $option_layout;
} else if ( 'left' === $option_layout || 'right' === $option_layout ) {
$post_layout['layout'] = 'narrow';
}
}
$classes .= ' post-content-width-' . esc_attr( $post_layout['layout'] ) . ' admin-color-pcw-' . esc_attr( $post_layout['layout'] ) . ' post-content-style-' . esc_attr( $post_layout['boxed'] ) . ' admin-color-pcs-' . esc_attr( $post_layout['boxed'] ) . ' admin-color-post-type-' . esc_attr( $post_type ) . ' post-content-vertical-padding-' . esc_attr( $post_layout['padding'] ) . ' admin-color-pcvp-' . esc_attr( $post_layout['padding'] ) . ' post-content-title-' . esc_attr( $post_layout['title'] ) . ' admin-color-pct-' . esc_attr( $post_layout['title'] ) . ' post-content-sidebar-' . esc_attr( $post_layout['sidebar'] ) . ' admin-color-pc-sidebar-' . esc_attr( $post_layout['sidebar'] ) . ' ';
}
return $classes;
}
/**
* Adds support for various editor features.
*/
public function action_add_editor_support() {
// Add support for post thumbnails.
add_theme_support( 'post-thumbnails' );
// Add support for editor styles.
add_theme_support( 'editor-styles' );
// Add support for default block styles.
// Don't add this "add_theme_support( 'wp-block-styles' );" because theme provides it own styling.
// add_theme_support( 'wp-block-styles' );
// Add support for wide-aligned images.
add_theme_support( 'align-wide' );
add_theme_support( 'custom-spacing' );
if ( apply_filters( 'kadence-theme-block-templates-support', true ) ) {
add_theme_support( 'block-templates' );
}
}
}

View File

@@ -0,0 +1,635 @@
<?php
/**
* Kadence\Elementor\Component class
*
* @package kadence
*/
namespace Kadence\Elementor;
use Kadence\Component_Interface;
use Elementor;
use function Kadence\kadence;
use function add_action;
use function add_theme_support;
use function have_posts;
use function the_post;
use function apply_filters;
use function get_template_part;
use function get_post_type;
use Elementor\Controls_Manager;
use Elementor\Core\Kits\Controls\Repeater as Global_Style_Repeater;
use Elementor\Repeater;
use Elementor\Plugin;
/**
* Class for adding Elementor plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'elementor';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
// Add support for Header and Footer Plugin.
add_action( 'after_setup_theme', array( $this, 'init_header_footer_support' ), 30 );
add_filter( 'body_class', array( $this, 'add_body_class' ) );
//add_action( 'init', array( $this, 'elementor_add_theme_colors' ), 1 );
add_action( 'elementor/editor/init', array( $this, 'elementor_add_theme_colors' ) );
//add_action( 'elementor/element/kit/section_global_colors/before_section_start', array( $this, 'elementor_remove_theme_colors' ) );
add_action( 'elementor/element/kit/section_global_colors/after_section_end', array( $this, 'elementor_add_theme_color_controls' ), 10, 2 );
// Set page to best pagebuilder settings when first loading.
add_action( 'wp', array( $this, 'elementor_page_meta_setting' ), 20 );
add_action( 'elementor/preview/init', array( $this, 'elementor_page_meta_setting' ) );
// Add Scripts for elementor.
add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'elementor_add_scripts' ) );
//add_action( 'wp_enqueue_scripts', array( $this, 'add_styles' ), 60 );
add_action( 'elementor/document/after_save', array( $this, 'elementor_after_save' ), 10, 2 );
add_filter( 'body_class', array( $this, 'filter_body_classes_add_editing_class' ) );
}
/**
* Adds a link style class to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array Filtered body classes.
*/
public function add_body_class( $classes ) {
$classes[] = 'kadence-elementor-colors';
return $classes;
}
/**
* Adds a 'el-is-editing' class to the array of body classes for when we are in elementor editing.
*
* @param array $classes Classes for the body element.
* @return array Filtered body classes.
*/
public function filter_body_classes_add_editing_class( array $classes ) : array {
if ( \Elementor\Plugin::$instance->preview->is_preview_mode() ) {
$classes[] = 'el-is-editing';
}
return $classes;
}
public function elementor_after_save( $object, $data ) {
if ( apply_filters( 'kadence_add_global_colors_to_elementor', true ) ) {
// Prevent Errors.
if ( ! current_user_can( 'edit_theme_options' ) ) {
return;
}
if ( $data && isset( $data['settings'] ) && is_array( $data['settings'] ) && isset( $data['settings']['kadence_colors'] ) && is_array( $data['settings']['kadence_colors'] ) ) {
$update_palette = false;
$palette = json_decode( kadence()->get_palette(), true );
if ( isset( $palette['active'] ) && ! empty( $palette['active'] ) ) {
$active = $palette['active'];
} else {
$palette = json_decode( kadence()->get_default_palette(), true );
$active = $palette['active'];
}
foreach ( $data['settings']['kadence_colors'] as $key => $value ) {
if ( 'palette1' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][0]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette2' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][1]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette3' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][2]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette4' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][3]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette5' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][4]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette6' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][5]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette7' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][6]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette8' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][7]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette9' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][8]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette10' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][9]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette11' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][10]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette12' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][11]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette13' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][12]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette14' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][13]['color'] = $value['color'];
$update_palette = true;
}
if ( 'palette15' == $value['_id'] && ! empty( $value['color'] ) ) {
$palette[$active][14]['color'] = $value['color'];
$update_palette = true;
}
}
$current = \Elementor\Plugin::$instance->kits_manager->get_current_settings();
if ( $current && isset( $current['custom_colors'] ) && $update_palette ) {
$custom_colors = $current['custom_colors'];
$kadence_add = true;
$kadence = array( 'kadence1', 'kadence2', 'kadence3', 'kadence4', 'kadence5', 'kadence6', 'kadence7', 'kadence8', 'kadence9' );
foreach ( $custom_colors as $key => $value ) {
if ( is_array( $value ) && isset( $value['_id'] ) && in_array( $value['_id'], $kadence ) ) {
$kadence_add = false;
if ( $value['_id'] == 'kadence1' ) {
$custom_colors[ $key ]['color'] = $palette[$active][0]['color'];
}
if ( $value['_id'] == 'kadence2' ) {
$custom_colors[ $key ]['color'] = $palette[$active][1]['color'];
}
if ( $value['_id'] == 'kadence3' ) {
$custom_colors[ $key ]['color'] = $palette[$active][2]['color'];
}
if ( $value['_id'] == 'kadence4' ) {
$custom_colors[ $key ]['color'] = $palette[$active][3]['color'];
}
if ( $value['_id'] == 'kadence5' ) {
$custom_colors[ $key ]['color'] = $palette[$active][4]['color'];
}
if ( $value['_id'] == 'kadence6' ) {
$custom_colors[ $key ]['color'] = $palette[$active][5]['color'];
}
if ( $value['_id'] == 'kadence7' ) {
$custom_colors[ $key ]['color'] = $palette[$active][6]['color'];
}
if ( $value['_id'] == 'kadence8' ) {
$custom_colors[ $key ]['color'] = $palette[$active][7]['color'];
}
if ( $value['_id'] == 'kadence9' ) {
$custom_colors[ $key ]['color'] = $palette[$active][8]['color'];
}
}
}
if ( $kadence_add ) {
\Elementor\Plugin::$instance->kits_manager->update_kit_settings_based_on_option( 'custom_colors', $custom_colors );
}
}
if ( $update_palette ) {
update_option( 'kadence_global_palette', json_encode( $palette ) );
}
}
}
}
/**
* Add some css styles for elementor.
*/
public function add_styles() {
wp_enqueue_style( 'kadence-elementor', get_theme_file_uri( '/assets/css/elementor.min.css' ), array(), KADENCE_VERSION );
}
/**
* Add some css styles for elementor admin.
*/
public function elementor_add_scripts() {
if ( apply_filters( 'kadence_add_global_colors_to_elementor', true ) ) {
wp_enqueue_style( 'kadence-elementor-admin', get_theme_file_uri( '/assets/css/elementor-admin.min.css' ), array(), KADENCE_VERSION );
}
}
/**
* Add some css styles for Restrict Content Pro
*/
public function elementor_add_theme_colors() {
if ( apply_filters( 'kadence_add_global_colors_to_elementor', true ) ) {
// // Prevent Errors.
if ( ! current_user_can( 'edit_theme_options' ) ) {
return;
}
$theme_colors = array(
array(
'_id' => 'kadence1',
'title' => __( 'Theme Accent', 'kadence' ),
'color' => kadence()->palette_option( 'palette1' ),
),
array(
'_id' => 'kadence2',
'title' => __( 'Theme Accent - alt', 'kadence' ),
'color' => kadence()->palette_option( 'palette2' ),
),
array(
'_id' => 'kadence3',
'title' => __( 'Strongest text', 'kadence' ),
'color' => kadence()->palette_option( 'palette3' ),
),
array(
'_id' => 'kadence4',
'title' => __( 'Strong Text', 'kadence' ),
'color' => kadence()->palette_option( 'palette4' ),
),
array(
'_id' => 'kadence5',
'title' => __( 'Medium text', 'kadence' ),
'color' => kadence()->palette_option( 'palette5' ),
),
array(
'_id' => 'kadence6',
'title' => __( 'Subtle Text', 'kadence' ),
'color' => kadence()->palette_option( 'palette6' ),
),
array(
'_id' => 'kadence7',
'title' => __( 'Subtle Background', 'kadence' ),
'color' => kadence()->palette_option( 'palette7' ),
),
array(
'_id' => 'kadence8',
'title' => __( 'Lighter Background', 'kadence' ),
'color' => kadence()->palette_option( 'palette8' ),
),
array(
'_id' => 'kadence9',
'title' => __( 'White or offwhite', 'kadence' ),
'color' => kadence()->palette_option( 'palette9' ),
),
);
$theme_placeholder_colors = array(
array(
'_id' => 'palette1',
'title' => __( 'Theme Accent', 'kadence' ),
'color' => kadence()->palette_option( 'palette1' ),
),
array(
'_id' => 'palette2',
'title' => __( 'Theme Accent - alt', 'kadence' ),
'color' => kadence()->palette_option( 'palette2' ),
),
array(
'_id' => 'palette3',
'title' => __( 'Strongest text', 'kadence' ),
'color' => kadence()->palette_option( 'palette3' ),
),
array(
'_id' => 'palette4',
'title' => __( 'Strong Text', 'kadence' ),
'color' => kadence()->palette_option( 'palette4' ),
),
array(
'_id' => 'palette5',
'title' => __( 'Medium text', 'kadence' ),
'color' => kadence()->palette_option( 'palette5' ),
),
array(
'_id' => 'palette6',
'title' => __( 'Subtle Text', 'kadence' ),
'color' => kadence()->palette_option( 'palette6' ),
),
array(
'_id' => 'palette7',
'title' => __( 'Subtle Background', 'kadence' ),
'color' => kadence()->palette_option( 'palette7' ),
),
array(
'_id' => 'palette8',
'title' => __( 'Lighter Background', 'kadence' ),
'color' => kadence()->palette_option( 'palette8' ),
),
array(
'_id' => 'palette9',
'title' => __( 'White or offwhite', 'kadence' ),
'color' => kadence()->palette_option( 'palette9' ),
),
);
// Prevent Errors.
if ( ! method_exists( \Elementor\Plugin::$instance->kits_manager, 'get_current_settings' ) ) {
return;
}
$current = \Elementor\Plugin::$instance->kits_manager->get_current_settings();
if ( $current && isset( $current['custom_colors'] ) ) {
$custom_colors = $current['custom_colors'];
$kadence_add_array = array(
'kadence1' => true,
'kadence2' => true,
'kadence3' => true,
'kadence4' => true,
'kadence5' => true,
'kadence6' => true,
'kadence7' => true,
'kadence8' => true,
'kadence9' => true,
);
$kadence_add = true;
$clear_cache = false;
$kadence = array( 'kadence1', 'kadence2', 'kadence3', 'kadence4', 'kadence5', 'kadence6', 'kadence7', 'kadence8', 'kadence9' );
foreach ( $custom_colors as $key => $value ) {
if ( is_array( $value ) && isset( $value['_id'] ) && in_array( $value['_id'], $kadence ) ) {
$kadence_add = false;
if ( $value['_id'] == 'kadence1' ) {
if ( $custom_colors[ $key ]['color'] !== $theme_colors[0]['color'] ) {
$clear_cache = true;
}
$kadence_add_array['kadence1'] = false;
$custom_colors[ $key ] = $theme_colors[0];
}
if ( $value['_id'] == 'kadence2' ) {
if ( $custom_colors[ $key ]['color'] !== $theme_colors[1]['color'] ) {
$clear_cache = true;
}
$kadence_add_array['kadence2'] = false;
$custom_colors[ $key ] = $theme_colors[1];
}
if ( $value['_id'] == 'kadence3' ) {
if ( $custom_colors[ $key ]['color'] !== $theme_colors[2]['color'] ) {
$clear_cache = true;
}
$kadence_add_array['kadence3'] = false;
$custom_colors[ $key ] = $theme_colors[2];
}
if ( $value['_id'] == 'kadence4' ) {
if ( $custom_colors[ $key ]['color'] !== $theme_colors[3]['color'] ) {
$clear_cache = true;
}
$kadence_add_array['kadence4'] = false;
$custom_colors[ $key ] = $theme_colors[3];
}
if ( $value['_id'] == 'kadence5' ) {
if ( $custom_colors[ $key ]['color'] !== $theme_colors[4]['color'] ) {
$clear_cache = true;
}
$kadence_add_array['kadence5'] = false;
$custom_colors[ $key ] = $theme_colors[4];
}
if ( $value['_id'] == 'kadence6' ) {
if ( $custom_colors[ $key ]['color'] !== $theme_colors[5]['color'] ) {
$clear_cache = true;
}
$kadence_add_array['kadence6'] = false;
$custom_colors[ $key ] = $theme_colors[5];
}
if ( $value['_id'] == 'kadence7' ) {
if ( $custom_colors[ $key ]['color'] !== $theme_colors[6]['color'] ) {
$clear_cache = true;
}
$kadence_add_array['kadence7'] = false;
$custom_colors[ $key ] = $theme_colors[6];
}
if ( $value['_id'] == 'kadence8' ) {
if ( $custom_colors[ $key ]['color'] !== $theme_colors[7]['color'] ) {
$clear_cache = true;
}
$kadence_add_array['kadence8'] = false;
$custom_colors[ $key ] = $theme_colors[7];
}
if ( $value['_id'] == 'kadence9' ) {
if ( $custom_colors[ $key ]['color'] !== $theme_colors[8]['color'] ) {
$clear_cache = true;
}
$kadence_add_array['kadence9'] = false;
$custom_colors[ $key ] = $theme_colors[8];
}
}
}
if ( $kadence_add ) {
$custom_colors = array_merge( $theme_colors, $custom_colors );
} else {
$i = 0;
$new_add = array();
foreach ( $kadence_add_array as $key => $value ) {
if ( $value ) {
$new_add[] = $theme_colors[ $i ];
}
$i++;
}
// Somehow colors were removed so we need to add them back in.
if ( ! empty( $new_add ) ) {
$custom_colors = array_merge( $new_add, $custom_colors );
}
}
// error_log( 'Here is the error?' );
\Elementor\Plugin::$instance->kits_manager->update_kit_settings_based_on_option( 'custom_colors', $custom_colors );
\Elementor\Plugin::$instance->kits_manager->update_kit_settings_based_on_option( 'kadence_colors', $theme_placeholder_colors );
// Refresh cache.
if ( $clear_cache ) {
// If the palette was updated in the customizer then we need to clear all the css.
\Elementor\Plugin::instance()->files_manager->clear_cache();
}
}
}
}
/**
* Add in new Custom Controls for Theme Colors.
*/
public function elementor_add_theme_color_controls( $tab, $args ) {
if ( apply_filters( 'kadence_add_global_colors_to_elementor', true ) ) {
$tab->start_controls_section(
'section_theme_global_colors',
array(
'label' => __( 'Theme Global Colors', 'kadence' ),
'tab' => 'global-colors',
)
);
$repeater = new Repeater();
$repeater->add_control(
'title',
array(
'type' => Controls_Manager::TEXT,
'label_block' => true,
'required' => true,
)
);
// Color Value
$repeater->add_control(
'color',
array(
'type' => Controls_Manager::COLOR,
'label_block' => true,
'dynamic' => [],
'selectors' => array(
'{{WRAPPER}}.el-is-editing' => '--global-{{_id.VALUE}}: {{VALUE}}',
),
'global' => array(
'active' => false,
),
)
);
$theme_colors = array(
array(
'_id' => 'palette1',
'title' => __( 'Theme Accent', 'kadence' ),
'color' => kadence()->palette_option( 'palette1' ),
),
array(
'_id' => 'palette2',
'title' => __( 'Theme Accent - alt', 'kadence' ),
'color' => kadence()->palette_option( 'palette2' ),
),
array(
'_id' => 'palette3',
'title' => __( 'Strongest text', 'kadence' ),
'color' => kadence()->palette_option( 'palette3' ),
),
array(
'_id' => 'palette4',
'title' => __( 'Strong Text', 'kadence' ),
'color' => kadence()->palette_option( 'palette4' ),
),
array(
'_id' => 'palette5',
'title' => __( 'Medium text', 'kadence' ),
'color' => kadence()->palette_option( 'palette5' ),
),
array(
'_id' => 'palette6',
'title' => __( 'Subtle Text', 'kadence' ),
'color' => kadence()->palette_option( 'palette6' ),
),
array(
'_id' => 'palette7',
'title' => __( 'Subtle Background', 'kadence' ),
'color' => kadence()->palette_option( 'palette7' ),
),
array(
'_id' => 'palette8',
'title' => __( 'Lighter Background', 'kadence' ),
'color' => kadence()->palette_option( 'palette8' ),
),
array(
'_id' => 'palette9',
'title' => __( 'White or offwhite', 'kadence' ),
'color' => kadence()->palette_option( 'palette9' ),
),
);
$tab->add_control(
'kadence_colors',
array(
'type' => Global_Style_Repeater::CONTROL_TYPE,
'fields' => $repeater->get_controls(),
'default' => $theme_colors,
'item_actions' => array(
'add' => false,
'remove' => false,
),
)
);
$tab->end_controls_section();
}
}
/**
* Make sure it's not a post, then set the meta if the content is empty and we are in elementor.
*/
public function elementor_page_meta_setting() {
if ( ! apply_filters( 'kadence_theme_elementor_default', true ) || 'post' === get_post_type() ) {
return;
}
if ( ! $this->is_elementor() ) {
return;
}
global $post;
$page_id = get_the_ID();
$page_builder_layout = get_post_meta( $page_id, '_kad_pagebuilder_layout_flag', true );
if ( isset( $post ) && empty( $page_builder_layout ) && ( is_admin() || is_singular() ) ) {
if ( empty( $post->post_content ) && $this->is_built_with_elementor( $page_id ) ) {
update_post_meta( $page_id, '_kad_pagebuilder_layout_flag', 'disabled' );
update_post_meta( $page_id, '_kad_post_title', 'hide' );
update_post_meta( $page_id, '_kad_post_content_style', 'unboxed' );
update_post_meta( $page_id, '_kad_post_vertical_padding', 'hide' );
update_post_meta( $page_id, '_kad_post_feature', 'hide' );
$post_layout = get_post_meta( $page_id, '_kad_post_layout', true );
if ( empty( $post_layout ) || 'default' === $post_layout ) {
update_post_meta( $page_id, '_kad_post_layout', 'fullwidth' );
}
$post_title = get_post_meta( $page_id, '_kad_post_title', true );
if ( empty( $post_title ) || 'default' === $post_title ) {
update_post_meta( $page_id, '_kad_post_title', 'hide' );
}
}
}
}
/**
* Check if page is built with elementor
*
* @return boolean true if elementor edit false if not.
*/
private function is_built_with_elementor( $page_id ) {
return Elementor\Plugin::$instance->db->is_built_with_elementor( $page_id );
}
/**
* Check if in elementor editor.
*
* @return boolean true if elementor edit false if not.
*/
private function is_elementor() {
if ( ( isset( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] ) || isset( $_REQUEST['elementor-preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
return true;
}
return false;
}
/**
* Check for use. Then
* Run all the Actions / Filters.
*/
public function init_header_footer_support() {
add_theme_support( 'header-footer-elementor' );
add_action( 'wp', array( $this, 'loading_header_footer_support' ) );
}
/**
* Check for use. Then
* Run all the Actions / Filters.
*/
public function loading_header_footer_support() {
if ( function_exists( 'hfe_header_enabled' ) ) {
if ( hfe_header_enabled() ) {
add_action( 'template_redirect', array( $this, 'remove_theme_header' ) );
add_action( 'kadence_header', 'hfe_render_header' );
}
}
if ( function_exists( 'hfe_footer_enabled' ) ) {
if ( hfe_footer_enabled() ) {
add_action( 'template_redirect', array( $this, 'remove_theme_footer' ) );
add_action( 'kadence_footer', 'hfe_render_footer' );
}
}
}
/**
* Disable header from the theme.
*/
public function remove_theme_header() {
remove_action( 'kadence_header', 'Kadence\header_markup' );
}
/**
* Disable header from the theme.
*/
public function remove_theme_footer() {
remove_action( 'kadence_footer', 'Kadence\footer_markup' );
}
}

View File

@@ -0,0 +1,138 @@
<?php
/**
* Kadence\Elementor_Pro\Component class
*
* @package kadence
*/
namespace Kadence\Elementor_Pro;
use Kadence\Component_Interface;
use Elementor;
use \ElementorPro\Modules\DynamicTags\Tags\Base\Data_Tag;
use \Elementor\Modules\DynamicTags\Module;
use \Elementor\Controls_Manager;
use function Kadence\kadence;
use function add_action;
if ( class_exists( '\ElementorPro\Modules\DynamicTags\Tags\Base\Data_Tag' ) ) {
/**
* Class for adding Elementor plugin support.
*/
class Elementor_Dynamic_Colors extends \ElementorPro\Modules\DynamicTags\Tags\Base\Data_Tag {
/**
* Get Name
*
* Returns the Name of the tag
*
* @since 2.0.0
* @access public
*
* @return string
*/
public function get_name() {
return 'kadence-color-palette';
}
/**
* Get Title
*
* Returns the title of the Tag
*
* @since 2.0.0
* @access public
*
* @return string
*/
public function get_title() {
return __( 'Kadence Color Palette', 'kadence' );
}
/**
* Get Group
*
* Returns the Group of the tag
*
* @since 2.0.0
* @access public
*
* @return string
*/
public function get_group() {
return 'kadence-palette';
}
/**
* Get Categories
*
* Returns an array of tag categories
*
* @since 2.0.0
* @access public
*
* @return array
*/
public function get_categories() {
return [ \Elementor\Modules\DynamicTags\Module::COLOR_CATEGORY ];
}
/**
* Register Controls
*
* Registers the Dynamic tag controls
*
* @since 2.0.0
* @access protected
*
* @return void
*/
protected function register_controls() {
$variables = array(
'palette1' => __( '1 - Accent', 'kadence' ),
'palette2' => __( '2 - Accent - alt', 'kadence' ),
'palette3' => __( '3 - Strongest text', 'kadence' ),
'palette4' => __( '4 - Strong Text', 'kadence' ),
'palette5' => __( '5 - Medium text', 'kadence' ),
'palette6' => __( '6 - Subtle Text', 'kadence' ),
'palette7' => __( '7 - Subtle Background', 'kadence' ),
'palette8' => __( '8 - Lighter Background', 'kadence' ),
'palette9' => __( '9 - White or offwhite', 'kadence' ),
'palette10' => __( '10 - Accent - Complement', 'kadence' ),
'palette11' => __( '11 - Notices - Success', 'kadence' ),
'palette12' => __( '12 - Notices - Info', 'kadence' ),
'palette13' => __( '13 - Notices - Alert', 'kadence' ),
'palette14' => __( '14 - Notices - Warning', 'kadence' ),
'palette15' => __( '15 - Notices - Rating', 'kadence' ),
);
$this->add_control(
'kadence_palette',
array(
'label' => __( 'Color', 'kadence' ),
'type' => \Elementor\Controls_Manager::SELECT,
'options' => $variables,
)
);
}
/**
* Get Value
*
* Returns the value of the Dynamic tag
*
* @since 2.0.0
* @access public
*
* @return void
*/
public function get_value( array $options = array() ) {
$param_name = $this->get_settings( 'kadence_palette' );
if ( ! $param_name ) {
return;
}
$value = 'var(--global-' . $param_name . ')';
return $value;
}
}
}

View File

@@ -0,0 +1,144 @@
<?php
/**
* Kadence\Elementor_Pro\Component class
*
* @package kadence
*/
namespace Kadence\Elementor_Pro;
use Kadence\Component_Interface;
use Kadence\Theme;
use Elementor;
use \Elementor\Plugin;
use ElementorPro\Modules\ThemeBuilder\ThemeSupport;
use Elementor\TemplateLibrary\Source_Local;
use ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager;
use ElementorPro\Modules\ThemeBuilder\Module;
use function Kadence\kadence;
use function add_action;
use function have_posts;
use function the_post;
use function apply_filters;
use function get_template_part;
use function get_post_type;
use function is_account_page;
use function is_checkout;
use function is_cart;
/**
* Class for adding Elementor plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'elementor_pro';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'elementor/theme/register_locations', array( $this, 'register_elementor_locations' ) );
add_action( 'elementor/dynamic_tags/register_tags', array( $this, 'add_palette_colors' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'disable_theme_account_css' ), 20 );
add_action( 'wp_enqueue_scripts', array( $this, 'disable_theme_checkout_changes' ), 20 );
add_action( 'wp_enqueue_scripts', array( $this, 'disable_theme_cart_changes' ), 20 );
}
/**
* Disable theme account css.
*/
public function disable_theme_account_css() {
if ( class_exists( 'woocommerce' ) && is_account_page() ) {
if ( function_exists( 'elementor_location_exits' ) && \Elementor\Plugin::$instance->db->is_built_with_elementor( get_the_ID() ) ) {
wp_dequeue_style( 'kadence-account-woocommerce' );
$kadence_theme_class = \Kadence\Theme::instance();
remove_action( 'woocommerce_before_account_navigation', array( $kadence_theme_class->components['woocommerce'], 'myaccount_nav_wrap_start' ), 2 );
remove_action( 'woocommerce_before_account_navigation', array( $kadence_theme_class->components['woocommerce'], 'myaccount_nav_avatar' ), 20 );
remove_action( 'woocommerce_after_account_navigation', array( $kadence_theme_class->components['woocommerce'], 'myaccount_nav_wrap_end' ), 50 );
}
}
}
/**
* Disable theme checkout css.
*/
public function disable_theme_checkout_changes() {
if ( class_exists( 'woocommerce' ) && is_checkout() ) {
if ( function_exists( 'elementor_location_exits' ) && \Elementor\Plugin::$instance->db->is_built_with_elementor( get_the_ID() ) ) {
wp_enqueue_style( 'kadence-elementor-checkout', get_theme_file_uri( '/assets/css/elementor-checkout.min.css' ), array(), KADENCE_VERSION );
}
}
}
/**
* Disable theme cart changes.
*/
public function disable_theme_cart_changes() {
if ( class_exists( 'woocommerce' ) && is_cart() ) {
if ( function_exists( 'elementor_location_exits' ) && \Elementor\Plugin::$instance->db->is_built_with_elementor( get_the_ID() ) ) {
wp_enqueue_style( 'kadence-elementor-cart', get_theme_file_uri( '/assets/css/elementor-cart.min.css' ), array(), KADENCE_VERSION );
$kadence_theme_class = \Kadence\Theme::instance();
// Remove Cart Changes.
remove_action( 'woocommerce_before_cart', array( $kadence_theme_class->components['woocommerce'], 'cart_form_wrap_before' ) );
remove_action( 'woocommerce_after_cart', array( $kadence_theme_class->components['woocommerce'], 'cart_form_wrap_after' ) );
remove_action( 'woocommerce_before_cart_table', array( $kadence_theme_class->components['woocommerce'], 'cart_summary_title' ) );
}
}
}
/**
* Elementor dynamic tag support.
*
* @param object $dynamic_tags the dynamic tags modal.
*/
public function add_palette_colors( $dynamic_tags ) {
if ( apply_filters( 'kadence_theme_add_palette_to_elementor_tags', false ) ) {
// In our Dynamic Tag we use a group named request-variables so we need.
// To register that group as well before the tag.
\Elementor\Plugin::$instance->dynamic_tags->register_group(
'kadence-palette',
array(
'title' => __( 'Kadence Theme', 'kadence' ),
)
);
require_once get_template_directory() . '/inc/components/elementor_pro/class-elementor-dynamic-colors.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
// Finally register the tag.
$dynamic_tags->register_tag( 'Kadence\Elementor_Pro\Elementor_Dynamic_Colors' );
}
}
/**
* Elementor Location support.
*
* @param object $elementor_theme_manager the theme manager.
*/
public function register_elementor_locations( $elementor_theme_manager ) {
$elementor_theme_manager->register_all_core_location();
$elementor_theme_manager->register_location(
'header',
array(
'hook' => 'kadence_header',
'remove_hooks' => array( 'Kadence\header_markup' ),
)
);
$elementor_theme_manager->register_location(
'footer',
array(
'hook' => 'kadence_footer',
'remove_hooks' => array( 'Kadence\footer_markup' ),
)
);
$elementor_theme_manager->register_location(
'single',
array(
'hook' => 'kadence_single',
'remove_hooks' => array( 'Kadence\single_markup' ),
)
);
}
}

View File

@@ -0,0 +1,72 @@
<?php
/**
* Kadence\Entry_Title\Component class
*
* @package kadence
*/
namespace Kadence\Entry_Title;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function add_action;
use function apply_filters;
use function Kadence\kadence;
use function get_template_part;
/**
* Class for adding custom title area support.
*
* Exposes template tags:
* * `kadence()->render_title()`
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'entry_title';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
//add_filter( 'kadence_title_elements_default', array( $this, 'maybe_add_defaults' ), 10, 2 );
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'render_title' => array( $this, 'render_title' ),
);
}
/**
* Adds support to render header columns.
*
* @param string $post_type the name of the row.
* @param string $area the name of the area.
*/
public function render_title( $post_type = 'post', $area = 'normal' ) {
$elements = kadence()->option( $post_type . '_title_elements' );
if ( isset( $elements ) && is_array( $elements ) && ! empty( $elements ) ) {
foreach ( $elements as $item ) {
if ( kadence()->sub_option( $post_type . '_title_element_' . $item, 'enabled' ) ) {
$template = apply_filters( 'kadence_title_elements_template_path', 'template-parts/title/' . $item, $item, $area );
get_template_part( $template );
}
}
} else {
get_template_part( 'template-parts/title/title' );
}
}
}

View File

@@ -0,0 +1,139 @@
<?php
/**
* Kadence\Essential_Real_Estate\Component class
*
* @package kadence
*/
namespace Kadence\Essential_Real_Estate;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function get_template_part;
/**
* Class for integrating with the block Third_Party.
*
* @link https://wordpress.org/gutenberg/handbook/extensibility/theme-support/
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug(): string {
return 'essential_real_estate';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
// WeDocs.
remove_action( 'ere_before_main_content', 'ere_output_content_wrapper_start' );
remove_action( 'ere_after_main_content', 'ere_after_main_content' );
remove_action( 'ere_sidebar_property', 'ere_sidebar_property' );
add_action( 'ere_before_main_content', [ $this, 'output_content_wrapper' ] );
add_action( 'ere_after_main_content', [ $this, 'output_content_wrapper_end' ] );
// add_action( 'ere_before_main_content', array( $this, 'output_content_inner' ), 20 );
// add_action( 'ere_after_main_content', array( $this, 'output_content_inner_end' ), 20 );
}
/**
* Adds theme output Wrapper.
*/
public function output_content_inner() {
if ( is_archive() ) {
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_archive_content' );
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/archive_header' );
}
?>
<div id="archive-container" class="content-wrap">
<?php
} else {
if ( kadence()->show_feature_above() ) {
get_template_part( 'template-parts/content/entry_thumbnail', get_post_type() );
}
?>
<div class="entry-content-wrap">
<?php
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/entry_header', get_post_type() );
}
if ( kadence()->show_feature_below() ) {
get_template_part( 'template-parts/content/entry_thumbnail', get_post_type() );
}
}
}
/**
* Adds theme output Wrapper.
*/
public function output_content_inner_end() {
?>
</div>
<?php
}
/**
* Adds theme output Wrapper.
*/
public function output_archive_content_inner() {
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_archive_content' );
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/archive_header' );
}
?>
<div id="archive-container" class="content-wrap">
<?php
}
/**
* Adds theme output Wrapper.
*/
public function output_content_wrapper() {
kadence()->print_styles( 'kadence-content' );
// /**
// * Hook for Hero Section
// */
// do_action( 'kadence_hero_header' );
?>
<div id="primary" class="content-area">
<div class="content-container site-container">
<div id="main" class="site-main">
<?php
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_main_content' );
?>
<div class="content-wrap">
<?php
}
/**
* Adds theme end output Wrapper.
*/
public function output_content_wrapper_end() {
?>
</div>
<?php
/**
* Hook for anything after main content
*/
do_action( 'kadence_after_main_content' );
?>
</div><!-- #main -->
<?php
get_sidebar();
?>
</div>
</div><!-- #primary -->
<?php
}
}

View File

@@ -0,0 +1,138 @@
<?php
/**
* Kadence\Estatik\Component class
*
* @package kadence
*/
namespace Kadence\Estatik;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function get_template_part;
/**
* Class for integrating with the block Third_Party.
*
* @link https://wordpress.org/gutenberg/handbook/extensibility/theme-support/
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug(): string {
return 'estatik';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
// remove_action( 'es_before_content', 'ere_output_content_wrapper_start' );
// remove_action( 'es_after_content', 'es_after_content' );
// remove_action( 'ere_sidebar_property', 'ere_sidebar_property' );
add_action( 'es_before_content', [ $this, 'output_content_wrapper' ] );
add_action( 'es_after_content', [ $this, 'output_content_wrapper_end' ] );
// add_action( 'es_before_content', array( $this, 'output_content_inner' ), 20 );
// add_action( 'es_after_content', array( $this, 'output_content_inner_end' ), 20 );
}
/**
* Adds theme output Wrapper.
*/
public function output_content_inner() {
if ( is_archive() ) {
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_archive_content' );
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/archive_header' );
}
?>
<div id="archive-container" class="content-wrap">
<?php
} else {
if ( kadence()->show_feature_above() ) {
get_template_part( 'template-parts/content/entry_thumbnail', get_post_type() );
}
?>
<div class="entry-content-wrap">
<?php
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/entry_header', get_post_type() );
}
if ( kadence()->show_feature_below() ) {
get_template_part( 'template-parts/content/entry_thumbnail', get_post_type() );
}
}
}
/**
* Adds theme output Wrapper.
*/
public function output_content_inner_end() {
?>
</div>
<?php
}
/**
* Adds theme output Wrapper.
*/
public function output_archive_content_inner() {
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_archive_content' );
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/archive_header' );
}
?>
<div id="archive-container" class="content-wrap">
<?php
}
/**
* Adds theme output Wrapper.
*/
public function output_content_wrapper() {
kadence()->print_styles( 'kadence-content' );
// /**
// * Hook for Hero Section
// */
// do_action( 'kadence_hero_header' );
?>
<div id="primary" class="content-area">
<div class="content-container site-container">
<div id="main" class="site-main">
<?php
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_main_content' );
?>
<div class="content-wrap">
<?php
}
/**
* Adds theme end output Wrapper.
*/
public function output_content_wrapper_end() {
?>
</div>
<?php
/**
* Hook for anything after main content
*/
do_action( 'kadence_after_main_content' );
?>
</div><!-- #main -->
<?php
get_sidebar();
?>
</div>
</div><!-- #primary -->
<?php
}
}

View File

@@ -0,0 +1,457 @@
<?php
/**
* Kadence\GiveWP\Component class
*
* @package kadence
*/
namespace Kadence\Give;
use Kadence\Component_Interface;
use Kadence\Kadence_CSS;
use function Kadence\kadence;
use function Kadence\print_webfont_preload;
use function Kadence\get_webfont_url;
use function add_action;
use function get_template_part;
use function get_post_type;
/**
* Class for adding Woocommerce plugin support.
*/
class Component implements Component_Interface {
/**
* Associative array of Google Fonts to load.
*
* Do not access this property directly, instead use the `get_google_fonts()` method.
*
* @var array
*/
protected static $google_fonts = [];
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug(): string {
return 'give';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
// New Visual Builder Styles.
add_action( 'givewp_donation_form_enqueue_scripts', [ $this, 'update_visual_builder_template_styles' ], 10 );
add_action( 'givewp_donation_form_enqueue_scripts', [ $this, 'update_visual_builder_template_fonts' ], 15 );
add_action( 'wp_print_styles', [ $this, 'override_iframe_template_styles' ], 10 );
add_action( 'wp_print_styles', [ $this, 'add_iframe_fonts' ], 20 );
add_action( 'give_default_wrapper_start', [ $this, 'output_content_wrapper' ] );
add_action( 'give_default_wrapper_end', [ $this, 'output_content_wrapper_end' ] );
add_action( 'wp_enqueue_scripts', [ $this, 'give_styles' ], 60 );
add_filter( 'post_class', [ $this, 'set_give_entry_class' ], 10, 3 );
add_action( 'give_before_single_form_summary', [ $this, 'output_inner_content_wrapper' ], 2 );
add_action( 'give_after_single_form_summary', [ $this, 'output_inner_content_wrapper_end' ] );
add_action( 'give_single_form_summary', [ $this, 'maybe_add_title' ], 1 );
remove_action( 'give_single_form_summary', 'give_template_single_title', 5 );
}
/**
* Adds theme output Wrapper.
*/
public function maybe_add_title() {
if ( function_exists( 'give_get_meta' ) ) {
$form_template = give_get_meta( get_the_ID(), '_give_form_template', true );
if ( ( ! $form_template || 'legacy' === $form_template ) && kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/entry_header', get_post_type() );
}
} elseif ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/entry_header', get_post_type() );
}
}
/**
* Adds entry class to loop items.
*
* @param array $classes the classes.
* @param string $class the class.
* @param int $post_id the post id.
*/
public function set_give_entry_class( $classes, $class, $post_id ) {
if ( is_singular() && in_array( 'type-give_forms', $classes, true ) ) {
$classes[] = 'entry';
$classes[] = 'content-bg';
$classes[] = 'single-entry';
}
return $classes;
}
/**
* Add some css styles for zoom_recipe_card
*/
public function give_styles() {
wp_enqueue_style( 'kadence-givewp', get_theme_file_uri( '/assets/css/givewp.min.css' ), [], KADENCE_VERSION );
}
/**
* Adds theme output Wrapper.
*/
public function output_inner_content_wrapper() {
?>
<div class="entry-content-wrap">
<?php
}
/**
* Adds theme output Wrapper.
*/
public function output_inner_content_wrapper_end() {
?>
</div>
<?php
}
/**
* Adds theme output Wrapper.
*/
public function output_content_wrapper() {
kadence()->print_styles( 'kadence-content' );
/**
* Hook for Hero Section
*/
do_action( 'kadence_hero_header' );
?>
<div id="primary" class="content-area">
<div class="content-container site-container">
<div id="main" class="site-main">
<?php
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_main_content' );
?>
<div class="content-wrap">
<?php
}
/**
* Adds theme end output Wrapper.
*/
public function output_content_wrapper_end() {
?>
</div>
<?php
/**
* Hook for anything after main content
*/
do_action( 'kadence_after_main_content' );
?>
</div><!-- #main -->
<?php
get_sidebar();
?>
</div>
</div><!-- #primary -->
<?php
}
/**
* Registers or enqueues google fonts.
*/
public function add_iframe_fonts() {
// Enqueue Google Fonts.
$google_fonts = apply_filters( 'kadence_theme_givewp_google_fonts_array', self::$google_fonts );
if ( empty( $google_fonts ) ) {
return '';
}
$link = '';
$sub_add = [];
$subsets = kadence()->option( 'google_subsets' );
foreach ( $google_fonts as $key => $gfont_values ) {
if ( ! empty( $link ) ) {
$link .= '%7C'; // Append a new font to the string.
}
$link .= $gfont_values['fontfamily'];
if ( ! empty( $gfont_values['fontvariants'] ) ) {
$link .= ':';
$link .= implode( ',', $gfont_values['fontvariants'] );
}
if ( ! empty( $gfont_values['fontsubsets'] ) && is_array( $gfont_values['fontsubsets'] ) ) {
foreach ( $gfont_values['fontsubsets'] as $subkey ) {
if ( ! empty( $subkey ) && ! isset( $sub_add[ $subkey ] ) ) {
$sub_add[] = $subkey;
}
}
}
}
$args = [
'family' => $link,
];
if ( ! empty( $subsets ) ) {
$available = [ 'latin-ext', 'cyrillic', 'cyrillic-ext', 'greek', 'greek-ext', 'vietnamese', 'arabic', 'khmer', 'chinese', 'chinese-simplified', 'tamil', 'bengali', 'devanagari', 'hebrew', 'korean', 'thai', 'telugu' ];
foreach ( $subsets as $key => $enabled ) {
if ( $enabled && in_array( $key, $available, true ) ) {
if ( 'chinese' === $key ) {
$key = 'chinese-traditional';
}
if ( ! isset( $sub_add[ $key ] ) ) {
$sub_add[] = $key;
}
}
}
if ( $sub_add ) {
$args['subset'] = implode( ',', $sub_add );
}
}
if ( apply_filters( 'kadence_givewp_display_swap_google_fonts', true ) ) {
$args['display'] = 'swap';
}
$google_fonts_url = add_query_arg( apply_filters( 'kadence_theme_givewp_google_fonts_query_args', $args ), 'https://fonts.googleapis.com/css' );
// Check if give-sequoia-template-css is enqueued
if ( ! empty( $google_fonts_url ) && wp_style_is( 'give-sequoia-template-css', 'enqueued' ) ) {
if ( kadence()->option( 'load_fonts_local' ) ) {
if ( kadence()->option( 'preload_fonts_local' ) && apply_filters( 'kadence_local_fonts_preload', true ) ) {
print_webfont_preload( $google_fonts_url );
}
wp_enqueue_style(
'kadence-givewp-iframe-fonts',
get_webfont_url( $google_fonts_url ),
[ 'give-sequoia-template-css' ],
KADENCE_VERSION
);
} else {
wp_enqueue_style( 'kadence-givewp-iframe-fonts', $google_fonts_url, [ 'give-sequoia-template-css' ], KADENCE_VERSION ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
}
}
}
/**
* Add Visual Builder Styles.
*/
public function update_visual_builder_template_fonts() {
// Enqueue Google Fonts.
$google_fonts = apply_filters( 'kadence_theme_givewp_google_fonts_array', self::$google_fonts );
if ( empty( $google_fonts ) ) {
return '';
}
$link = '';
$sub_add = [];
$subsets = kadence()->option( 'google_subsets' );
foreach ( $google_fonts as $key => $gfont_values ) {
if ( ! empty( $link ) ) {
$link .= '%7C'; // Append a new font to the string.
}
$link .= $gfont_values['fontfamily'];
if ( ! empty( $gfont_values['fontvariants'] ) ) {
$link .= ':';
$link .= implode( ',', $gfont_values['fontvariants'] );
}
if ( ! empty( $gfont_values['fontsubsets'] ) && is_array( $gfont_values['fontsubsets'] ) ) {
foreach ( $gfont_values['fontsubsets'] as $subkey ) {
if ( ! empty( $subkey ) && ! isset( $sub_add[ $subkey ] ) ) {
$sub_add[] = $subkey;
}
}
}
}
$args = [
'family' => $link,
];
if ( ! empty( $subsets ) ) {
$available = [ 'latin-ext', 'cyrillic', 'cyrillic-ext', 'greek', 'greek-ext', 'vietnamese', 'arabic', 'khmer', 'chinese', 'chinese-simplified', 'tamil', 'bengali', 'devanagari', 'hebrew', 'korean', 'thai', 'telugu' ];
foreach ( $subsets as $key => $enabled ) {
if ( $enabled && in_array( $key, $available, true ) ) {
if ( 'chinese' === $key ) {
$key = 'chinese-traditional';
}
if ( ! isset( $sub_add[ $key ] ) ) {
$sub_add[] = $key;
}
}
}
if ( $sub_add ) {
$args['subset'] = implode( ',', $sub_add );
}
}
if ( apply_filters( 'kadence_givewp_display_swap_google_fonts', true ) ) {
$args['display'] = 'swap';
}
$google_fonts_url = add_query_arg( apply_filters( 'kadence_theme_givewp_google_fonts_query_args', $args ), 'https://fonts.googleapis.com/css' );
if ( ! empty( $google_fonts_url ) ) {
if ( kadence()->option( 'load_fonts_local' ) ) {
if ( kadence()->option( 'preload_fonts_local' ) && apply_filters( 'kadence_local_fonts_preload', true ) ) {
print_webfont_preload( $google_fonts_url );
}
wp_enqueue_style(
'kadence-givewp-visual-iframe-fonts',
get_webfont_url( $google_fonts_url ),
[],
KADENCE_VERSION
);
} else {
wp_enqueue_style( 'kadence-givewp-visual-iframe-fonts', $google_fonts_url, [], KADENCE_VERSION ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
}
}
}
/**
* Add Visual Builder Styles.
*/
public function update_visual_builder_template_styles() {
$css = new Kadence_CSS();
$media_query = [];
$media_query['mobile'] = apply_filters( 'kadence_mobile_media_query', '(max-width: 767px)' );
$media_query['tablet'] = apply_filters( 'kadence_tablet_media_query', '(max-width: 1024px)' );
$media_query['desktop'] = apply_filters( 'kadence_desktop_media_query', '(min-width: 1025px)' );
// Globals.
$css->set_selector( ':root' );
$css->add_property( '--global-palette1', kadence()->palette_option( 'palette1' ) );
$css->add_property( '--global-palette2', kadence()->palette_option( 'palette2' ) );
$css->add_property( '--global-palette3', kadence()->palette_option( 'palette3' ) );
$css->add_property( '--global-palette4', kadence()->palette_option( 'palette4' ) );
$css->add_property( '--global-palette5', kadence()->palette_option( 'palette5' ) );
$css->add_property( '--global-palette6', kadence()->palette_option( 'palette6' ) );
$css->add_property( '--global-palette7', kadence()->palette_option( 'palette7' ) );
$css->add_property( '--global-palette8', kadence()->palette_option( 'palette8' ) );
$css->add_property( '--global-palette9', kadence()->palette_option( 'palette9' ) );
$css->add_property( '--global-palette10', kadence()->palette_option( 'palette10' ) );
$css->add_property( '--global-palette11', kadence()->palette_option( 'palette11' ) );
$css->add_property( '--global-palette12', kadence()->palette_option( 'palette12' ) );
$css->add_property( '--global-palette13', kadence()->palette_option( 'palette13' ) );
$css->add_property( '--global-palette14', kadence()->palette_option( 'palette14' ) );
$css->add_property( '--global-palette15', kadence()->palette_option( 'palette15' ) );
$css->add_property( '--global-palette-highlight', $css->render_color( kadence()->sub_option( 'link_color', 'highlight' ) ) );
$css->add_property( '--global-palette-highlight-alt', $css->render_color( kadence()->sub_option( 'link_color', 'highlight-alt' ) ) );
$css->add_property( '--global-palette-highlight-alt2', $css->render_color( kadence()->sub_option( 'link_color', 'highlight-alt2' ) ) );
// Button.
$css->add_property( '--global-palette-btn-bg', $css->render_color_or_gradient( kadence()->sub_option( 'buttons_background', 'color' ) ) );
$css->add_property( '--global-palette-btn-bg-hover', $css->render_color_or_gradient( kadence()->sub_option( 'buttons_background', 'hover' ) ) );
$css->add_property( '--global-palette-btn', $css->render_color( kadence()->sub_option( 'buttons_color', 'color' ) ) );
$css->add_property( '--global-palette-btn-hover', $css->render_color( kadence()->sub_option( 'buttons_color', 'hover' ) ) );
// Button Secondary.
$css->add_property( '--global-palette-btn-sec-bg', $css->render_color_or_gradient( kadence()->sub_option( 'buttons_secondary_background', 'color' ) ) );
$css->add_property( '--global-palette-btn-sec-bg-hover', $css->render_color_or_gradient( kadence()->sub_option( 'buttons_secondary_background', 'hover' ) ) );
$css->add_property( '--global-palette-btn-sec', $css->render_color( kadence()->sub_option( 'buttons_secondary_color', 'color' ) ) );
$css->add_property( '--global-palette-btn-sec-hover', $css->render_color( kadence()->sub_option( 'buttons_secondary_color', 'hover' ) ) );
// Button Outline.
$css->add_property( '--global-palette-btn-out-bg', $css->render_color_or_gradient( kadence()->sub_option( 'buttons_outline_background', 'color' ) ) );
$css->add_property( '--global-palette-btn-out-bg-hover', $css->render_color_or_gradient( kadence()->sub_option( 'buttons_outline_background', 'hover' ) ) );
$css->add_property( '--global-palette-btn-out', $css->render_color( kadence()->sub_option( 'buttons_outline_color', 'color' ) ) );
$css->add_property( '--global-palette-btn-out-hover', $css->render_color( kadence()->sub_option( 'buttons_outline_color', 'hover' ) ) );
$css->add_property( '--global-body-font-family', $css->render_font_family( kadence()->option( 'base_font' ), '' ) );
$css->add_property( '--global-heading-font-family', $css->render_font_family( kadence()->option( 'heading_font' ) ) );
$css->add_property( '--global-fallback-font', apply_filters( 'kadence_theme_global_typography_fallback', 'sans-serif' ) );
$css->add_property( '--global-display-fallback-font', apply_filters( 'kadence_theme_global_display_typography_fallback', 'sans-serif' ) );
$css->set_selector( 'body .givewp-donation-form' );
$css->add_property( '--font-family', 'var(--global-body-font-family)' );
$css->set_selector( '.givewp-layouts-headerTitle' );
$css->add_property( '--font-family', 'var(--global-heading-font-family )' );
self::$google_fonts = $css->fonts_output();
wp_add_inline_style( 'givewp-base-form-styles', $css->css_output() );
}
/**
* Add basic theme styling to iframe.
*/
public function override_iframe_template_styles() {
$css = new Kadence_CSS();
$media_query = [];
$media_query['mobile'] = apply_filters( 'kadence_mobile_media_query', '(max-width: 767px)' );
$media_query['tablet'] = apply_filters( 'kadence_tablet_media_query', '(max-width: 1024px)' );
$media_query['desktop'] = apply_filters( 'kadence_desktop_media_query', '(min-width: 1025px)' );
// Globals.
$css->set_selector( ':root' );
$css->add_property( '--global-palette1', kadence()->palette_option( 'palette1' ) );
$css->add_property( '--global-palette2', kadence()->palette_option( 'palette2' ) );
$css->add_property( '--global-palette3', kadence()->palette_option( 'palette3' ) );
$css->add_property( '--global-palette4', kadence()->palette_option( 'palette4' ) );
$css->add_property( '--global-palette5', kadence()->palette_option( 'palette5' ) );
$css->add_property( '--global-palette6', kadence()->palette_option( 'palette6' ) );
$css->add_property( '--global-palette7', kadence()->palette_option( 'palette7' ) );
$css->add_property( '--global-palette8', kadence()->palette_option( 'palette8' ) );
$css->add_property( '--global-palette9', kadence()->palette_option( 'palette9' ) );
$css->add_property( '--global-palette10', kadence()->palette_option( 'palette10' ) );
$css->add_property( '--global-palette11', kadence()->palette_option( 'palette11' ) );
$css->add_property( '--global-palette12', kadence()->palette_option( 'palette12' ) );
$css->add_property( '--global-palette13', kadence()->palette_option( 'palette13' ) );
$css->add_property( '--global-palette14', kadence()->palette_option( 'palette14' ) );
$css->add_property( '--global-palette15', kadence()->palette_option( 'palette15' ) );
$css->add_property( '--global-palette-highlight', $css->render_color( kadence()->sub_option( 'link_color', 'highlight' ) ) );
$css->add_property( '--global-palette-highlight-alt', $css->render_color( kadence()->sub_option( 'link_color', 'highlight-alt' ) ) );
$css->add_property( '--global-palette-highlight-alt2', $css->render_color( kadence()->sub_option( 'link_color', 'highlight-alt2' ) ) );
$css->add_property( '--global-palette-btn-bg', $css->render_color_or_gradient( kadence()->sub_option( 'buttons_background', 'color' ) ) );
$css->add_property( '--global-palette-btn-bg-hover', $css->render_color_or_gradient( kadence()->sub_option( 'buttons_background', 'hover' ) ) );
$css->add_property( '--global-palette-btn', $css->render_color( kadence()->sub_option( 'buttons_color', 'color' ) ) );
$css->add_property( '--global-palette-btn-hover', $css->render_color( kadence()->sub_option( 'buttons_color', 'hover' ) ) );
$css->add_property( '--global-body-font-family', $css->render_font_family( kadence()->option( 'base_font' ), '' ) );
$css->add_property( '--global-heading-font-family', $css->render_font_family( kadence()->option( 'heading_font' ) ) );
$css->add_property( '--global-fallback-font', apply_filters( 'kadence_theme_global_typography_fallback', 'sans-serif' ) );
$css->add_property( '--global-display-fallback-font', apply_filters( 'kadence_theme_global_display_typography_fallback', 'sans-serif' ) );
$css->set_selector( 'body' );
$css->add_property( 'margin', '10px' );
$css->add_property( 'font-family', 'var( --global-body-font-family )' );
$css->add_property( 'color', 'var(--global-palette4 )' );
$css->set_selector( '.give-embed-form, .give-embed-receipt' );
$css->add_property( 'color', 'var(--global-palette5 )' );
$css->add_property( 'background-color', 'var(--global-palette9 )' );
$css->add_property( 'box-shadow', '0px 15px 25px -10px rgb(0 0 0 / 5%)' );
$css->add_property( 'border-radius', '.25rem' );
$css->add_property( 'border', '1px solid var( --global-palette7 )' );
$css->set_selector( 'body.give-form-templates .give-form-navigator' );
$css->add_property( 'border', '1px solid transparent' );
$css->add_property( 'background', 'var(--global-palette8 )' );
$css->set_selector( '.form-footer .secure-notice' );
$css->add_property( 'background', 'var(--global-palette8 )' );
$css->add_property( 'border-top', '1px solid var( --global-palette7 )' );
$css->add_property( 'color', 'var(--global-palette6 )' );
$css->set_selector( 'body.give-form-templates .give-form-navigator.nav-visible' );
$css->add_property( 'border', '1px solid var( --global-palette7 )' );
$css->set_selector( '.form-footer .navigator-tracker .step-tracker' );
$css->add_property( 'background', 'var(--global-palette7 )' );
$css->set_selector( '.form-footer .navigator-tracker .step-tracker.current' );
$css->add_property( 'background', 'var(--global-palette6 )' );
$css->set_selector( '.payment #give_purchase_form_wrap' );
$css->add_property( 'background', 'var(--global-palette8 )' );
$css->set_selector(
'body.give-form-templates,
body.give-form-templates .give-btn,
body.give-form-templates .choose-amount .give-donation-amount .give-amount-top,
body.give-form-templates #give-recurring-form .form-row input[type=email],
body.give-form-templates #give-recurring-form .form-row input[type=password],
body.give-form-templates #give-recurring-form .form-row input[type=tel],
body.give-form-templates #give-recurring-form .form-row input[type=text],
body.give-form-templates #give-recurring-form .form-row input[type=url],
body.give-form-templates #give-recurring-form .form-row textarea, .give-input-field-wrapper,
body.give-form-templates .give-square-cc-fields,
body.give-form-templates .give-stripe-cc-field,
body.give-form-templates .give-stripe-single-cc-field-wrap,
body.give-form-templates form.give-form .form-row input[type=email],
body.give-form-templates form.give-form .form-row input[type=password],
body.give-form-templates form.give-form .form-row input[type=tel],
body.give-form-templates form.give-form .form-row input[type=text],
body.give-form-templates form.give-form .form-row input[type=url],
body.give-form-templates form.give-form .form-row textarea,
body.give-form-templates form[id*=give-form] .form-row input[type=email],
body.give-form-templates form[id*=give-form] .form-row input[type=email].required,
body.give-form-templates form[id*=give-form] .form-row input[type=password],
body.give-form-templates form[id*=give-form] .form-row input[type=password].required,
body.give-form-templates form[id*=give-form] .form-row input[type=tel],
body.give-form-templates form[id*=give-form] .form-row input[type=tel].required,
body.give-form-templates form[id*=give-form] .form-row input[type=text],
body.give-form-templates form[id*=give-form] .form-row input[type=text].required,
body.give-form-templates form[id*=give-form] .form-row input[type=url],
body.give-form-templates form[id*=give-form] .form-row input[type=url].required,
body.give-form-templates form[id*=give-form] .form-row textarea,
body.give-form-templates form[id*=give-form] .form-row textarea.required'
);
$css->add_property( 'font-family', 'var( --global-body-font-family )' );
$css->set_selector( '.give-stripe-becs-mandate-acceptance-text, .give-stripe-sepa-mandate-acceptance-text, p, .give-form-navigator>.title, .give-form-navigator>.back-btn,.payment .subheading' );
$css->add_property( 'color', 'var(--global-palette5 )' );
$css->set_selector( 'h1,h2,h3,h4,h5,h6, .payment .heading' );
$css->add_property( 'color', 'var(--global-palette3 )' );
$css->set_selector( '.advance-btn, .download-btn, .give-submit' );
$css->add_property( 'text-transform', 'uppercase' );
$css->add_property( 'font-weight', '600' );
$css->add_property( 'font-size', '16px' );
$css->add_property( 'padding', '14px 30px !important' );
self::$google_fonts = $css->fonts_output();
wp_add_inline_style( 'give-sequoia-template-css', $css->css_output() );
}
}

View File

@@ -0,0 +1,97 @@
<?php
/**
* Kadence\Heroic_Kb\Component class
*
* @package kadence
*/
namespace Kadence\Heroic_Kb;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function add_filter;
use function get_template_part;
use function locate_template;
/**
* Class for integrating with the block Heroic_Kb.
*
* @link https://wordpress.org/gutenberg/handbook/extensibility/theme-support/
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'heroic_kb';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
// Heroic Knowledge Base.
//add_filter( 'hkb_locate_template', array( $this, 'output_edited_search' ) );
add_filter( 'hkb_show_knowledgebase_search', array( $this, 'override_search_location' ) );
add_filter( 'hkb_show_knowledgebase_breadcrumbs', array( $this, 'override_search_location' ) );
add_action( 'kadence_entry_archive_hero', array( $this, 'ht_knowledge_base_breadcrumb_in_title' ), 5 );
add_action( 'kadence_entry_archive_header', array( $this, 'ht_knowledge_base_breadcrumb_in_title' ), 5 );
//add_action( 'kadence_entry_header', array( $this, 'ht_knowledge_base_breadcrumb_in_title' ), 5 );
add_action( 'kadence_entry_archive_hero', array( $this, 'ht_knowledge_base_search_in_title' ), 20 );
add_action( 'kadence_entry_archive_header', array( $this, 'ht_knowledge_base_search_in_title' ), 20 );
add_action( 'kadence_entry_header', array( $this, 'ht_knowledge_base_search_in_title' ), 20 );
}
/**
* Check to see if string ends with somthing.
*
* @param string $string the string.
* @param string $test the test.
*/
public function endswith( $string, $test ) {
$strlen = strlen( $string );
$testlen = strlen( $test );
if ( $testlen > $strlen ) {
return false;
}
return substr_compare( $string, $test, $strlen - $testlen, $testlen ) === 0;
}
/**
* Changes Heroic Knowledge Base Search Button.
*
* @param string $template the template.
*/
public function output_edited_search( $template ) {
if ( $this->endswith( $template, 'hkb-searchbox.php' ) ) {
$template = locate_template( 'template-parts/archive-title/hkb-searchbox' );
}
return $template;
}
/**
* Changes Heroic Knowledge Base Search Button.
*
* @param bool $show_search whether to show search.
*/
public function override_search_location( $show_search ) {
return false;
}
/**
* Adds Support for Heroic Knowledge Base Search in Title Area.
*/
public function ht_knowledge_base_search_in_title() {
if ( ( is_tax( 'ht_kb_category' ) || is_tax( 'ht_kb_tag' ) || is_post_type_archive( 'ht_kb' ) || ( is_search() && array_key_exists( 'ht-kb-search', $_REQUEST ) ) ) ) {
get_template_part( 'template-parts/archive-title/hkb-searchbox' );
}
}
/**
* Adds Support for Heroic Knowledge Base Breadcrumb in Title Area.
*/
public function ht_knowledge_base_breadcrumb_in_title() {
if ( ( is_tax( 'ht_kb_category' ) || is_tax( 'ht_kb_tag' ) || is_post_type_archive( 'ht_kb' ) || ( is_search() && array_key_exists( 'ht-kb-search', $_REQUEST ) ) ) ) {
kadence()->print_breadcrumb();
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,77 @@
<?php
/**
* Kadence\Image_Sizes\Component class
*
* @package kadence
*/
namespace Kadence\Image_Sizes;
use Kadence\Component_Interface;
use function Kadence\kadence;
use WP_Post;
use function add_filter;
use function is_active_sidebar;
/**
* Class for managing responsive image sizes.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'image_sizes';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
//add_filter( 'wp_calculate_image_sizes', array( $this, 'filter_content_image_sizes_attr' ), 10, 2 );
//add_filter( 'wp_get_attachment_image_attributes', array( $this, 'filter_post_thumbnail_sizes_attr' ), 10, 3 );
}
/**
* Adds custom image sizes attribute to enhance responsive image functionality for content images.
*
* @param string $sizes A source size value for use in a 'sizes' attribute.
* @param array $size Image size. Accepts an array of width and height
* values in pixels (in that order).
* @return string A source size value for use in a content image 'sizes' attribute.
*/
public function filter_content_image_sizes_attr( string $sizes, array $size ) : string {
$width = $size[0];
if ( 740 <= $width ) {
$sizes = '100vw';
}
if ( kadence()->has_sidebar() ) {
$sizes = '(min-width: 960px) 75vw, 100vw';
}
return $sizes;
}
/**
* Adds custom image sizes attribute to enhance responsive image functionality for post thumbnails.
*
* @param array $attr Attributes for the image markup.
* @param WP_Post $attachment Attachment post object.
* @param string|array $size Registered image size or flat array of height and width dimensions.
* @return array The filtered attributes for the image markup.
*/
public function filter_post_thumbnail_sizes_attr( array $attr, WP_Post $attachment, $size ) : array {
$attr['sizes'] = '100vw';
if ( kadence()->has_sidebar() ) {
$attr['sizes'] = '(min-width: 960px) 75vw, 100vw';
}
return $attr;
}
}

View File

@@ -0,0 +1,87 @@
<?php
/**
* Kadence\Jetpack\Component class
*
* @package kadence
*/
namespace Kadence\Jetpack;
use Kadence\Component_Interface;
use function add_action;
use function add_theme_support;
use function have_posts;
use function the_post;
use function is_search;
use function get_template_part;
use function get_post_type;
/**
* Class for adding Jetpack plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'jetpack';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'after_setup_theme', array( $this, 'action_add_jetpack_support' ) );
}
/**
* Adds theme support for the Jetpack plugin.
*
* See: https://jetpack.com/support/infinite-scroll/
* See: https://jetpack.com/support/responsive-videos/
* See: https://jetpack.com/support/content-options/
*/
public function action_add_jetpack_support() {
// Add theme support for Infinite Scroll.
add_theme_support(
'infinite-scroll',
array(
'container' => 'archive-container',
'footer' => false,
'wrapper' => false,
'render' => function() {
while ( have_posts() ) {
the_post();
if ( is_search() ) {
get_template_part( 'template-parts/content/entry', 'search' );
} else {
get_template_part( 'template-parts/content/entry', get_post_type() );
}
}
},
)
);
// Add theme support for Responsive Videos.
add_theme_support( 'jetpack-responsive-videos' );
// Add theme support for Content Options.
add_theme_support(
'jetpack-content-options',
array(
'post-details' => array(
'stylesheet' => 'kadence-content',
'date' => '.posted-on',
'categories' => '.category-links',
'tags' => '.tag-links',
'author' => '.posted-by',
'comment' => '.comments-link',
),
)
);
}
}

View File

@@ -0,0 +1,922 @@
<?php
/**
* Kadence\Layout\Component class
*
* @package kadence
*/
namespace Kadence\Layout;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function Kadence\kadence;
use function add_action;
use function add_filter;
use function register_sidebar;
use function is_active_sidebar;
use function dynamic_sidebar;
/**
* Class for managing page/post layouts.
*
* Exposes template tags:
* * `kadence()->get_layout()`
* * `kadence()->get_feature()`
* * `kadence()->show_feature()`
* * `kadence()->show_feature_above()`
* * `kadence()->show_feature_below()`
* * `kadence()->get_feature_position()`
* * `kadence()->show_comments()`
* * `kadence()->show_hero_title()`
* * `kadence()->show_in_content_title()`
* * `kadence()->get_boxed()`
* * `kadence()->has_sidebar()`
* * `kadence()->sidebar_id()`
* * `kadence()->sidebar_id_class()`
* * `kadence()->sidebar_side()`
* * `kadence()->display_sidebar()`
* * `kadence()->has_header()`
* * `kadence()->has_header_styles()`
* * `kadence()->has_footer()`
* * `kadence()->has_content()`
*
* @link https://developer.wordpress.org/themes/functionality/layout/
*/
class Component implements Component_Interface, Templating_Component_Interface {
const PRIMARY_SIDEBAR_SLUG = 'sidebar-primary';
const SECONDARY_SIDEBAR_SLUG = 'sidebar-secondary';
/**
* Holds the string for width layout.
*
* @var values of the theme settings.
*/
public static $layout = null;
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'layout';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_filter( 'body_class', array( $this, 'filter_body_classes' ) );
add_action( 'widgets_init', array( $this, 'action_register_sidebars' ) );
add_filter( 'register_sidebar_defaults', array( $this, 'change_sidebar_default_args' ) );
}
/**
* Registers the sidebars.
*/
public function action_register_sidebars() {
$widgets = array(
'sidebar-primary' => __( 'Sidebar 1', 'kadence' ),
'sidebar-secondary' => __( 'Sidebar 2', 'kadence' ),
'footer1' => __( 'Footer 1', 'kadence' ),
'footer2' => __( 'Footer 2', 'kadence' ),
'footer3' => __( 'Footer 3', 'kadence' ),
'footer4' => __( 'Footer 4', 'kadence' ),
'footer5' => __( 'Footer 5', 'kadence' ),
'footer6' => __( 'Footer 6', 'kadence' ),
);
foreach ( $widgets as $id => $name ) {
register_sidebar(
apply_filters(
'kadence_widget_area_args',
array(
'name' => $name,
'id' => $id,
'description' => esc_html__( 'Add widgets here.', 'kadence' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
)
);
}
}
/**
* Registers the sidebars.
*
* @param array $defaults the default args.
*/
public function change_sidebar_default_args( $defaults ) {
$args = apply_filters(
'kadence_widget_area_args',
array(
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
$args = wp_parse_args( $args, $defaults );
return $args;
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'get_layout' => array( $this, 'get_layout' ),
'get_boxed' => array( $this, 'get_boxed' ),
'get_title_layout' => array( $this, 'get_title_layout' ),
'show_hero_title' => array( $this, 'show_hero_title' ),
'show_in_content_title' => array( $this, 'show_in_content_title' ),
'get_feature' => array( $this, 'get_feature' ),
'show_feature' => array( $this, 'show_feature' ),
'show_feature_above' => array( $this, 'show_feature_above' ),
'show_feature_below' => array( $this, 'show_feature_below' ),
'get_feature_position' => array( $this, 'get_feature_position' ),
'show_comments' => array( $this, 'show_comments' ),
'show_post_navigation' => array( $this, 'show_post_navigation' ),
'has_sidebar' => array( $this, 'has_sidebar' ),
'sidebar_id' => array( $this, 'sidebar_id' ),
'sidebar_side' => array( $this, 'sidebar_side' ),
'sidebar_id_class' => array( $this, 'sidebar_id_class' ),
'display_sidebar' => array( $this, 'display_sidebar' ),
'desk_transparent_header' => array( $this, 'desk_transparent_header' ),
'mobile_transparent_header' => array( $this, 'mobile_transparent_header' ),
'has_header' => array( $this, 'has_header' ),
'has_header_styles' => array( $this, 'has_header_styles' ),
'has_footer' => array( $this, 'has_footer' ),
'has_content' => array( $this, 'has_content' ),
);
}
/**
* Displays the sidebar.
*/
public function display_sidebar() {
ob_start();
dynamic_sidebar( self::sidebar_id() );
echo apply_filters( 'kadence_dynamic_sidebar_content', ob_get_clean() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Checks if page should show in hero title.
*
* @return bool true or false.
*/
public static function show_hero_title() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'above' === self::$layout['title'] ? true : false );
}
/**
* Checks if page should show in content title.
*
* @return bool true or false.
*/
public static function show_in_content_title() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'normal' === self::$layout['title'] ? true : false );
}
/**
* Checks if header is here or incontent
*
* @return string normal or above
*/
public static function has_content() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'disable' === self::$layout['content'] ? false : true );
}
/**
* Checks if header is here or incontent
*
* @return string normal or above
*/
public static function has_header() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'disable' === self::$layout['header'] ? false : true );
}
/**
* Checks if header is here or incontent
*
* @return string normal or above
*/
public static function has_header_styles() {
if ( kadence()->option( 'blocks_header' ) ) {
return false;
}
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'disable' === self::$layout['header'] ? false : true );
}
/**
* Checks if footer is here or incontent
*
* @return string normal or above
*/
public static function has_footer() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'disable' === self::$layout['footer'] ? false : true );
}
/**
* Checks if page title is here or incontent
*
* @return string normal or above
*/
public static function get_title_layout() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return self::$layout['title'];
}
/**
* Checks if page should have desktop transparent header.
*
* @return bool true or false.
*/
public static function desk_transparent_header() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'enable' === self::$layout['transparent'] && kadence()->sub_option( 'transparent_header_device', 'desktop' ) ? true : false );
}
/**
* Checks if page should have desktop transparent header.
*
* @return bool true or false.
*/
public static function get_desk_transparent_class() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'enable' === self::$layout['transparent'] && kadence()->sub_option( 'transparent_header_device', 'desktop' ) ? 'transparent-header' : 'non-transparent-header' );
}
/**
* Checks if page should have mobile transparent header.
*
* @return bool true or false.
*/
public static function get_mobile_transparent_class() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'enable' === self::$layout['transparent'] && kadence()->sub_option( 'transparent_header_device', 'mobile' ) ? 'mobile-transparent-header' : 'mobile-non-transparent-header' );
}
/**
* Checks if page should have mobile transparent header.
*
* @return bool true or false.
*/
public static function mobile_transparent_header() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'enable' === self::$layout['transparent'] && kadence()->sub_option( 'transparent_header_device', 'mobile' ) ? true : false );
}
/**
* Checks if page should show comments.
*
* @return bool true or false.
*/
public static function show_post_navigation() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'show' === self::$layout['navigation'] ? true : false );
}
/**
* Checks if page should show comments.
*
* @return bool true or false.
*/
public static function show_comments() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( post_type_supports( get_post_type(), 'comments' ) && ( comments_open() || get_comments_number() ) && 'show' === self::$layout['comments'] ? true : false );
}
/**
* Checks if page has a sidebar.
*
* @return boolean True will display the sidebar, False will not
*/
public static function has_sidebar() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'enable' === self::$layout['sidebar'] ? true : false );
}
/**
* Checks if page is hiding the footer
*
* @return boolean True will hide the footer, False will not
*/
public static function no_footer() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'disable' === self::$layout['footer'] ? true : false );
}
/**
* Checks if page is hiding the header
*
* @return boolean True will hide the header, False will not
*/
public static function no_header() {
if ( kadence()->option( 'blocks_header' ) ) {
return true;
}
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'disable' === self::$layout['header'] ? true : false );
}
/**
* Checks which sidebar to show if showing.
*
* @return string the sidebar ID to call.
*/
public static function sidebar_id() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return self::$layout['sidebar_id'];
}
/**
* Checks which sidebar to show if showing.
*
* @return string the sidebar ID to call.
*/
public static function sidebar_id_class() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return 'sidebar-slug-' . self::$layout['sidebar_id'];
}
/**
* Checks if page has a sidebar.
*
* @return string left will display the sidebar on the left, right will display sidebar on the right.
*/
public static function sidebar_side() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return self::$layout['side'];
}
/**
* Checks if page has a featured image.
*
* @return bool true or false.
*/
public static function show_feature() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( 'show' === self::$layout['feature'] ? true : false );
}
/**
* Checks if page has a featured image.
*
* @return bool true or false.
*/
public static function show_feature_above() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( self::show_feature() && ( 'above' === self::$layout['feature_position'] || 'behind' === self::$layout['feature_position'] ) ? true : false );
}
/**
* Checks if page has a featured image.
*
* @return bool true or false.
*/
public static function show_feature_below() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return ( self::show_feature() && ( 'below' === self::$layout['feature_position'] ) ? true : false );
}
/**
* Get the feature position.
*
* @return bool true or false.
*/
public static function get_feature_position() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return self::$layout['feature_position'];
}
/**
* Checks if page has a featured image.
*
* @return string hide or show.
*/
public static function get_feature() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return self::$layout['feature'];
}
/**
* Checks if page is using boxed layout.
*
* @return string left will display the sidebar on the left, right will display sidebar on the right.
*/
public static function get_boxed() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return self::$layout['boxed'];
}
/**
* Checks if page has veritcal padding.
*
* @return string left will display the sidebar on the left, right will display sidebar on the right.
*/
public static function get_vertical_padding() {
if ( is_null( self::$layout ) ) {
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return self::$layout['vpadding'];
}
/**
* Checks if page has a sidebar.
*
* @return string left will display the sidebar on the left, right will display sidebar on the right.
*/
public static function get_layout() {
if ( is_null( self::$layout ) ) {
self::check_conditionals();
self::$layout = apply_filters( 'kadence_post_layout', self::check_conditionals() );
}
return self::$layout['layout'];
}
/**
* Checks conditionals to see what layout options are used to create this page.
*
* @return array of layout options.
*/
public static function check_conditionals() {
$boxed = 'boxed';
$layout = 'normal';
$feature = 'hide';
$f_position = 'above';
$comments = 'hide';
$navigation = 'hide';
$title = 'normal';
$sidebar = 'disable';
$sidebar_id = static::PRIMARY_SIDEBAR_SLUG;
$side = 'right';
$vpadding = 'show';
$header = 'enable';
$footer = 'enable';
$content = 'enable';
$transparent = ( kadence()->option( 'transparent_header_enable' ) ? 'enable' : 'disable' );
if ( ( is_singular() || is_front_page() ) && ! is_home() ) {
if ( is_front_page() ) {
$post_id = get_option( 'page_on_front' );
$post_type = 'page';
$trans_type = 'page';
} else {
$post_id = get_the_ID();
$post_type = get_post_type();
$trans_type = $post_type;
}
$postlayout = get_post_meta( $post_id, '_kad_post_layout', true );
$postsidebar = get_post_meta( $post_id, '_kad_post_sidebar_id', true );
$postboxed = get_post_meta( $post_id, '_kad_post_content_style', true );
$postfeature = get_post_meta( $post_id, '_kad_post_feature', true );
$postf_position = get_post_meta( $post_id, '_kad_post_feature_position', true );
$posttitle = get_post_meta( $post_id, '_kad_post_title', true );
$posttrans = get_post_meta( $post_id, '_kad_post_transparent', true );
$postvpadding = get_post_meta( $post_id, '_kad_post_vertical_padding', true );
$postheader = get_post_meta( $post_id, '_kad_post_header', true );
$postfooter = get_post_meta( $post_id, '_kad_post_footer', true );
// header.
if ( isset( $postheader ) && true == $postheader ) {
$header = 'disable';
}
// Footer.
if ( isset( $postfooter ) && true == $postfooter ) {
$footer = 'disable';
}
// Sidebar ID.
if ( isset( $postsidebar ) && ! empty( $postsidebar ) && 'defualt' !== $postsidebar && 'default' !== $postsidebar ) {
$sidebar_id = $postsidebar;
} else {
$sidebar_id = kadence()->option( $post_type . '_sidebar_id', $sidebar_id );
}
// Transparent.
if ( isset( $posttrans ) && ( 'enable' === $posttrans || 'disable' === $posttrans ) ) {
$transparent = $posttrans;
} else {
$option_trans = kadence()->option( 'transparent_header_' . $trans_type, null );
if ( true === $option_trans ) {
$transparent = 'disable';
} else if ( is_null( $option_trans ) ) {
$transparent = 'disable';
}
}
// Title.
if ( isset( $posttitle ) && ( 'above' === $posttitle || 'normal' === $posttitle || 'hide' === $posttitle ) ) {
$title = $posttitle;
} elseif ( isset( $posttitle ) && 'show' === $posttitle ) {
$option_title_layout = kadence()->option( $post_type . '_title_layout' );
if ( 'above' === $option_title_layout || 'normal' === $option_title_layout ) {
$title = $option_title_layout;
}
} else {
$option_title = kadence()->option( $post_type . '_title' );
if ( false === $option_title ) {
$title = 'hide';
} else {
$option_title_layout = kadence()->option( $post_type . '_title_layout' );
if ( 'above' === $option_title_layout || 'normal' === $option_title_layout ) {
$title = $option_title_layout;
}
}
}
// Post Vertical Padding.
if ( isset( $postvpadding ) && ( 'show' === $postvpadding || 'hide' === $postvpadding || 'top' === $postvpadding || 'bottom' === $postvpadding ) ) {
$vpadding = $postvpadding;
} else {
$option_vpadding = kadence()->option( $post_type . '_vertical_padding' );
if ( 'show' === $option_vpadding || 'hide' === $option_vpadding || 'top' === $option_vpadding || 'bottom' === $option_vpadding ) {
$vpadding = $option_vpadding;
}
}
// Post Navigation.
if ( 'post' === $post_type ) {
$option_navigation = kadence()->option( $post_type . '_navigation' );
if ( $option_navigation ) {
$navigation = 'show';
}
}
// Post Comments.
$option_comments = kadence()->option( $post_type . '_comments' );
if ( $option_comments ) {
$comments = 'show';
}
if ( 'product' === $post_type ) {
$comments = 'show';
}
// Post Boxed.
if ( isset( $postboxed ) && ( 'unboxed' === $postboxed || 'boxed' === $postboxed ) ) {
$boxed = $postboxed;
} else {
$option_boxed = kadence()->option( $post_type . '_content_style' );
if ( 'unboxed' === $option_boxed || 'boxed' === $option_boxed ) {
$boxed = $option_boxed;
}
}
// Post Feature.
if ( isset( $postfeature ) && ( 'show' === $postfeature || 'hide' === $postfeature ) ) {
$feature = $postfeature;
} else {
$option_feature = kadence()->option( $post_type . '_feature' );
if ( $option_feature ) {
$feature = 'show';
}
}
// Post Feature position.
if ( isset( $postf_position ) && ( 'above' === $postf_position || 'behind' === $postf_position || 'below' === $postf_position ) ) {
$f_position = $postf_position;
} else {
$option_f_position = kadence()->option( $post_type . '_feature_position' );
if ( 'above' === $option_f_position || 'behind' === $option_f_position || 'below' === $option_f_position ) {
$f_position = $option_f_position;
}
}
// Post Layout.
if ( isset( $postlayout ) && ( 'narrow' === $postlayout || 'fullwidth' === $postlayout ) ) {
$layout = $postlayout;
} elseif ( ( isset( $postlayout ) && 'default' === $postlayout ) || empty( $postlayout ) ) {
$option_layout = kadence()->option( $post_type . '_layout' );
if ( 'narrow' === $option_layout || 'fullwidth' === $option_layout ) {
$layout = $option_layout;
}
}
// Post Sidebar.
if ( isset( $postlayout ) && ( 'left' === $postlayout || 'right' === $postlayout ) ) {
$side = $postlayout;
$sidebar = 'enable';
$layout = $postlayout;
} elseif ( ( isset( $postlayout ) && 'default' === $postlayout ) || empty( $postlayout ) ) {
$option_layout = kadence()->option( $post_type . '_layout' );
if ( 'left' === $option_layout || 'right' === $option_layout ) {
$side = $option_layout;
$sidebar = 'enable';
}
}
} elseif ( is_archive() || is_search() || is_home() || is_404() ) {
if ( is_home() && is_front_page() ) {
$archive_type = 'post_archive';
$trans_type = 'archive';
} elseif ( is_home() && ! is_front_page() ) {
if ( get_query_var( 'tribe_events_front_page' ) ) {
$archive_type = 'tribe_events_archive';
$trans_type = 'archive';
$tribe_option_trans = kadence()->option( 'transparent_header_tribe_events_archive', true );
if ( true === $tribe_option_trans ) {
$temp_transparent = 'disable';
} else {
$temp_transparent = 'enable';
}
$archivetrans = apply_filters( 'kadence_tribe_events_archive_transparent', $temp_transparent );
} else {
$post_id = get_option( 'page_for_posts' );
$archivelayout = get_post_meta( $post_id, '_kad_post_layout', true );
$archiveboxed = get_post_meta( $post_id, '_kad_post_content_style', true );
$archivesidebar = get_post_meta( $post_id, '_kad_post_sidebar_id', true );
$archivefeature = get_post_meta( $post_id, '_kad_post_feature', true );
$archivetitle = get_post_meta( $post_id, '_kad_post_title', true );
$archivetrans = get_post_meta( $post_id, '_kad_post_transparent', true );
$archivevpadding = get_post_meta( $post_id, '_kad_post_vertical_padding', true );
$postf_position = get_post_meta( $post_id, '_kad_post_feature_position', true );
$archive_type = 'post_archive';
$trans_type = 'archive';
}
} elseif ( class_exists( 'woocommerce' ) && is_shop() && ! is_search() ) {
$post_id = wc_get_page_id( 'shop' );
$archivelayout = get_post_meta( $post_id, '_kad_post_layout', true );
$archiveboxed = get_post_meta( $post_id, '_kad_post_content_style', true );
$archivesidebar = get_post_meta( $post_id, '_kad_post_sidebar_id', true );
$archivefeature = get_post_meta( $post_id, '_kad_post_feature', true );
$archivetitle = get_post_meta( $post_id, '_kad_post_title', true );
$archivetrans = get_post_meta( $post_id, '_kad_post_transparent', true );
$archivevpadding = get_post_meta( $post_id, '_kad_post_vertical_padding', true );
$postf_position = get_post_meta( $post_id, '_kad_post_feature_position', true );
$archive_type = 'product_archive';
$trans_type = 'archive';
} elseif ( class_exists( 'woocommerce' ) && ( is_product_category() || is_product_tag() || is_tax( 'product_brands' ) || ( is_shop() && is_search() ) ) ) {
$archive_type = 'product_archive';
$trans_type = 'archive';
} elseif ( function_exists( 'geodir_is_page' ) && ( geodir_is_page( 'post_type' ) || geodir_is_page( 'archive' ) || geodir_is_page( 'search' ) ) ) {
$post_type = geodir_get_current_posttype();
$post_id = (int) \GeoDir_Compatibility::gd_page_id();
$archivelayout = get_post_meta( $post_id, '_kad_post_layout', true );
$archiveboxed = get_post_meta( $post_id, '_kad_post_content_style', true );
$archivesidebar = get_post_meta( $post_id, '_kad_post_sidebar_id', true );
$archivefeature = get_post_meta( $post_id, '_kad_post_feature', true );
$archivetitle = get_post_meta( $post_id, '_kad_post_title', true );
$archivetrans = get_post_meta( $post_id, '_kad_post_transparent', true );
$archivevpadding = get_post_meta( $post_id, '_kad_post_vertical_padding', true );
$postf_position = get_post_meta( $post_id, '_kad_post_feature_position', true );
$archive_type = $post_type . '_archive';
$trans_type = 'archive';
} elseif ( is_post_type_archive( 'llms_membership' ) && function_exists( 'llms_get_page_id' ) ) {
$post_id = llms_get_page_id( 'memberships' );
$archivelayout = get_post_meta( $post_id, '_kad_post_layout', true );
$archiveboxed = get_post_meta( $post_id, '_kad_post_content_style', true );
$archivesidebar = get_post_meta( $post_id, '_kad_post_sidebar_id', true );
$archivefeature = get_post_meta( $post_id, '_kad_post_feature', true );
$archivetitle = get_post_meta( $post_id, '_kad_post_title', true );
$archivetrans = get_post_meta( $post_id, '_kad_post_transparent', true );
$archivevpadding = get_post_meta( $post_id, '_kad_post_vertical_padding', true );
$postf_position = get_post_meta( $post_id, '_kad_post_feature_position', true );
$archive_type = 'llms_membership_archive';
$trans_type = 'archive';
} elseif ( is_tax( 'membership_cat' ) || is_tax( 'membership_tag' ) ) {
$archive_type = 'llms_membership_archive';
$trans_type = 'archive';
} elseif ( is_post_type_archive( 'course' ) && function_exists( 'llms_get_page_id' ) ) {
$post_id = llms_get_page_id( 'courses' );
$archivelayout = get_post_meta( $post_id, '_kad_post_layout', true );
$archiveboxed = get_post_meta( $post_id, '_kad_post_content_style', true );
$archivesidebar = get_post_meta( $post_id, '_kad_post_sidebar_id', true );
$archivefeature = get_post_meta( $post_id, '_kad_post_feature', true );
$archivetitle = get_post_meta( $post_id, '_kad_post_title', true );
$archivetrans = get_post_meta( $post_id, '_kad_post_transparent', true );
$archivevpadding = get_post_meta( $post_id, '_kad_post_vertical_padding', true );
$postf_position = get_post_meta( $post_id, '_kad_post_feature_position', true );
$archive_type = 'course_archive';
$trans_type = 'archive';
} elseif ( is_tax( 'course_cat' ) || is_tax( 'course_tag' ) || is_tax( 'course_track' ) ) {
$archive_type = 'course_archive';
$trans_type = 'archive';
} elseif ( is_post_type_archive( 'tribe_events' ) ) {
$archive_type = 'tribe_events_archive';
$trans_type = 'archive';
$tribe_option_trans = kadence()->option( 'transparent_header_tribe_events_archive', true );
if ( true === $tribe_option_trans ) {
$temp_transparent = 'disable';
} else {
$temp_transparent = 'enable';
}
$archivetrans = apply_filters( 'kadence_tribe_events_archive_transparent', $temp_transparent );
} elseif ( is_tax( 'portfolio-type' ) || is_tax( 'portfolio-tag' ) ) {
$archive_type = 'portfolio_archive';
$trans_type = 'archive';
} elseif ( is_tax( 'staff-group' ) ) {
$archive_type = 'staff_archive';
$trans_type = 'archive';
} elseif ( is_tax( 'testimonial-group' ) ) {
$archive_type = 'testimonial_archive';
$trans_type = 'archive';
} elseif ( ( is_tax( 'ht_kb_category' ) || is_tax( 'ht_kb_tag' ) || is_post_type_archive( 'ht_kb' ) || ( is_search() && array_key_exists( 'ht-kb-search', $_REQUEST ) ) ) ) {
$archive_type = 'ht_kb_archive';
$trans_type = 'archive';
} elseif ( is_search() ) {
$archive_type = 'search_archive';
$trans_type = 'archive';
} elseif ( is_404() ) {
$archive_type = '404';
$trans_type = 'archive';
} elseif ( is_category() || is_tag() ) {
$archive_type = 'post_archive';
$trans_type = 'archive';
} elseif ( is_tax( 'knowledgebase_cat' ) ) {
$archive_type = 'knowledgebase_archive';
$trans_type = 'archive';
} else {
$post_type = get_post_type();
$archive_type = $post_type . '_archive';
$trans_type = 'archive';
}
// Sidebar ID.
if ( isset( $archivesidebar ) && ! empty( $archivesidebar ) && 'default' !== $archivesidebar && 'defualt' !== $archivesidebar ) {
$sidebar_id = $archivesidebar;
} else {
$sidebar_id = kadence()->option( $archive_type . '_sidebar_id', $sidebar_id );
}
// Archive Transparent.
if ( isset( $archivetrans ) && ( 'enable' === $archivetrans || 'disable' === $archivetrans ) ) {
$transparent = $archivetrans;
} else {
$option_trans = kadence()->option( 'transparent_header_' . $trans_type );
if ( true === $option_trans ) {
$transparent = 'disable';
}
}
// Archive Title.
if ( isset( $archivetitle ) && ( 'above' === $archivetitle || 'normal' === $archivetitle || 'hide' === $archivetitle ) ) {
$title = $archivetitle;
} else {
$option_title = kadence()->option( $archive_type . '_title' );
if ( false === $option_title ) {
$title = 'hide';
} else {
$option_title_layout = kadence()->option( $archive_type . '_title_layout' );
if ( empty( $option_title_layout ) ) {
$option_title_layout = kadence()->option( 'post_archive_title_layout' );
}
if ( 'above' === $option_title_layout || 'normal' === $option_title_layout ) {
$title = $option_title_layout;
}
}
}
if ( is_home() && is_front_page() ) {
if ( ! kadence()->option( 'post_archive_home_title' ) ) {
$title = 'hide';
}
}
if ( is_404() ) {
$title = 'normal';
$transparent = 'disable';
}
// Archive Feature.
if ( isset( $archivefeature ) && ( 'show' === $archivefeature || 'hide' === $archivefeature ) ) {
$feature = $archivefeature;
}
// Post Feature position.
if ( isset( $postf_position ) && ( 'above' === $postf_position || 'behind' === $postf_position || 'below' === $postf_position ) ) {
$f_position = $postf_position;
}
// Archive Boxed.
if ( isset( $archiveboxed ) && ( 'unboxed' === $archiveboxed || 'boxed' === $archiveboxed ) ) {
$boxed = $archiveboxed;
} else {
$option_boxed = kadence()->option( $archive_type . '_content_style' );
if ( empty( $option_boxed ) ) {
$option_boxed = kadence()->option( 'post_archive_content_style' );
}
if ( 'unboxed' === $option_boxed || 'boxed' === $option_boxed ) {
$boxed = $option_boxed;
}
}
// Archive Vertical Padding.
if ( isset( $archivevpadding ) && ( 'show' === $archivevpadding || 'hide' === $archivevpadding || 'top' === $archivevpadding || 'bottom' === $archivevpadding ) ) {
$vpadding = $archivevpadding;
} else {
$option_vpadding = kadence()->option( $archive_type . '_vertical_padding' );
if ( $option_vpadding && ( 'show' === $option_vpadding || 'hide' === $option_vpadding || 'top' === $option_vpadding || 'bottom' === $option_vpadding ) ) {
$vpadding = $option_vpadding;
}
}
// Archive Layout.
if ( isset( $archivelayout ) && ( 'narrow' === $archivelayout || 'fullwidth' === $archivelayout ) ) {
$layout = $archivelayout;
} elseif ( ( isset( $archivelayout ) && 'default' === $archivelayout ) || empty( $archivelayout ) ) {
$option_layout = kadence()->option( $archive_type . '_layout' );
if ( empty( $option_layout ) ) {
$option_layout = kadence()->option( 'post_archive_layout' );
}
if ( 'narrow' === $option_layout || 'fullwidth' === $option_layout ) {
$layout = $option_layout;
}
}
// Archive Sidebar.
if ( isset( $archivelayout ) && ( 'left' === $archivelayout || 'right' === $archivelayout ) ) {
$side = $archivelayout;
$sidebar = 'enable';
} elseif ( ( isset( $archivelayout ) && 'default' === $archivelayout ) || empty( $archivelayout ) ) {
$option_layout = kadence()->option( $archive_type . '_layout' );
if ( empty( $option_layout ) ) {
$option_layout = kadence()->option( 'post_archive_layout' );
}
if ( 'left' === $option_layout || 'right' === $option_layout ) {
$side = $option_layout;
$sidebar = 'enable';
}
}
}
$return_array = array(
'layout' => $layout,
'boxed' => $boxed,
'feature' => $feature,
'feature_position' => $f_position,
'comments' => $comments,
'navigation' => $navigation,
'title' => $title,
'transparent' => $transparent,
'side' => $side,
'sidebar' => $sidebar,
'vpadding' => $vpadding,
'sidebar_id' => $sidebar_id,
'footer' => $footer,
'header' => $header,
'content' => $content,
);
return $return_array;
}
/**
* Adds custom classes to indicate whether a sidebar is present to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array Filtered body classes.
*/
public function filter_body_classes( array $classes ) : array {
if ( self::no_header() ) {
$classes[] = 'no-header';
}
if ( self::no_footer() ) {
$classes[] = 'no-footer';
}
if ( self::has_sidebar() ) {
$classes[] = 'has-sidebar';
if ( 'left' === self::sidebar_side() ) {
$classes[] = 'has-left-sidebar';
}
if ( kadence()->option( 'sidebar_sticky' ) ) {
if ( kadence()->option( 'sidebar_sticky_last_widget' ) ) {
$classes[] = 'has-sticky-sidebar-widget';
} else {
$classes[] = 'has-sticky-sidebar';
}
}
}
$post_classname = get_post_meta( get_the_ID(), '_kad_post_classname', true );
if ( isset( $post_classname ) && ! empty( $post_classname ) ) {
$classes[] = $post_classname;
}
$classes[] = 'content-title-style-' . esc_attr( self::get_title_layout() );
$classes[] = 'content-width-' . esc_attr( self::get_layout() );
$classes[] = 'content-style-' . esc_attr( self::get_boxed() );
$classes[] = 'content-vertical-padding-' . esc_attr( self::get_vertical_padding() );
$classes[] = esc_attr( self::get_desk_transparent_class() );
$classes[] = esc_attr( self::get_mobile_transparent_class() );
return $classes;
}
}

View File

@@ -0,0 +1,960 @@
<?php
/**
* Kadence\LearnDash\Component class
*
* @package kadence
*/
namespace Kadence\LearnDash;
use Kadence\Component_Interface;
use Kadence\Kadence_CSS;
use Kadence_Blocks_Frontend;
use LearnDash_Settings_Section;
use function Kadence\kadence;
use function add_action;
use function add_filter;
use function have_posts;
use function the_post;
use function is_search;
use function get_template_part;
use function get_post_type;
/**
* Class for adding LearnDash plugin support.
*/
class Component implements Component_Interface {
/**
* Associative array of Google Fonts to load.
*
* Do not access this property directly, instead use the `get_google_fonts()` method.
*
* @var array
*/
protected static $google_fonts = array();
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'learndash';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'wp_enqueue_scripts', array( $this, 'learndash_styles' ), 60 );
add_filter( 'learndash_wrapper_class', array( $this, 'learndash_lesson_class' ), 10, 2 );
add_filter( 'learndash_course_grid_template', array( $this, 'learndash_course_grid_template' ), 10 );
add_filter( 'ld_course_list', array( $this, 'learndash_course_grid_class' ), 10, 3 );
add_action( 'after_setup_theme', array( $this, 'action_add_editor_styles' ) );
add_filter( 'kadence_dynamic_css', array( $this, 'dynamic_css' ), 20 );
add_action( 'wp_head', array( $this, 'frontend_gfonts' ), 80 );
}
/**
* Filters HTML output of course list.
*
* @since 2.1.0
*
* @param string $output HTML output of category dropdown.
* @param array $atts Shortcode attributes.
* @param array $filter Arguments to retrieve posts.
*/
public function learndash_course_grid_class( $output, $atts, $filter ) {
if ( defined( 'LEARNDASH_COURSE_GRID_VERSION' ) && version_compare( LEARNDASH_COURSE_GRID_VERSION, '2.0.0', '<' ) && kadence()->option( 'learndash_course_grid' ) ) {
// Return if not a grid.
if ( $atts['course_grid'] == 'false' ||
$atts['course_grid'] === false ||
empty( $atts['course_grid'] ) ) {
return $output;
}
$col = empty( $atts['col'] ) ? LEARNDASH_COURSE_GRID_COLUMNS : intval( $atts['col'] );
$col = $col > 6 ? 6 : $col;
$smcol = $col == 1 ? 1 : ceil( $col / 2 );
$output = str_replace( 'ld-course-list-items row', 'ld-course-list-items content-wrap grid-sm-col-' . $smcol . ' grid-lg-col-' . $col . ' grid-cols', $output );
}
return $output;
}
/**
* Enqueue Frontend Fonts
*/
public function frontend_gfonts() {
if ( empty( self::$google_fonts ) ) {
return;
}
if ( class_exists( 'Kadence_Blocks_Frontend' ) ) {
$ktblocks_instance = Kadence_Blocks_Frontend::get_instance();
foreach ( self::$google_fonts as $key => $font ) {
if ( ! array_key_exists( $key, $ktblocks_instance::$gfonts ) ) {
$add_font = array(
'fontfamily' => $font['fontfamily'],
'fontvariants' => ( isset( $font['fontvariants'] ) && ! empty( $font['fontvariants'] ) && is_array( $font['fontvariants'] ) ? $font['fontvariants'] : array() ),
'fontsubsets' => ( isset( $font['fontsubsets'] ) && ! empty( $font['fontsubsets'] ) && is_array( $font['fontsubsets'] ) ? $font['fontsubsets'] : array() ),
);
$ktblocks_instance::$gfonts[ $key ] = $add_font;
} else {
foreach ( $font['fontvariants'] as $variant ) {
if ( ! in_array( $variant, $ktblocks_instance::$gfonts[ $key ]['fontvariants'], true ) ) {
array_push( $ktblocks_instance::$gfonts[ $key ]['fontvariants'], $variant );
}
}
}
}
} else {
add_filter( 'kadence_theme_google_fonts_array', array( $this, 'filter_in_fonts' ) );
}
}
/**
* Filters in pro fronts for output with free.
*
* @param array $font_array any custom css.
* @return array
*/
public function filter_in_fonts( $font_array ) {
// Enqueue Google Fonts.
foreach ( self::$google_fonts as $key => $font ) {
if ( ! array_key_exists( $key, $font_array ) ) {
$add_font = array(
'fontfamily' => $font['fontfamily'],
'fontvariants' => ( isset( $font['fontvariants'] ) && ! empty( $font['fontvariants'] ) && is_array( $font['fontvariants'] ) ? $font['fontvariants'] : array() ),
'fontsubsets' => ( isset( $font['fontsubsets'] ) && ! empty( $font['fontsubsets'] ) && is_array( $font['fontsubsets'] ) ? $font['fontsubsets'] : array() ),
);
$font_array[ $key ] = $add_font;
} else {
foreach ( $font['fontvariants'] as $variant ) {
if ( ! in_array( $variant, $font_array[ $key ]['fontvariants'], true ) ) {
array_push( $font_array[ $key ]['fontvariants'], $variant );
}
}
}
}
return $font_array;
}
/**
* Enqueues WordPress theme styles for the editor.
*/
public function action_add_editor_styles() {
// Enqueue block editor stylesheet.
add_editor_style( 'assets/css/editor/learndash-editor-styles.min.css' );
}
/**
* Override grid template file.
*
* @param string $template the template to load.
*/
public function learndash_course_grid_template( $template ) {
if ( defined( 'LEARNDASH_COURSE_GRID_VERSION' ) && version_compare( LEARNDASH_COURSE_GRID_VERSION, '2.0.0', '<' ) && kadence()->option( 'learndash_course_grid' ) ) {
$template = get_template_directory() . '/inc/components/learndash/course_list_template.php';
}
return $template;
}
/**
* Add some css styles for learndash
*
* @param string $class the class for the wrapper.
* @param object $post the post object.
*/
public function learndash_lesson_class( $class, $post ) {
if ( is_object( $post ) && 'sfwd-lessons' === $post->post_type ) {
$class = $class . ' entry-content';
}
return $class;
}
/**
* Add some css styles for learndash
*/
public function learndash_styles() {
wp_enqueue_style( 'kadence-learndash', get_theme_file_uri( '/assets/css/learndash.min.css' ), array(), KADENCE_VERSION );
if ( class_exists( 'LearnDash_Settings_Section' ) && apply_filters( 'kadence_learndash_colors', true ) && ! defined( 'LDX_DESIGN_UPGRADE_PRO_LEARNDASH_VERSION' ) ) {
$colors = array(
'primary' => \LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Theme_LD30', 'color_primary' ),
'secondary' => \LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Theme_LD30', 'color_secondary' ),
);
if ( ( isset( $colors['primary'] ) && empty( $colors['primary'] ) ) || apply_filters( 'kadence_override_learndash_colors', false ) ) {
ob_start();
?>
.ld-course-list-items .ld_course_grid .thumbnail.course .ld_course_grid_price.ribbon-enrolled {
background: var(--global-palette-btn-bg-hover);
}
.ld-course-list-items .ld_course_grid .thumbnail.course .ld_course_grid_price.ribbon-enrolled:before {
border-top-color: var(--global-palette-btn-bg);
border-right-color: var(--global-palette-btn-bg);
}
.ld-course-list-items .ld_course_grid .btn-primary {
border-color: var(--global-palette-btn-bg);
background: var(--global-palette-btn-bg);
color: var(--global-palette-btn);
box-shadow: 0px 0px 0px -7px rgba(0,0,0,0.0);
}
.ld-course-list-items .ld_course_grid .btn-primary:hover {
color: var(--global-palette-btn-hover);
border-color: var(--global-palette-btn-bg-hover);
background: var(--global-palette-btn-bg-hover);
box-shadow: 0px 15px 25px -7px rgba(0,0,0,0.1);
}
.learndash-wrapper .ld-item-list .ld-item-list-item.ld-is-next,
.learndash-wrapper .wpProQuiz_content .wpProQuiz_questionListItem label:focus-within {
border-color: var(--global-palette1);
}
/*
.learndash-wrapper a:not(.ld-button):not(#quiz_continue_link):not(.ld-focus-menu-link):not(.btn-blue):not(#quiz_continue_link):not(.ld-js-register-account):not(#ld-focus-mode-course-heading):not(#btn-join):not(.ld-item-name):not(.ld-table-list-item-preview):not(.ld-lesson-item-preview-heading),
*/
.learndash-wrapper .ld-breadcrumbs a,
.learndash-wrapper .ld-lesson-item.ld-is-current-lesson .ld-lesson-item-preview-heading,
.learndash-wrapper .ld-lesson-item.ld-is-current-lesson .ld-lesson-title,
.learndash-wrapper .ld-primary-color-hover:hover,
.learndash-wrapper .ld-primary-color,
.learndash-wrapper .ld-primary-color-hover:hover,
.learndash-wrapper .ld-primary-color,
.learndash-wrapper .ld-tabs .ld-tabs-navigation .ld-tab.ld-active,
.learndash-wrapper .ld-button.ld-button-transparent,
.learndash-wrapper .ld-button.ld-button-reverse,
.learndash-wrapper .ld-icon-certificate,
.learndash-wrapper .ld-login-modal .ld-login-modal-login .ld-modal-heading,
#wpProQuiz_user_content a,
.learndash-wrapper .ld-item-list .ld-item-list-item a.ld-item-name:hover,
.learndash-wrapper .ld-focus-comments__heading-actions .ld-expand-button,
.learndash-wrapper .ld-focus-comments__heading a,
.learndash-wrapper .ld-focus-comments .comment-respond a,
.learndash-wrapper .ld-focus-comment .ld-comment-reply a.comment-reply-link:hover,
.learndash-wrapper .ld-expand-button.ld-button-alternate {
color: var(--global-palette1) !important;
}
.learndash-wrapper .ld-focus-comment.bypostauthor>.ld-comment-wrapper,
.learndash-wrapper .ld-focus-comment.role-group_leader>.ld-comment-wrapper,
.learndash-wrapper .ld-focus-comment.role-administrator>.ld-comment-wrapper {
background-color: <?php echo esc_attr( $this->learndash_hex2rgb( kadence()->palette_option( 'palette1' ), '0.03' ) ); ?> !important;
}
.learndash-wrapper .ld-primary-background,
.learndash-wrapper .ld-tabs .ld-tabs-navigation .ld-tab.ld-active:after {
background: var(--global-palette1) !important;
}
.learndash-wrapper .ld-course-navigation .ld-lesson-item.ld-is-current-lesson .ld-status-incomplete,
.learndash-wrapper .ld-focus-comment.bypostauthor:not(.ptype-sfwd-assignment) >.ld-comment-wrapper>.ld-comment-avatar img,
.learndash-wrapper .ld-focus-comment.role-group_leader>.ld-comment-wrapper>.ld-comment-avatar img,
.learndash-wrapper .ld-focus-comment.role-administrator>.ld-comment-wrapper>.ld-comment-avatar img {
border-color: var(--global-palette1) !important;
}
.learndash-wrapper .ld-loading::before {
border-top:3px solid var(--global-palette1) !important;
}
.learndash-wrapper .ld-button:hover:not(.learndash-link-previous-incomplete):not(.ld-button-transparent),
#learndash-tooltips .ld-tooltip:after,
#learndash-tooltips .ld-tooltip,
.learndash-wrapper .ld-primary-background,
.learndash-wrapper .btn-join,
.learndash-wrapper #btn-join,
.learndash-wrapper .ld-button:not(.ld-js-register-account):not(.learndash-link-previous-incomplete):not(.ld-button-transparent),
.learndash-wrapper .ld-expand-button,
.learndash-wrapper .wpProQuiz_content .wpProQuiz_button:not(.wpProQuiz_button_reShowQuestion):not(.wpProQuiz_button_restartQuiz),
.learndash-wrapper .wpProQuiz_content .wpProQuiz_button2,
.learndash-wrapper .ld-focus .ld-focus-sidebar .ld-course-navigation-heading,
.learndash-wrapper .ld-focus .ld-focus-sidebar .ld-focus-sidebar-trigger,
.learndash-wrapper .ld-focus-comments .form-submit #submit,
.learndash-wrapper .ld-login-modal input[type='submit'],
.learndash-wrapper .ld-login-modal .ld-login-modal-register,
.learndash-wrapper .wpProQuiz_content .wpProQuiz_certificate a.btn-blue,
.learndash-wrapper .ld-focus .ld-focus-header .ld-user-menu .ld-user-menu-items a,
#wpProQuiz_user_content table.wp-list-table thead th,
#wpProQuiz_overlay_close,
.learndash-wrapper .ld-expand-button.ld-button-alternate .ld-icon {
background-color: var(--global-palette1) !important;
}
.learndash-wrapper .ld-focus .ld-focus-header .ld-user-menu .ld-user-menu-items:before {
border-bottom-color: var(--global-palette1) !important;
}
.learndash-wrapper .ld-button.ld-button-transparent:hover {
background: transparent !important;
}
.learndash-wrapper .ld-focus .ld-focus-header .sfwd-mark-complete .learndash_mark_complete_button,
.learndash-wrapper .ld-focus .ld-focus-header #sfwd-mark-complete #learndash_mark_complete_button,
.learndash-wrapper .ld-button.ld-button-transparent,
.learndash-wrapper .ld-button.ld-button-alternate,
.learndash-wrapper .ld-expand-button.ld-button-alternate {
background-color:transparent !important;
}
.learndash-wrapper .ld-focus-header .ld-user-menu .ld-user-menu-items a,
.learndash-wrapper .ld-button.ld-button-reverse:hover,
.learndash-wrapper .ld-alert-success .ld-alert-icon.ld-icon-certificate,
.learndash-wrapper .ld-alert-warning .ld-button:not(.learndash-link-previous-incomplete),
.learndash-wrapper .ld-primary-background.ld-status {
color:white !important;
}
.learndash-wrapper .ld-status.ld-status-unlocked {
background-color: <?php echo esc_attr( $this->learndash_hex2rgb( kadence()->palette_option( 'palette1' ), '0.2' ) ); ?> !important;
color: var(--global-palette1) !important;
}
.learndash-wrapper .wpProQuiz_content .wpProQuiz_addToplist {
background-color: <?php echo esc_attr( $this->learndash_hex2rgb( kadence()->palette_option( 'palette1' ), '0.1' ) ); ?> !important;
border: 1px solid var(--global-palette1) !important;
}
.learndash-wrapper .wpProQuiz_content .wpProQuiz_toplistTable th {
background: var(--global-palette1) !important;
}
.learndash-wrapper .wpProQuiz_content .wpProQuiz_toplistTrOdd {
background-color: <?php echo esc_attr( $this->learndash_hex2rgb( kadence()->palette_option( 'palette1' ), '0.1' ) ); ?> !important;
}
.learndash-wrapper .wpProQuiz_content .wpProQuiz_reviewDiv li.wpProQuiz_reviewQuestionTarget {
background-color: var(--global-palette1) !important;
}
<?php
if ( isset( $colors['secondary'] ) && empty( $colors['secondary'] ) ) {
?>
.learndash-wrapper #quiz_continue_link,
.learndash-wrapper .ld-secondary-background,
.learndash-wrapper .learndash_mark_complete_button,
.learndash-wrapper #learndash_mark_complete_button,
.learndash-wrapper .ld-status-complete,
.learndash-wrapper .ld-alert-success .ld-button,
.learndash-wrapper .ld-alert-success .ld-alert-icon {
background-color: var(--global-palette2) !important;
}
.learndash-wrapper .learndash_mark_complete_button:hover, .learndash-wrapper #learndash_mark_complete_button:hover {
background-color: var(--global-palette2) !important;
}
.learndash-wrapper .wpProQuiz_content a#quiz_continue_link {
background-color: var(--global-palette2) !important;
}
.learndash-wrapper .course_progress .sending_progress_bar {
background: var(--global-palette2) !important;
}
.learndash-wrapper .wpProQuiz_content .wpProQuiz_button_reShowQuestion:hover, .learndash-wrapper .wpProQuiz_content .wpProQuiz_button_restartQuiz:hover {
background-color: var(--global-palette2) !important;
opacity: 0.75;
}
.learndash-wrapper .ld-secondary-color-hover:hover,
.learndash-wrapper .ld-secondary-color,
.learndash-wrapper .ld-focus .ld-focus-header .sfwd-mark-complete .learndash_mark_complete_button,
.learndash-wrapper .ld-focus .ld-focus-header #sfwd-mark-complete #learndash_mark_complete_button,
.learndash-wrapper .ld-focus .ld-focus-header .sfwd-mark-complete:after {
color: var(--global-palette2) !important;
}
.learndash-wrapper .ld-secondary-in-progress-icon {
border-left-color: var(--global-palette2) !important;
border-top-color: var(--global-palette2) !important;
}
.learndash-wrapper .ld-alert-success {
border-color: var(--global-palette2);
background-color: transparent !important;
}
.learndash-wrapper .wpProQuiz_content .wpProQuiz_reviewQuestion li.wpProQuiz_reviewQuestionSolved,
.learndash-wrapper .wpProQuiz_content .wpProQuiz_box li.wpProQuiz_reviewQuestionSolved {
background-color: var(--global-palette2) !important;
}
.learndash-wrapper .wpProQuiz_content .wpProQuiz_reviewLegend span.wpProQuiz_reviewColor_Answer {
background-color: var(--global-palette2) !important;
}
<?php
}
$custom_css = ob_get_clean();
if ( ! empty( $custom_css ) ) {
wp_add_inline_style( 'kadence-learndash', $custom_css );
}
}
}
}
/**
* Converts the hex color values to rgb.
*
* @param string $color Color value in hex format.
* @param float|int|boolean $opacity The opacity of color.
*
* @return string Color value in rgb format.
*/
public function learndash_hex2rgb( $color, $opacity = false ) {
$default = 'transparent';
// Return default if no color provided.
if ( empty( $color ) ) {
return $default;
}
// Sanitize $color if "#" is provided.
if ( '#' === $color[0] ) {
$color = substr( $color, 1 );
}
// Check if color has 6 or 3 characters and get values.
if ( strlen( $color ) == 6 ) {
$hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
} elseif ( strlen( $color ) == 3 ) {
$hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
} else {
return $default;
}
// Convert hexadec to rgb.
$rgb = array_map( 'hexdec', $hex );
// Check if opacity is set(rgba or rgb).
if ( $opacity ) {
if ( abs( $opacity ) > 1 ) {
$opacity = 1.0;
}
$output = 'rgba(' . implode( ',', $rgb ) . ',' . $opacity . ')';
} else {
$output = 'rgb(' . implode( ',', $rgb ) . ')';
}
// Return rgb(a) color string.
return $output;
}
/**
* Generates the dynamic css based on customizer options.
*
* @param string $css any custom css.
* @return string
*/
public function dynamic_css( $css ) {
$generated_css = $this->generate_ld_css();
if ( ! empty( $generated_css ) ) {
$css .= "\n/* Kadence LearnDash CSS */\n" . $generated_css;
}
return $css;
}
/**
* Generates the dynamic css based on page options.
*
* @return string
*/
public function generate_ld_css() {
$css = new Kadence_CSS();
$media_query = array();
$media_query['mobile'] = apply_filters( 'kadence_mobile_media_query', '(max-width: 767px)' );
$media_query['tablet'] = apply_filters( 'kadence_tablet_media_query', '(max-width: 1024px)' );
$media_query['desktop'] = apply_filters( 'kadence_desktop_media_query', '(min-width: 1025px)' );
// Learndash.
if ( class_exists( 'SFWD_LMS' ) ) {
// Course Archive Backgrounds.
$css->set_selector( 'body.post-type-archive-sfwd-courses' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_archive_background', 'desktop' ), $css );
$css->set_selector( 'body.post-type-archive-sfwd-courses .content-bg, body.content-style-unboxed.archive.post-type-archive-sfwd-courses .site' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_archive_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.post-type-archive-sfwd-courses' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_archive_background', 'tablet' ), $css );
$css->set_selector( 'body.post-type-archive-sfwd-courses .content-bg, body.content-style-unboxed.archive.post-type-archive-sfwd-courses .site' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_archive_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.post-type-archive-sfwd-courses' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_archive_background', 'mobile' ), $css );
$css->set_selector( 'body.post-type-archive-sfwd-courses .content-bg, body.content-style-unboxed.archive.post-type-archive-sfwd-courses .site' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_archive_content_background', 'mobile' ), $css );
$css->stop_media_query();
// Course Archive Title.
$css->set_selector( '.sfwd-courses-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_archive_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-courses_archive_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-courses_archive_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.sfwd-courses-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-courses_archive_title_height' ), 'desktop' ) );
$css->set_selector( '.sfwd-courses-archive-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'sfwd-courses_archive_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-courses-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_archive_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-courses_archive_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-courses_archive_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.sfwd-courses-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-courses_archive_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-courses-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_archive_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-courses_archive_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-courses_archive_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.sfwd-courses-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-courses_archive_title_height' ), 'mobile' ) );
$css->stop_media_query();
$css->set_selector( '.wp-site-blocks .sfwd-courses-archive-title h1' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-courses_archive_title_color', 'color' ) ) );
$css->set_selector( '.sfwd-courses-archive-title .kadence-breadcrumbs' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-courses_archive_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.sfwd-courses-archive-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-courses_archive_title_breadcrumb_color', 'hover' ) ) );
$css->set_selector( '.sfwd-courses-archive-title .archive-description' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-courses_archive_title_description_color', 'color' ) ) );
$css->set_selector( '.sfwd-courses-archive-title .archive-description a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-courses_archive_title_description_color', 'hover' ) ) );
// Course Title.
$css->set_selector( '.sfwd-courses-title h1' );
$css->render_font( kadence()->option( 'sfwd-courses_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-courses-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-courses_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-courses_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-courses_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-courses-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-courses_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-courses_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-courses_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Course Title Breadcrumbs.
$css->set_selector( '.sfwd-courses-title .kadence-breadcrumbs' );
$css->render_font( kadence()->option( 'sfwd-courses_title_breadcrumb_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-courses_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.sfwd-courses-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-courses_title_breadcrumb_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-courses-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-courses_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-courses_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-courses_title_breadcrumb_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-courses-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-courses_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-courses_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-courses_title_breadcrumb_font' ), 'mobile' ) );
$css->stop_media_query();
// Above Course Title.
$css->set_selector( '.sfwd-courses-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-courses_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-courses_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.sfwd-courses-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-courses_title_height' ), 'desktop' ) );
$css->set_selector( '.sfwd-courses-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'sfwd-courses_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-courses-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-courses_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-courses_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.sfwd-courses-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-courses_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-courses-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-courses_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-courses_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.sfwd-courses-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-courses_title_height' ), 'mobile' ) );
$css->stop_media_query();
// Course Backgrounds.
$css->set_selector( 'body.single-sfwd-courses' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_background', 'desktop' ), $css );
$css->set_selector( 'body.single-sfwd-courses .content-bg, body.content-style-unboxed.single-sfwd-courses .site' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.single-sfwd-courses' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_background', 'tablet' ), $css );
$css->set_selector( 'body.single-sfwd-courses .content-bg, body.content-style-unboxed.single-sfwd-courses .site' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.single-sfwd-courses' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_background', 'mobile' ), $css );
$css->set_selector( 'body.single-sfwd-courses .content-bg, body.content-style-unboxed.single-sfwd-courses .site' );
$css->render_background( kadence()->sub_option( 'sfwd-courses_content_background', 'mobile' ), $css );
$css->stop_media_query();
if ( class_exists( 'LearnDash_Settings_Section' ) ) {
$in_focus_mode = \LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Theme_LD30', 'focus_mode_enabled' );
if ( ! $in_focus_mode ) {
// Lesson Title.
$css->set_selector( '.sfwd-lessons-title h1' );
$css->render_font( kadence()->option( 'sfwd-lessons_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-lessons-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-lessons_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-lessons_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-lessons_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-lessons-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-lessons_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-lessons_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-lessons_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Lesson Title Breadcrumbs.
$css->set_selector( '.sfwd-lessons-title .kadence-breadcrumbs' );
$css->render_font( kadence()->option( 'sfwd-lessons_title_breadcrumb_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-lessons_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.sfwd-lessons-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-lessons_title_breadcrumb_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-lessons-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-lessons_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-lessons_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-lessons_title_breadcrumb_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-lessons-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-lessons_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-lessons_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-lessons_title_breadcrumb_font' ), 'mobile' ) );
$css->stop_media_query();
// Above Lesson Title.
$css->set_selector( '.sfwd-lessons-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-lessons_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-lessons_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-lessons_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.sfwd-lessons-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-lessons_title_height' ), 'desktop' ) );
$css->set_selector( '.sfwd-lessons-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'sfwd-lessons_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-lessons-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-lessons_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-lessons_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-lessons_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.sfwd-lessons-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-lessons_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-lessons-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-lessons_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-lessons_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-lessons_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.sfwd-lessons-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-lessons_title_height' ), 'mobile' ) );
$css->stop_media_query();
// Lesson Backgrounds.
$css->set_selector( 'body.single-sfwd-lessons' );
$css->render_background( kadence()->sub_option( 'sfwd-lessons_background', 'desktop' ), $css );
$css->set_selector( 'body.single-sfwd-lessons .content-bg, body.content-style-unboxed.single-sfwd-lessons .site' );
$css->render_background( kadence()->sub_option( 'sfwd-lessons_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.single-sfwd-lessons' );
$css->render_background( kadence()->sub_option( 'sfwd-lessons_background', 'tablet' ), $css );
$css->set_selector( 'body.single-sfwd-lessons .content-bg, body.content-style-unboxed.single-sfwd-lessons .site' );
$css->render_background( kadence()->sub_option( 'sfwd-lessons_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.single-sfwd-lessons' );
$css->render_background( kadence()->sub_option( 'sfwd-lessons_background', 'mobile' ), $css );
$css->set_selector( 'body.single-sfwd-lessons .content-bg, body.content-style-unboxed.single-sfwd-lessons .site' );
$css->render_background( kadence()->sub_option( 'sfwd-lessons_content_background', 'mobile' ), $css );
$css->stop_media_query();
// Quiz Title.
$css->set_selector( '.sfwd-quiz-title h1' );
$css->render_font( kadence()->option( 'sfwd-quiz_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-quiz-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-quiz_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-quiz_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-quiz_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-quiz-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-quiz_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-quiz_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-quiz_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Quiz Title Breadcrumbs.
$css->set_selector( '.sfwd-quiz-title .kadence-breadcrumbs' );
$css->render_font( kadence()->option( 'sfwd-quiz_title_breadcrumb_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-quiz_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.sfwd-quiz-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-quiz_title_breadcrumb_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-quiz-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-quiz_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-quiz_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-quiz_title_breadcrumb_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-quiz-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-quiz_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-quiz_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-quiz_title_breadcrumb_font' ), 'mobile' ) );
$css->stop_media_query();
// Above Quiz Title.
$css->set_selector( '.sfwd-quiz-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-quiz_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-quiz_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-quiz_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.sfwd-quiz-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-quiz_title_height' ), 'desktop' ) );
$css->set_selector( '.sfwd-quiz-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'sfwd-quiz_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-quiz-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-quiz_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-quiz_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-quiz_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.sfwd-quiz-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-quiz_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-quiz-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-quiz_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-quiz_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-quiz_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.sfwd-quiz-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-quiz_title_height' ), 'mobile' ) );
$css->stop_media_query();
// Quiz Backgrounds.
$css->set_selector( 'body.single-sfwd-quiz' );
$css->render_background( kadence()->sub_option( 'sfwd-quiz_background', 'desktop' ), $css );
$css->set_selector( 'body.single-sfwd-quiz .content-bg, body.content-style-unboxed.single-sfwd-quiz .site' );
$css->render_background( kadence()->sub_option( 'sfwd-quiz_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.single-sfwd-quiz' );
$css->render_background( kadence()->sub_option( 'sfwd-quiz_background', 'tablet' ), $css );
$css->set_selector( 'body.single-sfwd-quiz .content-bg, body.content-style-unboxed.single-sfwd-quiz .site' );
$css->render_background( kadence()->sub_option( 'sfwd-quiz_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.single-sfwd-quiz' );
$css->render_background( kadence()->sub_option( 'sfwd-quiz_background', 'mobile' ), $css );
$css->set_selector( 'body.single-sfwd-quiz .content-bg, body.content-style-unboxed.single-sfwd-quiz .site' );
$css->render_background( kadence()->sub_option( 'sfwd-quiz_content_background', 'mobile' ), $css );
$css->stop_media_query();
// Topic Title.
$css->set_selector( '.sfwd-topic-title h1' );
$css->render_font( kadence()->option( 'sfwd-topic_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-topic-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-topic_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-topic_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-topic_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-topic-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-topic_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-topic_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-topic_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Topic Title Breadcrumbs.
$css->set_selector( '.sfwd-topic-title .kadence-breadcrumbs' );
$css->render_font( kadence()->option( 'sfwd-topic_title_breadcrumb_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-topic_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.sfwd-topic-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-topic_title_breadcrumb_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-topic-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-topic_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-topic_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-topic_title_breadcrumb_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-topic-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-topic_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-topic_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-topic_title_breadcrumb_font' ), 'mobile' ) );
$css->stop_media_query();
// Above Topic Title.
$css->set_selector( '.sfwd-topic-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-topic_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-topic_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-topic_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.sfwd-topic-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-topic_title_height' ), 'desktop' ) );
$css->set_selector( '.sfwd-topic-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'sfwd-topic_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-topic-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-topic_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-topic_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-topic_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.sfwd-topic-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-topic_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-topic-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-topic_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-topic_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-topic_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.sfwd-topic-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-topic_title_height' ), 'mobile' ) );
$css->stop_media_query();
// Topic Backgrounds.
$css->set_selector( 'body.single-sfwd-topic' );
$css->render_background( kadence()->sub_option( 'sfwd-topic_background', 'desktop' ), $css );
$css->set_selector( 'body.single-sfwd-topic .content-bg, body.content-style-unboxed.single-sfwd-topic .site' );
$css->render_background( kadence()->sub_option( 'sfwd-topic_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.single-sfwd-topic' );
$css->render_background( kadence()->sub_option( 'sfwd-topic_background', 'tablet' ), $css );
$css->set_selector( 'body.single-sfwd-topic .content-bg, body.content-style-unboxed.single-sfwd-topic .site' );
$css->render_background( kadence()->sub_option( 'sfwd-topic_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.single-sfwd-topic' );
$css->render_background( kadence()->sub_option( 'sfwd-topic_background', 'mobile' ), $css );
$css->set_selector( 'body.single-sfwd-topic .content-bg, body.content-style-unboxed.single-sfwd-topic .site' );
$css->render_background( kadence()->sub_option( 'sfwd-topic_content_background', 'mobile' ), $css );
$css->stop_media_query();
}
}
// Group Title.
$css->set_selector( '.wp-site-blocks .groupe-title h1' );
$css->render_font( kadence()->option( 'groupe_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.wp-site-blocks .groupe-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'groupe_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'groupe_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'groupe_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.wp-site-blocks .groupe-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'groupe_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'groupe_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'groupe_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Essay Group Breadcrumbs.
$css->set_selector( '.groupe-title .kadence-breadcrumbs' );
$css->render_font( kadence()->option( 'groupe_title_breadcrumb_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'groupe_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.groupe-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'groupe_title_breadcrumb_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.groupe-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'groupe_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'groupe_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'groupe_title_breadcrumb_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.groupe-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'groupe_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'groupe_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'groupe_title_breadcrumb_font' ), 'mobile' ) );
$css->stop_media_query();
// Above Group Title.
$css->set_selector( '.groupe-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'groupe_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'groupe_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'groupe_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.groupe-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'groupe_title_height' ), 'desktop' ) );
$css->set_selector( '.groupe-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'groupe_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.groupe-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'groupe_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'groupe_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'groupe_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.groupe-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'groupe_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.groupe-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'groupe_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'groupe_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'groupe_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.groupe-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'groupe_title_height' ), 'mobile' ) );
$css->stop_media_query();
// Essay Title.
$css->set_selector( '.wp-site-blocks .sfwd-essays-title h1' );
$css->render_font( kadence()->option( 'sfwd-essays_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.wp-site-blocks .sfwd-essays-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-essays_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-essays_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-essays_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.wp-site-blocks .sfwd-essays-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-essays_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-essays_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-essays_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Essay Title Breadcrumbs.
$css->set_selector( '.sfwd-essays-title .kadence-breadcrumbs' );
$css->render_font( kadence()->option( 'sfwd-essays_title_breadcrumb_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-essays_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.sfwd-essays-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'sfwd-essays_title_breadcrumb_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-essays-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-essays_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-essays_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-essays_title_breadcrumb_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-essays-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-essays_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-essays_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-essays_title_breadcrumb_font' ), 'mobile' ) );
$css->stop_media_query();
// Above Essay Title.
$css->set_selector( '.sfwd-essays-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-essays_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-essays_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-essays_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.sfwd-essays-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-essays_title_height' ), 'desktop' ) );
$css->set_selector( '.sfwd-essays-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'sfwd-essays_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.sfwd-essays-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-essays_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-essays_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-essays_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.sfwd-essays-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-essays_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.sfwd-essays-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'sfwd-essays_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'sfwd-essays_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'sfwd-essays_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.sfwd-essays-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'sfwd-essays_title_height' ), 'mobile' ) );
$css->stop_media_query();
// LearnDash Grid Title.
$css->set_selector( '.ld-course-list-items .ld_course_grid.entry .course .entry-title' );
$css->render_font( kadence()->option( 'sfwd-grid_title_font' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.ld-course-list-items .ld_course_grid.entry .course .entry-title' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-grid_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-grid_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-grid_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.ld-course-list-items .ld_course_grid.entry .course .entry-title' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'sfwd-grid_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'sfwd-grid_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'sfwd-grid_title_font' ), 'mobile' ) );
$css->stop_media_query();
}
self::$google_fonts = $css->fonts_output();
return $css->css_output();
}
}

View File

@@ -0,0 +1,258 @@
<?php
/**
* This template overrides the learndash grid output for better support with the Kadence Theme.
*
* @package Kadence
*/
global $post;
$col = empty( $shortcode_atts['col'] ) ? LEARNDASH_COURSE_GRID_COLUMNS : intval( $shortcode_atts['col'] );
$col = $col > 6 ? 6 : $col;
$smcol = $col == 1 ? 1 : $col / 2;
$col = 12 / $col;
$smcol = intval( ceil( 12 / $smcol ) );
$col = is_float( $col ) ? number_format( $col, 1 ) : $col;
$col = str_replace( '.', '-', $col );
$boxed = Kadence\kadence()->option( 'learndash_course_grid_style' );
if ( 'unboxed' === $boxed || 'boxed' === $boxed ) {
$boxed_class = 'grid-loop-' . $boxed;
} else {
$boxed_class = 'grid-loop-unboxed';
}
$course_post_id = $post->ID;
$course_id = $course_post_id;
$user_id = get_current_user_id();
$cg_short_description = get_post_meta( $post->ID, '_learndash_course_grid_short_description', true );
$enable_video = get_post_meta( $post->ID, '_learndash_course_grid_enable_video_preview', true );
$embed_code = get_post_meta( $post->ID, '_learndash_course_grid_video_embed_code', true );
$button_text = get_post_meta( $post->ID, '_learndash_course_grid_custom_button_text', true );
if ( isset( $shortcode_atts['course_id'] ) ) {
$button_link = learndash_get_step_permalink( get_the_ID(), $shortcode_atts['course_id'] );
} else {
$button_link = get_permalink();
}
$button_link = apply_filters( 'learndash_course_grid_custom_button_link', $button_link, $course_post_id );
$button_text = isset( $button_text ) && ! empty( $button_text ) ? $button_text : __( 'See more...', 'kadence' );
$button_text = apply_filters( 'learndash_course_grid_custom_button_text', $button_text, $course_post_id );
$options = get_option( 'sfwd_cpt_options' );
$currency_setting = class_exists( 'LearnDash_Settings_Section' ) ? LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Section_PayPal', 'paypal_currency' ) : null;
$currency = '';
if ( isset( $currency_setting ) || ! empty( $currency_setting ) ) {
$currency = $currency_setting;
} elseif ( isset( $options['modules'] ) && isset( $options['modules']['sfwd-courses_options'] ) && isset( $options['modules']['sfwd-courses_options']['sfwd-courses_paypal_currency'] ) ) {
$currency = $options['modules']['sfwd-courses_options']['sfwd-courses_paypal_currency'];
}
if ( class_exists( 'NumberFormatter' ) ) {
$locale = get_locale();
$number_format = new NumberFormatter( $locale . '@currency=' . $currency, NumberFormatter::CURRENCY );
$currency = $number_format->getSymbol( NumberFormatter::CURRENCY_SYMBOL );
}
/**
* Currency symbol filter hook
*
* @param string $currency Currency symbol
* @param int $course_id
*/
$currency = apply_filters( 'learndash_course_grid_currency', $currency, $course_id );
$course_options = get_post_meta( $course_post_id, "_sfwd-courses", true );
$legacy_short_description = isset( $course_options['sfwd-courses_course_short_description'] ) ? $course_options['sfwd-courses_course_short_description'] : '';
// For LD >= 3.0.
if ( function_exists( 'learndash_get_course_price' ) ) {
$price_args = learndash_get_course_price( $course_id );
$price = $price_args['price'];
$price_type = $price_args['type'];
} else {
$price = $course_options && isset( $course_options['sfwd-courses_course_price'] ) ? $course_options['sfwd-courses_course_price'] : __( 'Free', 'kadence' );
$price_type = $course_options && isset( $course_options['sfwd-courses_course_price_type'] ) ? $course_options['sfwd-courses_course_price_type'] : '';
}
if ( ! empty( $cg_short_description ) ) {
$short_description = $cg_short_description;
} elseif ( ! empty( $legacy_short_description ) ) {
$short_description = $legacy_short_description;
} else {
$short_description = '';
}
/**
* Filter: individual grid class
*
* @param int $course_id Course ID
* @param array $course_options Course options
* @var string
*/
$grid_class = apply_filters( 'learndash_course_grid_class', '', $course_id, $course_options );
$has_access = sfwd_lms_has_access( $course_id, $user_id );
$is_completed = learndash_course_completed( $user_id, $course_id );
$price_text = '';
if ( is_numeric( $price ) && ! empty( $price ) ) {
$price_format = apply_filters( 'learndash_course_grid_price_text_format', '{currency}{price}' );
$price_text = str_replace( array( '{currency}', '{price}' ), array( $currency, $price ), $price_format );
} elseif ( is_string( $price ) && ! empty( $price ) ) {
$price_text = $price;
} elseif ( empty( $price ) ) {
$price_text = __( 'Free', 'kadence' );
}
$class = 'ld_course_grid_price';
$course_class = '';
$ribbon_text = get_post_meta( $post->ID, '_learndash_course_grid_custom_ribbon_text', true );
$ribbon_text = isset( $ribbon_text ) && ! empty( $ribbon_text ) ? $ribbon_text : '';
if ( $has_access && ! $is_completed && $price_type != 'open' && empty( $ribbon_text ) ) {
$class .= ' ribbon-enrolled';
$course_class .= ' learndash-available learndash-incomplete ';
$ribbon_text = __( 'Enrolled', 'kadence' );
} elseif ( $has_access && $is_completed && $price_type != 'open' && empty( $ribbon_text ) ) {
$class .= '';
$course_class .= ' learndash-available learndash-complete';
$ribbon_text = __( 'Completed', 'kadence' );
} elseif ( $price_type == 'open' && empty( $ribbon_text ) ) {
if ( is_user_logged_in() && ! $is_completed ) {
$class .= ' ribbon-enrolled';
$course_class .= ' learndash-available learndash-incomplete';
$ribbon_text = __( 'Enrolled', 'kadence' );
} elseif ( is_user_logged_in() && $is_completed ) {
$class .= '';
$course_class .= ' learndash-available learndash-complete';
$ribbon_text = __( 'Completed', 'kadence' );
} else {
$course_class .= ' learndash-available';
$class .= ' ribbon-enrolled';
$ribbon_text = '';
}
} elseif ( $price_type == 'closed' && empty( $price ) ) {
$class .= ' ribbon-enrolled';
$course_class .= ' learndash-available';
if ( $is_completed ) {
$course_class .= ' learndash-complete';
} else {
$course_class .= ' learndash-incomplete';
}
if ( is_numeric( $price ) ) {
$ribbon_text = $price_text;
} else {
$ribbon_text = '';
}
} else {
if ( empty( $ribbon_text ) ) {
$class .= ! empty( $course_options['sfwd-courses_course_price'] ) ? ' price_' . $currency : ' free';
$course_class .= ' learndash-not-available learndash-incomplete';
$ribbon_text = $price_text;
} else {
$class .= ' custom';
$course_class .= ' learndash-not-available learndash-incomplete';
}
}
/**
* Filter: individual course ribbon text
*
* @param string $ribbon_text Returned ribbon text
* @param int $course_id Course ID
* @param string $price_type Course price type
*/
$ribbon_text = apply_filters( 'learndash_course_grid_ribbon_text', $ribbon_text, $course_id, $price_type );
if ( '' == $ribbon_text ) {
$class = '';
}
/**
* Filter: individual course ribbon class names
*
* @param string $class Returned class names
* @param int $course_id Course ID
* @param array $course_options Course's options
* @var string
*/
$class = apply_filters( 'learndash_course_grid_ribbon_class', $class, $course_id, $course_options );
/**
* Filter: individual course container class names
*
* @param string $course_class Returned class names
* @param int $course_id Course ID
* @param array $course_options Course's options
* @var string
*/
$course_class = apply_filters( 'learndash_course_grid_course_class', $course_class, $course_id, $course_options );
$thumb_size = isset( $shortcode_atts['thumb_size'] ) && ! empty( $shortcode_atts['thumb_size'] ) ? $shortcode_atts['thumb_size'] : 'course-thumb';
ob_start();
?>
<div class="ld_course_grid content-bg entry loop-entry <?php echo esc_attr( $boxed_class ); ?> <?php echo esc_attr( $grid_class ); ?>">
<article id="post-<?php the_ID(); ?>" <?php post_class( $course_class . ' thumbnail course' ); ?>>
<?php if ( $shortcode_atts['show_thumbnail'] == 'true' ) : ?>
<?php if ( $post->post_type == 'sfwd-courses' ) : ?>
<div class="<?php echo esc_attr( $class ); ?>">
<?php echo wp_kses_post( $ribbon_text ); ?>
</div>
<?php endif; ?>
<?php if ( 1 == $enable_video && ! empty( $embed_code ) ) : ?>
<div class="ld_course_grid_video_embed">
<?php
// Retrive oembed HTML if URL provided.
if ( preg_match( '/^http/', $embed_code ) ) {
echo wp_oembed_get( wp_kses_post( $embed_code ), array( 'height' => 600, 'width' => 400 ) );
} else {
echo wp_kses_post( $embed_code );
}
?>
</div>
<?php elseif( has_post_thumbnail() ) : ?>
<a href="<?php echo esc_url( $button_link ); ?>" rel="bookmark">
<?php the_post_thumbnail( $thumb_size ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( $button_link ); ?>" rel="bookmark">
<img alt="" src="<?php echo esc_url( plugins_url( 'no_image.jpg', LEARNDASH_COURSE_GRID_FILE ) ); ?>"/>
</a>
<?php endif;?>
<?php endif; ?>
<?php if ( $shortcode_atts['show_content'] == 'true' ) : ?>
<div class="caption entry-content-wrap">
<h3 class="entry-title"><?php the_title(); ?></h3>
<?php if ( ! empty( $short_description ) ) : ?>
<p class="entry-content"><?php echo do_shortcode( htmlspecialchars_decode( $short_description ) ); ?></p>
<?php endif; ?>
<p class="ld_course_grid_button"><a class="btn btn-primary" role="button" href="<?php echo esc_url( $button_link ); ?>" rel="bookmark"><?php echo esc_html( $button_text ); ?></a></p>
<?php if ( isset( $shortcode_atts['progress_bar'] ) && $shortcode_atts['progress_bar'] == 'true' ) : ?>
<div class="grid-progress"><?php echo do_shortcode( '[learndash_course_progress course_id="' . get_the_ID() . '" user_id="' . get_current_user_id() . '"]' ); ?></div>
<?php endif; ?>
</div><!-- .entry-header -->
<?php endif; ?>
</article><!-- #post-## -->
</div><!-- .ld_course_grid -->
<?php
/**
* Filter: course grid HTML output
*
* @param string $output Individual course grid HTML output
* @param object $post LD course WP_Post object
* @param array $shortcode_atts Shortcode attributes used for this course grid output
* @param int $user_id Current user ID this course grid is displayed to
* @return string Filtered course grid HTML output
*/
echo apply_filters( 'learndash_course_grid_html_output', ob_get_clean(), $post, $shortcode_atts, $user_id ); /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */

View File

@@ -0,0 +1,568 @@
<?php
/**
* Kadence\LifterLMS\Component class
*
* @package kadence
*/
namespace Kadence\LifterLMS;
use Kadence\Kadence_CSS;
use Kadence\Component_Interface;
use Kadence_Blocks_Frontend;
use function Kadence\kadence;
use function add_action;
use function add_filter;
use function add_theme_support;
use function have_posts;
use function the_post;
use function is_search;
use function get_template_part;
use function get_post_type;
/**
* Class for adding LifterLMS plugin support.
*/
class Component implements Component_Interface {
/**
* Associative array of Google Fonts to load.
*
* Do not access this property directly, instead use the `get_google_fonts()` method.
*
* @var array
*/
protected static $google_fonts = array();
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'lifterlms';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_filter( 'kadence_dynamic_css', array( $this, 'dynamic_css' ), 20 );
add_action( 'wp_head', array( $this, 'frontend_gfonts' ), 80 );
add_action( 'after_setup_theme', array( $this, 'action_add_lifterlms_support' ) );
add_filter( 'llms_get_theme_default_sidebar', array( $this, 'llms_sidebar_function' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'lifterlms_styles' ), 60 );
// Remove Content Wrappers.
remove_action( 'lifterlms_before_main_content', 'lifterlms_output_content_wrapper' );
remove_action( 'lifterlms_after_main_content', 'lifterlms_output_content_wrapper_end' );
// Remove Title.
add_filter( 'lifterlms_show_page_title', '__return_false' );
// Remove Sidebar.
remove_action( 'lifterlms_sidebar', 'lifterlms_get_sidebar', 10 );
// Add Content wrappers.
add_action( 'lifterlms_before_main_content', array( $this, 'output_content_wrapper' ) );
add_action( 'lifterlms_after_main_content', array( $this, 'output_main_wrapper_end' ), 8 );
add_action( 'lifterlms_after_main_content', 'lifterlms_get_sidebar', 9 );
add_action( 'lifterlms_after_main_content', array( $this, 'output_content_wrapper_end' ), 10 );
add_filter( 'post_class', array( $this, 'set_lifter_entry_class' ), 10, 3 );
add_filter( 'llms_get_loop_list_classes', array( $this, 'set_lifter_grid_class' ) );
// Change Lifter Columns.
add_filter( 'lifterlms_loop_columns', array( $this, 'set_lifter_columns' ) );
// Remove normal archive Description.
remove_action( 'lifterlms_archive_description', 'lifterlms_archive_description' );
add_filter( 'llms_display_outline_thumbnails', array( $this, 'lifter_syllabus_thumbnails' ) );
// Add div with class for Navigation Position.
add_action( 'lifterlms_before_student_dashboard', array( $this, 'dashboard_wrapper_open' ), 5 );
// Close added div with class for Navigation Position.
add_action( 'lifterlms_after_student_dashboard', array( $this, 'dashboard_wrapper_close' ), 20 );
// Could use to move the nav out of the header area, absolute position seems to work just as well though.
// remove_action( 'lifterlms_student_dashboard_header', 'lifterlms_template_student_dashboard_navigation' );
// add_action( 'lifterlms_before_student_dashboard_content', 'lifterlms_template_student_dashboard_navigation', 5 );
}
/**
* Adds opening div with class for Navigation Position.
*/
public function dashboard_wrapper_open() {
echo '<div class="kadence-llms-dash-wrap kadence-llms-dash-nav-' . esc_attr( kadence()->option( 'llms_dashboard_navigation_layout' ) ) . '">';
}
/**
* Adds closing div with class for Navigation Position.
*/
public function dashboard_wrapper_close() {
echo '</div>';
}
/**
* Adds thumbnail control for syllabus thumbnails
*
* @param boolean $show the whether to show the thumbnail.
*/
public function lifter_syllabus_thumbnails( $show ) {
if ( kadence()->option( 'course_syllabus_thumbs' ) ) {
$show = true;
} else {
$show = false;
}
return $show;
}
/**
* Changes the columns for lifter archives.
*
* @param array $columns the columns.
*/
public function set_lifter_columns( $columns ) {
$dash_id = llms_get_page_id( 'myaccount' );
if ( get_the_ID() === $dash_id ) {
$columns = absint( kadence()->option( 'llms_dashboard_archive_columns' ) );
} elseif ( is_archive() ) {
if ( is_post_type_archive( 'course' ) || is_tax( 'course_cat' ) || is_tax( 'course_tag' ) || is_tax( 'course_track' ) ) {
$columns = absint( kadence()->option( 'course_archive_columns' ) );
} elseif ( is_post_type_archive( 'llms_membership' ) || is_tax( 'membership_cat' ) || is_tax( 'membership_tag' ) ) {
$columns = absint( kadence()->option( 'llms_membership_archive_columns' ) );
}
}
return $columns;
}
/**
* Adds grid class to archive items.
*
* @param array $classes the classes.
*/
public function set_lifter_grid_class( $classes ) {
$classes[] = 'grid-cols';
if ( in_array( 'cols-4', $classes, true ) ) {
$classes[] = 'grid-sm-col-3';
$classes[] = 'grid-lg-col-4';
$classes = array_diff( $classes, array( 'cols-4' ) );
} elseif ( in_array( 'cols-2', $classes, true ) ) {
$classes[] = 'grid-sm-col-2';
$classes[] = 'grid-lg-col-2';
$classes = array_diff( $classes, array( 'cols-2' ) );
} else {
$classes[] = 'grid-sm-col-2';
$classes[] = 'grid-lg-col-3';
$classes = array_diff( $classes, array( 'cols-3' ) );
}
return $classes;
}
/**
* Adds entry class to loop items.
*
* @param array $classes the classes.
* @param string $class the class.
* @param int $post_id the post id.
*/
public function set_lifter_entry_class( $classes, $class, $post_id ) {
if ( in_array( 'llms-loop-item', $classes, true ) ) {
$classes[] = 'entry';
$classes[] = 'content-bg';
}
return $classes;
}
/**
* Adds theme output Wrapper.
*/
public function output_content_wrapper() {
kadence()->print_styles( 'kadence-content' );
/**
* Hook for Hero Section
*/
do_action( 'kadence_hero_header' );
echo '<div id="primary" class="content-area"><div class="content-container site-container">';
$this->output_main_wrapper();
if ( is_archive() && kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/archive_header' );
}
}
/**
* Adds theme main output Wrapper.
*/
public function output_main_wrapper() {
echo '<main id="main" class="site-main" role="main">';
}
/**
* Adds theme main end output Wrapper.
*/
public function output_main_wrapper_end() {
echo '</main>';
}
/**
* Adds theme end output Wrapper.
*/
public function output_content_wrapper_end() {
echo '</div></div>';
}
/**
* Add some css styles for lifterLMS
*/
public function lifterlms_styles() {
wp_enqueue_style( 'kadence-lifterlms', get_theme_file_uri( '/assets/css/lifterlms.min.css' ), array(), KADENCE_VERSION );
}
/**
* Adds theme support for the Lifter plugin.
*
* See: https://lifterlms.com/docs/lifterlms-sidebar-support
*/
public function action_add_lifterlms_support() {
add_theme_support( 'lifterlms-sidebars' );
}
/**
* Display LifterLMS Course and Lesson sidebars
* on courses and lessons in place of the sidebar returned by
* this function
* @param string $id default sidebar id (an empty string).
* @return string
*/
public function llms_sidebar_function( $id ) {
$sidebar_id = 'primary-sidebar';
return $sidebar_id;
}
/**
* Enqueue Frontend Fonts
*/
public function frontend_gfonts() {
if ( empty( self::$google_fonts ) ) {
return;
}
if ( class_exists( 'Kadence_Blocks_Frontend' ) ) {
$ktblocks_instance = Kadence_Blocks_Frontend::get_instance();
foreach ( self::$google_fonts as $key => $font ) {
if ( ! array_key_exists( $key, $ktblocks_instance::$gfonts ) ) {
$add_font = array(
'fontfamily' => $font['fontfamily'],
'fontvariants' => ( isset( $font['fontvariants'] ) && ! empty( $font['fontvariants'] ) && is_array( $font['fontvariants'] ) ? $font['fontvariants'] : array() ),
'fontsubsets' => ( isset( $font['fontsubsets'] ) && ! empty( $font['fontsubsets'] ) && is_array( $font['fontsubsets'] ) ? $font['fontsubsets'] : array() ),
);
$ktblocks_instance::$gfonts[ $key ] = $add_font;
} else {
foreach ( $font['fontvariants'] as $variant ) {
if ( ! in_array( $variant, $ktblocks_instance::$gfonts[ $key ]['fontvariants'], true ) ) {
array_push( $ktblocks_instance::$gfonts[ $key ]['fontvariants'], $variant );
}
}
}
}
} else {
add_filter( 'kadence_theme_google_fonts_array', array( $this, 'filter_in_fonts' ) );
}
}
/**
* Filters in pro fronts for output with free.
*
* @param array $font_array any custom css.
* @return array
*/
public function filter_in_fonts( $font_array ) {
// Enqueue Google Fonts.
foreach ( self::$google_fonts as $key => $font ) {
if ( ! array_key_exists( $key, $font_array ) ) {
$add_font = array(
'fontfamily' => $font['fontfamily'],
'fontvariants' => ( isset( $font['fontvariants'] ) && ! empty( $font['fontvariants'] ) && is_array( $font['fontvariants'] ) ? $font['fontvariants'] : array() ),
'fontsubsets' => ( isset( $font['fontsubsets'] ) && ! empty( $font['fontsubsets'] ) && is_array( $font['fontsubsets'] ) ? $font['fontsubsets'] : array() ),
);
$font_array[ $key ] = $add_font;
} else {
foreach ( $font['fontvariants'] as $variant ) {
if ( ! in_array( $variant, $font_array[ $key ]['fontvariants'], true ) ) {
array_push( $font_array[ $key ]['fontvariants'], $variant );
}
}
}
}
return $font_array;
}
/**
* Generates the dynamic css based on customizer options.
*
* @param string $css any custom css.
* @return string
*/
public function dynamic_css( $css ) {
$generated_css = $this->generate_lifter_css();
if ( ! empty( $generated_css ) ) {
$css .= "\n/* Kadence Lifter CSS */\n" . $generated_css;
}
return $css;
}
/**
* Generates the dynamic css based on page options.
*
* @return string
*/
public function generate_lifter_css() {
$css = new Kadence_CSS();
$media_query = array();
$media_query['mobile'] = apply_filters( 'kadence_mobile_media_query', '(max-width: 767px)' );
$media_query['tablet'] = apply_filters( 'kadence_tablet_media_query', '(max-width: 1024px)' );
$media_query['desktop'] = apply_filters( 'kadence_desktop_media_query', '(min-width: 1025px)' );
// Lifter CSS.
if ( class_exists( 'LifterLMS' ) ) {
// Course Backgrounds.
$css->set_selector( 'body.single-course' );
$css->render_background( kadence()->sub_option( 'course_background', 'desktop' ), $css );
$css->set_selector( 'body.single-course .content-bg, body.content-style-unboxed.single-course .site' );
$css->render_background( kadence()->sub_option( 'course_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.single-course' );
$css->render_background( kadence()->sub_option( 'course_background', 'tablet' ), $css );
$css->set_selector( 'body.single-course .content-bg, body.content-style-unboxed.single-course .site' );
$css->render_background( kadence()->sub_option( 'course_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.single-course' );
$css->render_background( kadence()->sub_option( 'course_background', 'mobile' ), $css );
$css->set_selector( 'body.single-course .content-bg, body.content-style-unboxed.single-course .site' );
$css->render_background( kadence()->sub_option( 'course_content_background', 'mobile' ), $css );
$css->stop_media_query();
// Lesson Backgrounds.
$css->set_selector( 'body.single-lesson' );
$css->render_background( kadence()->sub_option( 'lesson_background', 'desktop' ), $css );
$css->set_selector( 'body.single-lesson .content-bg, body.content-style-unboxed.single-lesson .site' );
$css->render_background( kadence()->sub_option( 'lesson_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.single-lesson' );
$css->render_background( kadence()->sub_option( 'lesson_background', 'tablet' ), $css );
$css->set_selector( 'body.single-lesson .content-bg, body.content-style-unboxed.single-lesson .site' );
$css->render_background( kadence()->sub_option( 'lesson_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.single-lesson' );
$css->render_background( kadence()->sub_option( 'lesson_background', 'mobile' ), $css );
$css->set_selector( 'body.single-lesson .content-bg, body.content-style-unboxed.single-lesson .site' );
$css->render_background( kadence()->sub_option( 'lesson_content_background', 'mobile' ), $css );
$css->stop_media_query();
// Course Archive Backgrounds.
$css->set_selector( 'body.archive.tax-course_cat, body.post-type-archive-course' );
$css->render_background( kadence()->sub_option( 'course_archive_background', 'desktop' ), $css );
$css->set_selector( 'body.archive.tax-course_cat .content-bg, body.content-style-unboxed.archive.tax-course_cat .site, body.post-type-archive-course .content-bg, body.content-style-unboxed.archive.post-type-archive-course .site' );
$css->render_background( kadence()->sub_option( 'course_archive_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.archive.tax-course_cat, body.post-type-archive-course' );
$css->render_background( kadence()->sub_option( 'course_archive_background', 'tablet' ), $css );
$css->set_selector( 'body.archive.tax-course_cat .content-bg, body.content-style-unboxed.archive.tax-course_cat .site, body.post-type-archive-course .content-bg, body.content-style-unboxed.archive.post-type-archive-course .site' );
$css->render_background( kadence()->sub_option( 'course_archive_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.archive.tax-course_cat, body.post-type-archive-course' );
$css->render_background( kadence()->sub_option( 'course_archive_background', 'mobile' ), $css );
$css->set_selector( 'body.archive.tax-course_cat .content-bg, body.content-style-unboxed.archive.tax-course_cat .site, body.post-type-archive-course .content-bg, body.content-style-unboxed.archive.post-type-archive-course .site' );
$css->render_background( kadence()->sub_option( 'course_archive_content_background', 'mobile' ), $css );
$css->stop_media_query();
// Membership Archive Backgrounds.
$css->set_selector( 'body.archive.tax-membership_cat, body.post-type-archive-llms_membership' );
$css->render_background( kadence()->sub_option( 'llms_membership_archive_background', 'desktop' ), $css );
$css->set_selector( 'body.archive.tax-membership_cat .content-bg, body.content-style-unboxed.archive.tax-membership_cat .site, body.post-type-archive-llms_membership .content-bg, body.content-style-unboxed.archive.post-type-archive-llms_membership .site' );
$css->render_background( kadence()->sub_option( 'llms_membership_archive_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.archive.tax-membership_cat, body.post-type-archive-llms_membership' );
$css->render_background( kadence()->sub_option( 'llms_membership_archive_background', 'tablet' ), $css );
$css->set_selector( 'body.archive.tax-membership_cat .content-bg, body.content-style-unboxed.archive.tax-membership_cat .site, body.post-type-archive-llms_membership .content-bg, body.content-style-unboxed.archive.post-type-archive-llms_membership .site' );
$css->render_background( kadence()->sub_option( 'llms_membership_archive_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.archive.tax-membership_cat, body.post-type-archive-llms_membership' );
$css->render_background( kadence()->sub_option( 'llms_membership_archive_background', 'mobile' ), $css );
$css->set_selector( 'body.archive.tax-membership_cat .content-bg, body.content-style-unboxed.archive.tax-membership_cat .site, body.post-type-archive-llms_membership .content-bg, body.content-style-unboxed.archive.post-type-archive-llms_membership .site' );
$css->render_background( kadence()->sub_option( 'llms_membership_archive_content_background', 'mobile' ), $css );
$css->stop_media_query();
// Course Title.
$css->set_selector( '.wp-site-blocks .course-title h1' );
$css->render_font( kadence()->option( 'course_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.wp-site-blocks .course-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'course_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'course_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'course_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.wp-site-blocks .course-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'course_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'course_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'course_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Course Title Breadcrumbs.
$css->set_selector( '.course-title .kadence-breadcrumbs' );
$css->render_font( kadence()->option( 'course_title_breadcrumb_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'course_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.course-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'course_title_breadcrumb_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.course-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'course_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'course_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'course_title_breadcrumb_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.course-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'course_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'course_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'course_title_breadcrumb_font' ), 'mobile' ) );
$css->stop_media_query();
// Above Course Title.
$css->set_selector( '.course-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'course_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'course_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'course_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.course-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'course_title_height' ), 'desktop' ) );
$css->set_selector( '.course-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'course_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.course-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'course_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'course_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'course_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.course-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'course_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.course-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'course_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'course_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'course_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.course-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'course_title_height' ), 'mobile' ) );
$css->stop_media_query();
// Lesson Title.
$css->set_selector( '.wp-site-blocks .lesson-title h1' );
$css->render_font( kadence()->option( 'lesson_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.wp-site-blocks .lesson-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'lesson_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'lesson_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'lesson_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.wp-site-blocks .lesson-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'lesson_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'lesson_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'lesson_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Lesson Title Breadcrumbs.
$css->set_selector( '.lesson-title .kadence-breadcrumbs' );
$css->render_font( kadence()->option( 'lesson_title_breadcrumb_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'lesson_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.lesson-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'lesson_title_breadcrumb_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.lesson-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'lesson_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'lesson_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'lesson_title_breadcrumb_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.lesson-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'lesson_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'lesson_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'lesson_title_breadcrumb_font' ), 'mobile' ) );
$css->stop_media_query();
// Above Lesson Title.
$css->set_selector( '.lesson-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'lesson_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'lesson_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'lesson_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.lesson-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'lesson_title_height' ), 'desktop' ) );
$css->set_selector( '.lesson-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'lesson_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.lesson-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'lesson_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'lesson_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'lesson_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.lesson-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'lesson_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.lesson-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'lesson_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'lesson_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'lesson_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.lesson-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'lesson_title_height' ), 'mobile' ) );
$css->stop_media_query();
// Course Archive Title.
$css->set_selector( '.course-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'course_archive_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'course_archive_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'course_archive_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.course-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'course_archive_title_height' ), 'desktop' ) );
$css->set_selector( '.course-archive-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'course_archive_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.course-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'course_archive_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'course_archive_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'course_archive_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.course-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'course_archive_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.course-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'course_archive_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'course_archive_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'course_archive_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.course-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'course_archive_title_height' ), 'mobile' ) );
$css->stop_media_query();
$css->set_selector( '.wp-site-blocks .course-archive-title h1' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'course_archive_title_color', 'color' ) ) );
$css->set_selector( '.course-archive-title .kadence-breadcrumbs' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'course_archive_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.course-archive-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'course_archive_title_breadcrumb_color', 'hover' ) ) );
$css->set_selector( '.course-archive-title .archive-description' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'course_archive_title_description_color', 'color' ) ) );
$css->set_selector( '.course-archive-title .archive-description a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'course_archive_title_description_color', 'hover' ) ) );
// Membership Archive Title.
$css->set_selector( '.llms_membership-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'llms_membership_archive_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'llms_membership_archive_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'llms_membership_archive_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.llms_membership-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'llms_membership_archive_title_height' ), 'desktop' ) );
$css->set_selector( '.llms_membership-archive-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'llms_membership_archive_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.llms_membership-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'llms_membership_archive_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'llms_membership_archive_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'llms_membership_archive_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.llms_membership-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'llms_membership_archive_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.llms_membership-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'llms_membership_archive_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'llms_membership_archive_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'llms_membership_archive_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.llms_membership-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'llms_membership_archive_title_height' ), 'mobile' ) );
$css->stop_media_query();
$css->set_selector( '.wp-site-blocks .llms_membership-archive-title h1' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'llms_membership_archive_title_color', 'color' ) ) );
$css->set_selector( '.llms_membership-archive-title .kadence-breadcrumbs' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'llms_membership_archive_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.llms_membership-archive-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'llms_membership_archive_title_breadcrumb_color', 'hover' ) ) );
$css->set_selector( '.llms_membership-archive-title .archive-description' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'llms_membership_archive_title_description_color', 'color' ) ) );
$css->set_selector( '.llms_membership-archive-title .archive-description a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'llms_membership_archive_title_description_color', 'hover' ) ) );
}
self::$google_fonts = $css->fonts_output();
return $css->css_output();
}
}

View File

@@ -0,0 +1,64 @@
<?php
/**
* Kadence\Localization\Component class
*
* @package kadence
*/
namespace Kadence\Localization;
use Kadence\Component_Interface;
use function add_action;
use function load_theme_textdomain;
use function get_template_directory;
/**
* Class for managing localization.
*/
class Component implements Component_Interface {
/**
* Absolute path to the translation directory.
*
* @var string
*/
public $translation_directory = '';
/**
* Constructor.
*/
public function __construct() {
// Define the translation directory.
$this->translation_directory = get_template_directory() . '/languages';
}
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'localization';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'after_setup_theme', array( $this, 'action_load_textdomain' ), 1 );
}
/**
* Loads the theme textdomain.
*/
public function action_load_textdomain() {
/*
* Make the theme available for translation. Translations can be filed in the /languages/ directory.
*
* If you want to distribute your theme on wordpress.org and use their language packs feature, you
* should not bundle translations in your theme. In that case you also need to get rid of the
* second parameter in the following function call.
*/
load_theme_textdomain( 'kadence', $this->translation_directory );
}
}

View File

@@ -0,0 +1,154 @@
<?php
/**
* Kadence\Microdata\Component class
*
* @package kadence
*/
namespace Kadence\Microdata;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function apply_filters;
use function Kadence\kadence;
/**
* Class for managing Microdata support.
*
* Exposes template tags:
* * `kadence()->print_microdata()`
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'microdata';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'init', array( $this, 'disable_sitemap_filter' ) );
}
/**
* Check if the user has chosen to disable sitemaps.
*
* @return void
*/
public function disable_sitemap_filter() {
$disable_sitemap = kadence()->option( 'disable_sitemap' ) ? true : false;
if( $disable_sitemap ) {
add_filter( 'wp_sitemaps_enabled', '__return_false' );
}
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'print_microdata' => array( $this, 'print_microdata' ),
);
}
/**
* Prints microdata directly into html elements.
*
* @param string $context html context for microdata.
*/
public function print_microdata( string $context ) {
// If not using, return early.
if ( ! kadence()->option( 'microdata' ) || ! apply_filters( 'kadence_microdata', true, $context ) ) {
return;
}
echo $this->get_microdata( $context ); // phpcs:ignore
}
/**
* Get any necessary microdata.
*
* @param string $context The element to target.
* @return string Our final attribute to add to the element.
*/
public function get_microdata( $context ) {
$data = false;
if ( 'html' === $context ) {
$type = 'WebPage';
if ( class_exists( 'woocommerce' ) && is_product() ) {
$type = 'IndividualProduct';
} elseif ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) {
$type = 'Blog';
} elseif ( is_author() ) {
$type = 'ProfilePage';
}
if ( is_search() ) {
$type = 'SearchResultsPage';
}
$type = apply_filters( 'kadence_html_itemtype', $type );
$data = sprintf(
'itemtype="https://schema.org/%s" itemscope',
esc_html( $type )
);
}
if ( 'header' === $context ) {
$data = 'itemtype="https://schema.org/WPHeader" itemscope';
}
if ( 'navigation' === $context ) {
$data = 'itemtype="https://schema.org/SiteNavigationElement" itemscope';
}
if ( 'article' === $context ) {
$type = apply_filters( 'kadence_article_itemtype', 'CreativeWork' );
$data = sprintf(
'itemtype="https://schema.org/%s" itemscope',
esc_html( $type )
);
}
if ( 'post-author' === $context ) {
$data = 'itemprop="author" itemtype="https://schema.org/Person" itemscope';
}
if ( 'comment-body' === $context ) {
$data = 'itemtype="https://schema.org/Comment" itemscope';
}
if ( 'comment-author' === $context ) {
$data = 'itemprop="author" itemtype="https://schema.org/Person" itemscope';
}
if ( 'sidebar' === $context ) {
$data = 'itemtype="https://schema.org/WPSideBar" itemscope';
}
if ( 'footer' === $context ) {
$data = 'itemtype="https://schema.org/WPFooter" itemscope';
}
if ( 'video' === $context ) {
$data = 'itemprop="video" itemtype="http://schema.org/VideoObject" itemscope';
}
if ( $data ) {
return apply_filters( "kadence_{$context}_schema", $data );
}
}
}

View File

@@ -0,0 +1,308 @@
<?php
/**
* Kadence\Nav_Menus\Component class
*
* @package kadence
*/
namespace Kadence\Nav_Menus;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function Kadence\kadence;
use WP_Query;
use function add_action;
use function add_filter;
use function register_nav_menus;
use function has_nav_menu;
use function wp_nav_menu;
/**
* Class for managing navigation menus.
*
* Exposes template tags:
* * `kadence()->is_primary_nav_menu_active()`
* * `kadence()->display_primary_nav_menu( array $args = [] )`
* * `kadence()->display_fallback_menu( array $args = [] )`
* * `kadence()->is_mobile_nav_menu_active( array $args = [] )`
* * `kadence()->display_mobile_nav_menu( array $args = [] )`
*/
class Component implements Component_Interface, Templating_Component_Interface {
const PRIMARY_NAV_MENU_SLUG = 'primary';
const MOBILE_NAV_MENU_SLUG = 'mobile';
const SECONDARY_NAV_MENU_SLUG = 'secondary';
const FOOTER_NAV_MENU_SLUG = 'footer';
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug(): string {
return 'nav_menus';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'after_setup_theme', [ $this, 'action_register_nav_menus' ] );
add_filter( 'nav_menu_item_title', [ $this, 'filter_primary_nav_menu_dropdown_symbol' ], 10, 4 );
add_filter( 'walker_nav_menu_start_el', [ $this, 'filter_mobile_nav_menu_dropdown_symbol' ], 10, 4 );
require_once get_template_directory() . '/inc/components/nav_menus/nav-widget-settings.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags(): array {
return [
'is_primary_nav_menu_active' => [ $this, 'is_primary_nav_menu_active' ],
'display_primary_nav_menu' => [ $this, 'display_primary_nav_menu' ],
'is_secondary_nav_menu_active' => [ $this, 'is_secondary_nav_menu_active' ],
'display_secondary_nav_menu' => [ $this, 'display_secondary_nav_menu' ],
'is_footer_nav_menu_active' => [ $this, 'is_footer_nav_menu_active' ],
'display_footer_nav_menu' => [ $this, 'display_footer_nav_menu' ],
'display_fallback_menu' => [ $this, 'display_fallback_menu' ],
'is_mobile_nav_menu_active' => [ $this, 'is_mobile_nav_menu_active' ],
'display_mobile_nav_menu' => [ $this, 'display_mobile_nav_menu' ],
];
}
/**
* Registers the navigation menus.
*/
public function action_register_nav_menus() {
register_nav_menus(
[
static::PRIMARY_NAV_MENU_SLUG => esc_html__( 'Primary', 'kadence' ),
static::SECONDARY_NAV_MENU_SLUG => esc_html__( 'Secondary', 'kadence' ),
static::MOBILE_NAV_MENU_SLUG => esc_html__( 'Mobile', 'kadence' ),
static::FOOTER_NAV_MENU_SLUG => esc_html__( 'Footer', 'kadence' ),
]
);
}
/**
* Adds a dropdown symbol to nav menu items with children.
*
* @param string $title The menu item's title.
* @param object $item The current menu item usually a post object.
* @param stdClass $args An object of wp_nav_menu arguments.
* @param int $depth Depth of menu item. Used for padding.
*/
public function filter_primary_nav_menu_dropdown_symbol( $title, $item, $args, $depth ) {
// // Only for our primary and secondary menu location.
// if ( empty( $args->theme_location ) || ( static::PRIMARY_NAV_MENU_SLUG !== $args->theme_location && static::SECONDARY_NAV_MENU_SLUG !== $args->theme_location ) ) {
// return $title;
// }
// // This can still get called because menu location isn't always correct.
// if ( ! empty( $args->menu_id ) && 'mobile-menu' === $args->menu_id ) {
// return $title;
// }
if ( ! isset( $args->sub_arrows ) || empty( $args->sub_arrows ) ) {
return $title;
}
// Add the dropdown for items that have children.
if ( ! empty( $item->classes ) && in_array( 'menu-item-has-children', $item->classes ) ) {
$title = '<span class="nav-drop-title-wrap">' . $title . '<span class="dropdown-nav-toggle">' . kadence()->get_icon( 'arrow-down' ) . '</span></span>';
}
// aria-label="' . esc_attr__( 'Expand child menu', 'kadence' ) . '"
return $title;
}
/**
* Adds a dropdown symbol to nav menu items with children.
*
* @param string $item_output The menu item's starting HTML output.
* @param object $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
* @param object $args An object of wp_nav_menu.
* @return string Modified nav menu HTML.
*/
public function filter_mobile_nav_menu_dropdown_symbol( $item_output, $item, $depth, $args ) {
// Only for our Mobile menu location.
if ( ! isset( $args->show_toggles ) || empty( $args->show_toggles ) ) {
return $item_output;
}
// Add the dropdown for items that have children.
if ( ! empty( $item->classes ) && in_array( 'menu-item-has-children', $item->classes ) ) {
if ( kadence()->is_amp() ) {
return $item_output;
}
$menu_id = ( isset( $args->menu_id ) && ! empty( $args->menu_id ) ? '#' . $args->menu_id : '.menu' );
$toggle_target_string = $menu_id . ' .menu-item-' . $item->ID . ' > .sub-menu';
return '<div class="drawer-nav-drop-wrap">' . $item_output . '<button class="drawer-sub-toggle" data-toggle-duration="10" data-toggle-target="' . esc_attr( $toggle_target_string ) . '" aria-expanded="false"><span class="screen-reader-text">' . esc_html__( 'Toggle child menu', 'kadence' ) . '</span>' . kadence()->get_icon( 'arrow-down', '', false, false ) . '</button></div>';
}
return $item_output;
}
/**
* Checks whether the primary navigation menu is active.
*
* @return bool True if the primary navigation menu is active, false otherwise.
*/
public function is_primary_nav_menu_active(): bool {
return (bool) has_nav_menu( static::PRIMARY_NAV_MENU_SLUG );
}
/**
* Checks whether the secondary navigation menu is active.
*
* @return bool True if the secondary navigation menu is active, false otherwise.
*/
public function is_secondary_nav_menu_active(): bool {
return (bool) has_nav_menu( static::SECONDARY_NAV_MENU_SLUG );
}
/**
* Checks whether the footer navigation menu is active.
*
* @return bool True if the footer navigation menu is active, false otherwise.
*/
public function is_footer_nav_menu_active(): bool {
return (bool) has_nav_menu( static::FOOTER_NAV_MENU_SLUG );
}
/**
* Checks whether the mobile navigation menu is active.
*
* @return bool True if the mobile navigation menu is active, false otherwise.
*/
public function is_mobile_nav_menu_active(): bool {
return (bool) has_nav_menu( static::MOBILE_NAV_MENU_SLUG );
}
/**
* Displays the fallback page navigation menu.
*
* @param array $args Optional. Array of arguments. See wp page menu documentation for a list of supported.
*/
public function display_fallback_menu( array $args = [] ) {
$latest = new WP_Query(
[
'post_type' => 'page',
'orderby' => 'menu_order title',
'order' => 'ASC',
'posts_per_page' => 5,
]
);
$page_ids = wp_list_pluck( $latest->posts, 'ID' );
$page_ids = implode( ',', $page_ids );
$fallback_args = [
'depth' => -1,
'include' => $page_ids,
'show_home' => false,
'before' => '',
'after' => '',
'menu_id' => 'primary-menu',
'menu_class' => 'menu',
'container' => 'ul',
];
add_filter( 'wp_page_menu', [ $this, 'change_page_menu_classes' ], 10, 2 );
wp_page_menu( $fallback_args );
remove_filter( 'wp_page_menu', [ $this, 'change_page_menu_classes' ], 10, 2 );
}
/**
* Displays the primary navigation menu.
*
* @param array $args Optional. Array of arguments. See wp nav menu documentation for a list of supported arguments.
*/
public function change_page_menu_classes( $menu, $args ) {
$menu = str_replace( 'page_item', 'menu-item', $menu );
return $menu;
}
/**
* Displays the primary navigation menu.
*
* @param array $args Optional. Array of arguments. See wp nav menu documentation for a list of supported arguments.
*/
public function display_mobile_nav_menu( array $args = [] ) {
if ( ! isset( $args['container'] ) ) {
$args['container'] = 'ul';
}
if ( ! isset( $args['addon_support'] ) ) {
$args['addon_support'] = true;
}
if ( ! isset( $args['mega_support'] ) && apply_filters( 'kadence_mobile_allow_mega_support', true ) ) {
$args['mega_support'] = true;
}
$args['show_toggles'] = ( kadence()->option( 'mobile_navigation_collapse' ) ? true : false );
$args['theme_location'] = static::MOBILE_NAV_MENU_SLUG;
wp_nav_menu( $args );
}
/**
* Displays the primary navigation menu.
*
* @param array $args Optional. Array of arguments. See wp nav menu documentation for a list of supported arguments.
*/
public function display_primary_nav_menu( array $args = [] ) {
if ( ! isset( $args['container'] ) ) {
$args['container'] = 'ul';
}
if ( ! isset( $args['sub_arrows'] ) ) {
$args['sub_arrows'] = true;
}
if ( ! isset( $args['mega_support'] ) ) {
$args['mega_support'] = true;
}
if ( ! isset( $args['addon_support'] ) ) {
$args['addon_support'] = true;
}
$args['theme_location'] = static::PRIMARY_NAV_MENU_SLUG;
wp_nav_menu( $args );
}
/**
* Displays the Secondary navigation menu.
*
* @param array $args Optional. Array of arguments. See wp nav menu documentation for a list of supported arguments.
*/
public function display_secondary_nav_menu( array $args = [] ) {
if ( ! isset( $args['container'] ) ) {
$args['container'] = 'ul';
}
if ( ! isset( $args['sub_arrows'] ) ) {
$args['sub_arrows'] = true;
}
if ( ! isset( $args['mega_support'] ) ) {
$args['mega_support'] = true;
}
if ( ! isset( $args['addon_support'] ) ) {
$args['addon_support'] = true;
}
$args['theme_location'] = static::SECONDARY_NAV_MENU_SLUG;
wp_nav_menu( $args );
}
/**
* Displays the footer navigation menu.
*
* @param array $args Optional. Array of arguments. See wp nav menu documentation for a list of supported arguments.
*/
public function display_footer_nav_menu( array $args = [] ) {
if ( ! isset( $args['container'] ) ) {
$args['container'] = 'ul';
}
if ( ! isset( $args['depth'] ) ) {
$args['depth'] = 1;
}
if ( ! isset( $args['addon_support'] ) ) {
$args['addon_support'] = true;
}
$args['theme_location'] = static::FOOTER_NAV_MENU_SLUG;
wp_nav_menu( $args );
}
}

View File

@@ -0,0 +1,144 @@
<?php
/**
* Kadence\Nav_Menus\Component class
*
* @package kadence
*/
namespace Kadence\Nav_Menus;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function Kadence\kadence;
use WP_Post;
use WP_Query;
use function add_action;
use function add_filter;
use function register_nav_menus;
use function has_nav_menu;
use function wp_nav_menu;
/**
* Class for adding collapse option to navigation widget.
*/
class Nav_Widget_Settings {
/**
* Default settings.
*
* @var array;
*/
protected $defaults = array(
'collapse' => false,
);
/**
* Default widgets.
*
* @var array;
*/
protected $widgets = array(
'nav_menu',
);
/**
* Construct.
*
* @var array;
*/
public function __construct() {
// Hook in all the right places.
add_action( 'in_widget_form', array( $this, 'add_settings' ), 10, 3 );
add_filter( 'widget_update_callback', array( $this, 'save_settings' ), 10, 4 );
add_filter( 'widget_nav_menu_args', array( $this, 'frontend_settings' ), 10, 4 );
}
/**
* Adds the custom settings to all widgets' forms.
*
* @param WP_Widget $widget An instance of a WP_Widget derived subclass.
* @param mixed $return Return null if new fields are added.
* @param array $instance An array of the widget's settings.
*/
public function add_settings( $widget, $return, $instance ) {
if ( ! $this->is_supported( $widget ) ) {
return null;
}
// Make sure $instance contains at least our default values.
$instance = wp_parse_args( $instance, $this->defaults );
?>
<p>
<input type="checkbox" class="checkbox" id="<?php echo esc_attr( $widget->get_field_id( 'collapse' ) ); ?>" name="<?php echo esc_attr( $widget->get_field_name( 'collapse' ) ); ?>"<?php checked( $instance['collapse'] ); ?> />
<label for="<?php echo esc_attr( $widget->get_field_id( 'collapse' ) ); ?>"><?php esc_html_e( 'Collapse sub menu items', 'kadence' ); ?></label>
</p>
<?php
}
/**
* Saves the custom settings.
*
* @param array $instance The current widget instance's settings.
* @param array $new_instance Array of new widget settings.
* @param array $old_instance Array of old widget settings.
* @param WP_Widget $widget The current widget instance.
*
* @return array The widget instance's settings to get saved.
*/
public function save_settings( $instance, $new_instance, $old_instance, $widget ) {
if ( ! $this->is_supported( $widget ) ) {
return $instance;
}
// Make sure $instance contains at least our default values.
$instance = wp_parse_args( $instance, $this->defaults );
// Now check that a value is actually present, and assign it sanitized.
if ( isset( $new_instance['collapse'] ) ) {
$instance['collapse'] = ! empty( $new_instance['collapse'] ) ? 1 : 0;
}
return $instance;
}
/**
* Filters the arguments for the Navigation Menu widget.
*
* @since 4.2.0
* @since 4.4.0 Added the `$instance` parameter.
*
* @param array $nav_menu_args {
* An array of arguments passed to wp_nav_menu() to retrieve a navigation menu.
*
* @type callable|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty.
* @type mixed $menu Menu ID, slug, or name.
* }
* @param WP_Term $nav_menu Nav menu object for the current menu.
* @param array $args Display arguments for the current widget.
* @param array $instance Array of settings for the current widget.
*/
public function frontend_settings( $nav_menu_args, $nav_menu, $args, $instance ) {
if ( isset( $instance['collapse'] ) && $instance['collapse'] ) {
$nav_menu_args['show_toggles'] = true;
$nav_menu_args['container_class'] = 'collapse-sub-navigation';
$nav_menu_args['menu_class'] = 'menu has-collapse-sub-nav';
if ( ! isset( $nav_menu_args['menu_id'] ) && isset( $args['widget_id'] ) ) {
$nav_menu_args['menu_id'] = 'menu-' . $args['widget_id'];
}
}
return $nav_menu_args;
}
/**
* Checks to make sure this is only for nav widget.
*
* @param WP_Widget $widget The current widget instance.
*
* @return bool if the right widget.
*/
protected function is_supported( $widget ) {
if ( in_array( $widget->id_base, $this->widgets, true ) ) {
return true;
}
return false;
}
}
new Nav_Widget_Settings();

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
<?php
/**
* Kadence\Polylang\Component class
*
* @package kadence
*/
namespace Kadence\Polylang;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function have_posts;
use function the_post;
use function apply_filters;
use function get_template_part;
use function get_post_type;
/**
* Class for adding Polylang plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'polylang';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'wp_enqueue_scripts', array( $this, 'add_styles' ), 60 );
}
/**
* Add some css styles for Restrict Content Pro
*/
public function add_styles() {
wp_enqueue_style( 'kadence-polylang', get_theme_file_uri( '/assets/css/polylang.min.css' ), array(), KADENCE_VERSION );
}
}

View File

@@ -0,0 +1,43 @@
<?php
/**
* Kadence\PWA\Component class
*
* @package kadence
*/
namespace Kadence\PWA;
use Kadence\Component_Interface;
use function add_action;
use function add_theme_support;
/**
* Class for managing PWA support.
*
* @link https://wordpress.org/plugins/pwa/
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'pwa';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'after_setup_theme', array( $this, 'action_add_service_worker_support' ) );
}
/**
* Adds support for theme-specific service worker integrations.
*/
public function action_add_service_worker_support() {
add_theme_support( 'service_worker', true );
}
}

View File

@@ -0,0 +1,39 @@
<?php
/**
* Kadence\Rankmath\Component class
*
* @package kadence
*/
namespace Kadence\Rankmath;
use Kadence\Component_Interface;
/**
* Class for adding Tankmath plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'rankmath';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'wp_enqueue_scripts', array( $this, 'add_styles' ), 60 );
}
/**
* Add some css styles for Restrict Content Pro
*/
public function add_styles() {
wp_enqueue_style( 'kadence-rankmath', get_theme_file_uri( '/assets/css/rankmath.min.css' ), array(), KADENCE_VERSION );
}
}

View File

@@ -0,0 +1,46 @@
<?php
/**
* Kadence\Restrict_Content_Pro\Component class
*
* @package kadence
*/
namespace Kadence\Restrict_Content_Pro;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function have_posts;
use function the_post;
use function apply_filters;
use function get_template_part;
use function get_post_type;
/**
* Class for adding Restrict Content Pro plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'restrict_content_pro';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'wp_enqueue_scripts', array( $this, 'add_styles' ), 60 );
}
/**
* Add some css styles for Restrict Content Pro
*/
public function add_styles() {
wp_enqueue_style( 'kadence-rcp', get_theme_file_uri( '/assets/css/rcp.min.css' ), array(), KADENCE_VERSION );
}
}

View File

@@ -0,0 +1,168 @@
<?php
/**
* Kadence\Scripts\Component class
*
* @package kadence
*/
namespace Kadence\Scripts;
use Kadence\Component_Interface;
use function Kadence\kadence;
use WP_Post;
use function add_action;
use function add_filter;
use function wp_enqueue_script;
use function get_theme_file_uri;
use function get_theme_file_path;
use function wp_script_add_data;
use function wp_localize_script;
/**
* Class for adding scripts to the front end.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'scripts';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'wp_enqueue_scripts', array( $this, 'action_enqueue_scripts' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'ie_11_support_scripts' ), 60 );
}
/**
* Add some very basic support for IE11
*/
public function ie_11_support_scripts() {
if ( apply_filters( 'kadence_add_ie11_support', false ) || kadence()->option( 'ie11_basic_support' ) ) {
wp_enqueue_style( 'kadence-ie11', get_theme_file_uri( '/assets/css/ie.min.css' ), array(), KADENCE_VERSION );
wp_enqueue_script(
'kadence-css-vars-poly',
get_theme_file_uri( '/assets/js/css-vars-ponyfill.min.js' ),
array(),
KADENCE_VERSION,
true
);
wp_script_add_data( 'kadence-css-vars-poly', 'async', true );
wp_script_add_data( 'kadence-css-vars-poly', 'precache', true );
wp_enqueue_script(
'kadence-ie11',
get_theme_file_uri( '/assets/js/ie.min.js' ),
array(),
KADENCE_VERSION,
true
);
wp_script_add_data( 'kadence-ie11', 'async', true );
wp_script_add_data( 'kadence-ie11', 'precache', true );
}
}
/**
* Enqueues a script that improves navigation menu accessibility as well as sticky header etc.
*/
public function action_enqueue_scripts() {
// If the AMP plugin is active, return early.
if ( kadence()->is_amp() ) {
return;
}
$breakpoint = 1024;
if ( kadence()->sub_option( 'header_mobile_switch', 'size' ) ) {
$breakpoint = kadence()->sub_option( 'header_mobile_switch', 'size' );
}
// Enqueue the slide script.
wp_register_script(
'kad-splide',
get_theme_file_uri( '/assets/js/splide.min.js' ),
array(),
KADENCE_VERSION,
true
);
wp_script_add_data( 'kad-splide', 'async', true );
wp_script_add_data( 'kad-splide', 'precache', true );
// Enqueue the slide script.
wp_register_script(
'kadence-slide-init',
get_theme_file_uri( '/assets/js/splide-init.min.js' ),
array( 'kad-splide', 'kadence-navigation' ),
KADENCE_VERSION,
true
);
wp_script_add_data( 'kadence-slide-init', 'async', true );
wp_script_add_data( 'kadence-slide-init', 'precache', true );
wp_localize_script(
'kadence-slide-init',
'kadenceSlideConfig',
array(
'of' => __( 'of', 'kadence' ),
'to' => __( 'to', 'kadence' ),
'slide' => __( 'Slide', 'kadence' ),
'next' => __( 'Next', 'kadence' ),
'prev' => __( 'Previous', 'kadence' ),
)
);
if ( kadence()->option( 'lightbox' ) ) {
// Enqueue the lightbox script.
wp_enqueue_script(
'kadence-simplelightbox',
get_theme_file_uri( '/assets/js/simplelightbox.min.js' ),
array(),
KADENCE_VERSION,
true
);
wp_script_add_data( 'kadence-simplelightbox', 'async', true );
wp_script_add_data( 'kadence-simplelightbox', 'precache', true );
// Enqueue the slide script.
wp_enqueue_script(
'kadence-lightbox-init',
get_theme_file_uri( '/assets/js/lightbox-init.min.js' ),
array( 'kadence-simplelightbox' ),
KADENCE_VERSION,
true
);
wp_script_add_data( 'kadence-lightbox-init', 'async', true );
wp_script_add_data( 'kadence-lightbox-init', 'precache', true );
}
// Main js file.
$file = 'navigation.min.js';
// Lets make it possile to load a lighter file if things are not being used.
if ( 'no' === kadence()->option( 'header_sticky' ) && 'no' === kadence()->option( 'mobile_header_sticky' ) && ! kadence()->option( 'enable_scroll_to_id' ) && ! kadence()->option( 'scroll_up' ) ) {
$file = 'navigation-lite.min.js';
}
wp_enqueue_script(
'kadence-navigation',
get_theme_file_uri( '/assets/js/' . $file ),
array(),
KADENCE_VERSION,
true
);
wp_script_add_data( 'kadence-navigation', 'async', true );
wp_script_add_data( 'kadence-navigation', 'precache', true );
wp_localize_script(
'kadence-navigation',
'kadenceConfig',
array(
'screenReader' => array(
'expand' => __( 'Child menu', 'kadence' ),
'expandOf' => __( 'Child menu of', 'kadence' ),
'collapse' => __( 'Child menu', 'kadence' ),
'collapseOf' => __( 'Child menu of', 'kadence' ),
),
'breakPoints' => array(
'desktop' => esc_attr( $breakpoint ),
'tablet' => 768,
),
'scrollOffset' => apply_filters( 'kadence_scroll_to_id_additional_offset', 0 ),
)
);
}
}

View File

@@ -0,0 +1,372 @@
<?php
/**
* Kadence\Style_Guide\Component class
*
* @package kadence
*/
namespace Kadence\Style_Guide;
use Kadence\Component_Interface;
use function Kadence\kadence;
/**
* Class for managing style guide.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug(): string {
return 'style_guide';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'customize_preview_init', array( $this, 'preview_scripts' ) );
add_action( 'customize_controls_enqueue_scripts', array( $this, 'controls_scripts' ) );
add_action( 'wp_footer', array( $this, 'style_guide_template' ) );
}
/**
* Customizer Preview css
*
* @since 1.0.0
* @return void
*/
public function preview_scripts() {
wp_enqueue_style( 'kadence-style-guide-styles', get_template_directory_uri() . '/assets/css/style-guide.min.css', array(), KADENCE_VERSION );
wp_enqueue_script( 'kadence-style-guide-previewer', get_template_directory_uri() . '/assets/js/style-guide-previewer.min.js', array( 'jquery', 'customize-preview' ), KADENCE_VERSION, false );
}
/**
* Customizer Controls css
*
* @since 1.0.0
* @return void
*/
public function controls_scripts() {
wp_enqueue_script( 'kadence-style-guide-controls', get_template_directory_uri() . '/assets/js/style-guide-controls.min.js', array(), KADENCE_VERSION );
wp_enqueue_style( 'kadence-style-guide-controls', get_template_directory_uri() . '/assets/css/style-guide-controls.min.css', array(), KADENCE_VERSION );
}
/**
* Get Option Type
*
* @access public
* @return string
*/
public function style_guide_template() {
if ( ! is_customize_preview() ) {
return;
}
?>
<div class="kt-style-guide-wrapper">
<?php echo do_shortcode( $this->render_style_guide_markup() ); ?>
</div>
<?php
}
/**
* Customizer Easy Navigation Tour Markup.
*
* @return mixed HTML Markup.
* @since 4.8.0
*/
public function render_style_guide_markup() {
$settings = apply_filters(
'kadence_style_guide_color_palette',
array(
'color_groups' => array(
'accent' => array(
'title' => __( 'Accents', 'kadence' ),
'colors' => array(
'palette1' => array(
'title' => __( 'Accent', 'kadence' ),
'code' => 'var(--global-palette1)',
),
'palette2' => array(
'title' => __( 'Accent - alt', 'kadence' ),
'code' => 'var(--global-palette2)',
),
'palette10' => array(
'title' => __( 'Accent - complement', 'kadence' ),
'code' => 'var(--global-palette10)',
),
),
),
'contrast' => array(
'title' => __( 'Contrast', 'kadence' ),
'colors' => array(
'palette3' => array(
'title' => __( 'Strongest text', 'kadence' ),
'code' => 'var(--global-palette3)',
),
'palette4' => array(
'title' => __( 'Strong text', 'kadence' ),
'code' => 'var(--global-palette4)',
),
'palette5' => array(
'title' => __( 'Medium text', 'kadence' ),
'code' => 'var(--global-palette5)',
),
'palette6' => array(
'title' => __( 'Subtle text', 'kadence' ),
'code' => 'var(--global-palette6)',
),
),
),
'base' => array(
'title' => __( 'Base', 'kadence' ),
'colors' => array(
'palette7' => array(
'title' => __( 'Subtle background', 'kadence' ),
'code' => 'var(--global-palette7)',
),
'palette8' => array(
'title' => __( 'Lighter background', 'kadence' ),
'code' => 'var(--global-palette8)',
),
'palette9' => array(
'title' => __( 'White or offwhite', 'kadence' ),
'code' => 'var(--global-palette9)',
),
),
),
'notice' => array(
'title' => __( 'Notices', 'kadence' ),
'colors' => array(
'palette11' => array(
'title' => __( 'Success', 'kadence' ),
'code' => 'var(--global-palette11)',
),
'palette12' => array(
'title' => __( 'Info', 'kadence' ),
'code' => 'var(--global-palette12)',
),
'palette13' => array(
'title' => __( 'Alert', 'kadence' ),
'code' => 'var(--global-palette13)',
),
'palette14' => array(
'title' => __( 'Warning', 'kadence' ),
'code' => 'var(--global-palette14)',
),
'palette15' => array(
'title' => __( 'Rating', 'kadence' ),
'code' => 'var(--global-palette15)',
),
),
),
),
)
);
ob_start();
?>
<button class="kt-close-tour" type="button">
<span class="screen-reader-text"><?php esc_html_e( 'Close', 'kadence' ); ?></span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>
</button>
<div class="kt-tour-inner-wrap">
<div class="kt-quick-tour-body">
<div class="kt-sg-2-col-grid">
<div class="kt-styler-card">
<p class="kt-sg-card-title"> <?php esc_html_e( 'Site Title & Logo', 'kadence' ); ?>
<div class="kt-sg-element-wrap kt-sg-logo-section <?php echo esc_attr( kadence()->option('logo-title-inline' ) ? 'kt-logo-title-inline' : '' ); ?>">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'section', 'title_tagline' ) ); ?>
<?php do_action( 'kadence_site_branding' ); ?>
</div>
</div>
<div class="kt-sg-1-col-grid">
<div class="kt-styler-card">
<p class="kt-sg-card-title"> <?php esc_html_e( 'Site Icon', 'kadence' ); ?>
<div class="kt-sg-element-wrap">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'section', 'kadence_customizer_site_identity' ) ); ?>
<?php $this->site_icon_update(); ?>
</div>
</div>
<div class="kt-styler-card">
<p class="kt-sg-card-title"> <?php esc_html_e( 'Buttons', 'kadence' ); ?>
<div class="kt-sg-button-element-wrap">
<div class="kt-sg-element-wrap">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'section', 'kadence_customizer_general_buttons', 'general', '', true ) ); ?>
<button class="button kt-quick-tour-item-trigger" <?php echo $this->get_style_guide_shortcut_trigger_attributes( 'section', 'kadence_customizer_general_buttons'); ?>>
<?php esc_html_e( 'Base', 'kadence' ); ?>
</button>
</div>
<div class="kt-sg-element-wrap">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'section', 'kadence_customizer_secondary_button', 'general', '', true ) ); ?>
<button class="button button-style-secondary kt-quick-tour-item-trigger" <?php echo $this->get_style_guide_shortcut_trigger_attributes( 'section', 'kadence_customizer_secondary_button'); ?>>
<?php esc_html_e( 'Secondary', 'kadence' ); ?>
</button>
</div>
<div class="kt-sg-element-wrap">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'section', 'kadence_customizer_outline_button', 'general', '', true ) ); ?>
<button class="button button-style-outline kt-quick-tour-item-trigger" <?php echo $this->get_style_guide_shortcut_trigger_attributes( 'section', 'kadence_customizer_outline_button'); ?>>
<?php esc_html_e( 'Outline', 'kadence' ); ?>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="kt-sg-colors-section kt-styler-card">
<p class="kt-sg-card-title"> <?php esc_html_e( 'Colors', 'kadence' ); ?>
<div class="kt-sg-colors-section-wrap">
<?php
foreach ( $settings['color_groups'] as $key => $group ) {
?>
<div class="kt-sg-color-group-wrap">
<p class="kt-sg-color-group-title"> <?php echo esc_html( $group['title'] ); ?></p>
<div class="kt-sg-color-items-wrap">
<?php
foreach ( $group['colors'] as $key => $data_attrs ) {
?>
<div class="kt-sg-color-item-wrap">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'control', 'kadence_color_palette', 'general', 'data-reference="kt-' . esc_attr( $key ) . '"' ) ); ?>
<span class="kt-sg-color-picker" style="background:<?php echo esc_attr( $data_attrs['code'] ); ?>"> </span>
<span class="kt-sg-field-title"> <?php echo esc_html( $data_attrs['title'] ); ?>
</div>
<?php
}
?>
</div>
</div>
<?php
}
?>
</div>
</div>
<div class="kt-sg-content-section-wrap kt-styler-card">
<p class="kt-sg-card-title"> <?php esc_html_e( 'Typography', 'kadence' ); ?>
<div class="kt-sg-content-inner-wrap">
<div class="kt-sg-heading-more-section">
<div class="kt-sg-heading-card">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'control', 'h1_font', 'general' ) ); ?>
<h1 class="kt-sg-heading"> <?php esc_html_e( 'H1 Heading', 'kadence' ); ?> </h1>
</div>
<div class="kt-sg-heading-card">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'control', 'h2_font', 'general' ) ); ?>
<h2 class="kt-sg-heading"> <?php esc_html_e( 'H2 Heading', 'kadence' ); ?> </h2>
</div>
<div class="kt-sg-heading-card">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'control', 'h3_font', 'general' ) ); ?>
<h3 class="kt-sg-heading"> <?php esc_html_e( 'H3 Heading', 'kadence' ); ?> </h3>
</div>
<div class="kt-sg-heading-card">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'control', 'h4_font', 'general' ) ); ?>
<h4 class="kt-sg-heading"> <?php esc_html_e( 'H4 Heading', 'kadence' ); ?> </h4>
</div>
<div class="kt-sg-heading-card">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'control', 'h5_font', 'general' ) ); ?>
<h5 class="kt-sg-heading"> <?php esc_html_e( 'H5 Heading', 'kadence' ); ?> </h5>
</div>
<div class="kt-sg-heading-card">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'control', 'h6_font', 'general' ) ); ?>
<h6 class="kt-sg-heading"> <?php esc_html_e( 'H6 Heading', 'kadence' ); ?> </h6>
</div>
</div>
<div class="kt-sg-content-section">
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'control', 'base_font', 'general' ) ); ?>
<p> <?php esc_html_e( 'This is your website\'s main body text; it represents the standard paragraph style used across pages and posts. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur cursus pellentesque sem, ac maximus tortor venenatis ac. Aenean convallis metus libero, ut sagittis nisi commodo nec. Sed tempor tempor erat, blandit pellentesque tortor. Proin ipsum velit, dictum ac luctus a, eleifend et sapien.', 'kadence' ); ?> </p>
<?php echo do_shortcode( $this->get_style_guide_shortcut_trigger( 'control', 'base_font', 'general' ) ); ?>
<p> <?php esc_html_e( 'Experiment with various font families, sizes, weights, and styles to establish a clear hierarchy and visual rhythm across your website. Each level of text, from bold, attention-grabbing headings to clean, readable body copy, works together to create balance, enhance readability, and guide users smoothly through your content. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur cursus pellentesque sem, ac maximus tortor venenatis ac. Aenean convallis metus libero, ut sagittis nisi commodo nec. Sed tempor tempor erat, blandit pellentesque tortor.', 'kadence' ); ?> </p>
<p class="kt-sg-card-title"> <?php esc_html_e( 'Quote', 'kadence' ); ?>
<blockquote>
<p> <?php esc_html_e( 'Good typography is invisible. Bad typography is everywhere.', 'kadence' ); ?> </p> <br/>
<footer> <?php esc_html_e( 'Anonymous', 'kadence' ); ?> </footer>
</blockquote>
<p class="kt-sg-content-divider"></p>
<p class="kt-sg-card-title"> <?php esc_html_e( 'Unordered List', 'kadence' ); ?>
<ul>
<li> <?php esc_html_e( 'List Item 1', 'kadence' ); ?> </li>
<li> <?php esc_html_e( 'List Item 2', 'kadence' ); ?> </li>
<li> <?php esc_html_e( 'List Item 3', 'kadence' ); ?> </li>
</ul>
</div>
</div>
</div>
</div>
</div>
<?php
return ob_get_clean();
}
/**
* Render customizer style guide shortcut pencil.
*
* @param string $type Section|Control.
* @param string $name Section name|Control name.
* @param string $context General|Design name.
* @param string $extras if any other parameter to pass.
*
* @return string Trigger for style guide shortcut.
* @since 4.8.0
*/
public function get_style_guide_shortcut_trigger( $type, $name, $context = 'general', $extras = '', $is_small = false ) {
$small_class_string = $is_small ? 'kt-quick-tour-item-small' : '';
return '<span class="kt-quick-tour-item kt-quick-tour-item-trigger ' . $small_class_string . '" data-type="' . $type . '" data-name="' . $name . '" data-context="' . $context . '" ' . $extras . '> <span class="kt-sg-customizer-shortcut"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M0.5 6C0.5 2.96243 2.96243 0.5 6 0.5H18C21.0376 0.5 23.5 2.96243 23.5 6V18C23.5 21.0376 21.0376 23.5 18 23.5H6C2.96243 23.5 0.5 21.0376 0.5 18V6Z" fill="white" fill-opacity="0.8"/> <path d="M0.5 6C0.5 2.96243 2.96243 0.5 6 0.5H18C21.0376 0.5 23.5 2.96243 23.5 6V18C23.5 21.0376 21.0376 23.5 18 23.5H6C2.96243 23.5 0.5 21.0376 0.5 18V6Z" stroke="#E2E8F0"/> <g clip-path="url(#clip0_8460_9362)"> <path d="M14.5 7.50081C14.6273 7.35032 14.7849 7.22784 14.9625 7.14115C15.1402 7.05446 15.334 7.00547 15.5318 6.99731C15.7296 6.98915 15.9269 7.022 16.1112 7.09375C16.2955 7.1655 16.4627 7.27459 16.6022 7.41407C16.7416 7.55354 16.8503 7.72034 16.9213 7.90383C16.9922 8.08732 17.0239 8.28347 17.0143 8.4798C17.0047 8.67612 16.954 8.8683 16.8654 9.04409C16.7769 9.21988 16.6524 9.37542 16.5 9.50081L9.75 16.2508L7 17.0008L7.75 14.2508L14.5 7.50081Z" stroke="#020617" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> <path d="M13.5 8.5L15.5 10.5" stroke="#020617" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </g> <defs> <clipPath id="clip0_8460_9362"> <rect width="12" height="12" fill="white" transform="translate(6 6)"/> </clipPath> </defs> </svg> </span> </span>';
}
/**
* Render customizer style guide shortcut pencil.
*
* @param string $type Section|Control.
* @param string $name Section name|Control name.
* @param string $context General|Design name.
* @param string $extras if any other parameter to pass.
*
* @return string Trigger for style guide shortcut.
* @since 4.8.0
*/
public function get_style_guide_shortcut_trigger_attributes( $type, $name, $context = 'general', $extras = '' ) {
return 'data-type="' . $type . '" data-name="' . $name . '" data-context="' . $context . '" ' . $extras . '';
}
/**
* Render site icon.
*
* @since 4.8.0
*/
public function site_icon_update() {
$uploaded_icon_url = get_site_icon_url( 32 );
$site_icon_url = empty( $uploaded_icon_url ) ? admin_url() . 'images/wordpress-logo.svg' : $uploaded_icon_url;
?>
<p class="kt-sg-site-icon-wrap">
<span class="kt-sg-site-icon-aside-divider"></span>
<span class="kt-sg-site-icon-inner-wrap">
<img class="kt-sg-site-icon" alt="<?php esc_attr_e( 'Site Icon', 'kadence' ); ?>" src="<?php echo esc_url( $site_icon_url ); ?>" />
<span class="kt-sg-site-title"> <?php echo esc_html( get_bloginfo( 'name' ) ); ?> </span>
<span class="kt-sg-site-blogdescription"> <?php echo esc_attr( ! empty( get_bloginfo( 'description' ) ) ? ' - ' . get_bloginfo( 'description' ) : '' ); ?> </span>
</span>
<span class="kt-sg-site-icon-aside-divider"></span>
</p>
<?php
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
<?php
/**
* Kadence\Surecart\Component class
*
* @package kadence
*/
namespace Kadence\Surecart;
use Kadence\Component_Interface;
/**
* Class for adding Tankmath plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'surecart';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'wp_enqueue_scripts', array( $this, 'add_styles' ), 60 );
}
/**
* Add some css styles for Restrict Content Pro
*/
public function add_styles() {
wp_enqueue_style( 'kadence-surecart', get_theme_file_uri( '/assets/css/surecart.min.css' ), array(), KADENCE_VERSION );
}
}

View File

@@ -0,0 +1,73 @@
<?php
/**
* Kadence\Template_Parts\Component class
*
* @package kadence
*/
namespace Kadence\Template_Parts;
use Kadence\Component_Interface;
use Kadence\Templating_Component_Interface;
use function Kadence\kadence;
use function add_action;
use function add_filter;
use function do_action;
use function is_active_sidebar;
use function dynamic_sidebar;
/**
* Class for managing template parts.
*
* Exposes template tags:
* * `kadence()->get_template()`
*/
class Component implements Component_Interface, Templating_Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'template_parts';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
}
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array {
return array(
'get_template' => array( $this, 'get_template' ),
);
}
/**
* Get other templates assing attributes and including the file.
*
* @param string $slug The slug name for the generic template.
* @param string $name The name of the specialised template.
* @param array $args Arguments. (default: array).
*/
public static function get_template( $slug, $name = null, $args = array() ) {
/**
* Pass custom variables to the template file.
*/
foreach ( (array) $args as $key => $value ) {
set_query_var( $key, $value );
}
return get_template_part( $slug, $name );
}
}

View File

@@ -0,0 +1,131 @@
<?php
/**
* Kadence\Template_Tags class
*
* @package kadence
*/
namespace Kadence;
use InvalidArgumentException;
use BadMethodCallException;
use RuntimeException;
/**
* Template tags entry point.
*
* This class provides access to all available template tag methods.
*
* Its instance can be accessed through `kadence()`. For example, if there is a template tag called `posted_on`, it can
* be accessed via `kadence()->posted_on()`.
*/
class Template_Tags {
/**
* Associative array of all available template tags.
*
* Method names are the keys, their callback information the values.
*
* @var array
*/
protected $template_tags = [];
/**
* Constructor.
*
* Sets the theme components.
*
* @param array $components Optional. List of theme templating components. Each of these must implement the
* Templating_Component_Interface interface.
*
* @throws InvalidArgumentException Thrown if one of the $components does not implement
* Templating_Component_Interface.
*/
public function __construct( array $components = [] ) {
// Set the template tags for the components.
foreach ( $components as $component ) {
// Bail if a templating component is invalid.
if ( ! $component instanceof Templating_Component_Interface ) {
throw new InvalidArgumentException(
sprintf(
/* translators: 1: classname/type of the variable, 2: interface name */
__( 'The theme templating component %1$s does not implement the %2$s interface.', 'kadence' ),
gettype( $component ),
Templating_Component_Interface::class
)
);
}
$this->set_template_tags( $component );
}
}
/**
* Magic call method.
*
* Will proxy to the template tag $method, unless it is not available, in which case an exception will be thrown.
*
* @param string $method Template tag name.
* @param array $args Template tag arguments.
* @return mixed Template tag result, or null if template tag only outputs markup.
*
* @throws BadMethodCallException Thrown if the template tag does not exist.
*/
public function __call( string $method, array $args ) {
if ( ! isset( $this->template_tags[ $method ] ) ) {
throw new BadMethodCallException(
sprintf(
/* translators: %s: template tag name */
__( 'The template tag %s does not exist.', 'kadence' ),
'kadence()->' . $method . '()'
)
);
}
return call_user_func_array( $this->template_tags[ $method ]['callback'], $args );
}
/**
* Sets template tags for a given theme templating component.
*
* @param Templating_Component_Interface $component Theme templating component.
*
* @throws InvalidArgumentException Thrown when one of the template tags is invalid.
* @throws RuntimeException Thrown when one of the template tags conflicts with an existing one.
*/
protected function set_template_tags( Templating_Component_Interface $component ) {
$tags = $component->template_tags();
foreach ( $tags as $method_name => $callback ) {
if ( is_callable( $callback ) ) {
$callback = [ 'callback' => $callback ];
}
if ( ! is_array( $callback ) || ! isset( $callback['callback'] ) ) {
throw new InvalidArgumentException(
sprintf(
/* translators: 1: template tag method name, 2: component class name */
__( 'The template tag method %1$s registered by theme component %2$s must either be a callable or an array.', 'kadence' ),
$method_name,
get_class( $component )
)
);
}
if ( isset( $this->template_tags[ $method_name ] ) ) {
throw new RuntimeException(
sprintf(
/* translators: 1: template tag method name, 2: component class name */
__( 'The template tag method %1$s registered by theme component %2$s conflicts with an already registered template tag of the same name.', 'kadence' ),
$method_name,
get_class( $component )
)
);
}
$this->template_tags[ $method_name ] = $callback;
}
}
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* Kadence\Templating_Component_Interface interface
*
* @package kadence
*/
namespace Kadence;
/**
* Interface for a theme component that exposes template tags.
*/
interface Templating_Component_Interface {
/**
* Gets template tags to expose as methods on the Template_Tags class instance, accessible through `kadence()`.
*
* @return array Associative array of $method_name => $callback_info pairs. Each $callback_info must either be
* a callable or an array with key 'callable'. This approach is used to reserve the possibility of
* adding support for further arguments in the future.
*/
public function template_tags() : array;
}

View File

@@ -0,0 +1,653 @@
<?php
/**
* Kadence\The_Events_Calendar\Component class
*
* @package kadence
*/
namespace Kadence\The_Events_Calendar;
use Kadence\Component_Interface;
use Kadence\Kadence_CSS;
use Kadence_Blocks_Frontend;
use function Kadence\kadence;
use function add_action;
use function have_posts;
use function the_post;
use function apply_filters;
use function get_template_part;
use function tribe_get_events_link;
use function tribe_get_event_label_plural;
/**
* Class for adding The_Events_Calendar plugin support.
*/
class Component implements Component_Interface {
/**
* Associative array of Google Fonts to load.
*
* Do not access this property directly, instead use the `get_google_fonts()` method.
*
* @var array
*/
protected static $google_fonts = array();
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'the_events_calendar';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'kadence_tribe_events_before_main_tag', array( $this, 'tribe_wapper_before' ) );
add_action( 'kadence_tribe_events_after_main_tag', array( $this, 'tribe_wapper_after' ) );
add_action( 'kadence_tribe_archive_events_before_template', array( $this, 'tribe_archive_wapper_before' ), 5 );
add_action( 'kadence_tribe_archive_events_after_template', array( $this, 'tribe_archive_wapper_after' ) );
add_action( 'kadence_tribe_events_header', array( $this, 'tribe_event_title_area' ), 10, 2 );
add_filter( 'kadence_dynamic_css', array( $this, 'dynamic_css' ), 20 );
add_action( 'wp_head', array( $this, 'frontend_gfonts' ), 80 );
add_action( 'wp_enqueue_scripts', array( $this, 'tribe_styles' ), 60 );
add_filter( 'kadence_theme_options_defaults', array( $this, 'add_option_defaults' ) );
add_filter( 'tribe_default_events_block_single_classes', array( $this, 'events_template_classes' ) );
}
/**
* Add event template classes.
*
* @param array $classes template classes.
* @return array
*/
public function events_template_classes( $classes ) {
$classes[] = 'entry';
$classes[] = 'content-bg';
return $classes;
}
/**
* Generates the dynamic css based on customizer options.
*
* @param string $css any custom css.
* @return string
*/
public function dynamic_css( $css ) {
$generated_css = $this->generate_events_css();
if ( ! empty( $generated_css ) ) {
$css .= "\n/* Kadence Events CSS */\n" . $generated_css;
}
return $css;
}
/**
* Generates the dynamic css based on page options.
*
* @return string
*/
public function generate_events_css() {
$css = new Kadence_CSS();
$media_query = array();
$media_query['mobile'] = apply_filters( 'kadence_mobile_media_query', '(max-width: 767px)' );
$media_query['tablet'] = apply_filters( 'kadence_tablet_media_query', '(max-width: 1024px)' );
$media_query['desktop'] = apply_filters( 'kadence_desktop_media_query', '(min-width: 1025px)' );
$css->set_selector( ':root' );
$css->add_property( '--tec-color-background-events', 'transparent' );
$css->add_property( '--tec-color-text-event-date', 'var(--global-palette3)' );
$css->add_property( '--tec-color-text-event-title', 'var(--global-palette3)' );
$css->add_property( '--tec-color-text-events-title', 'var(--global-palette3)' );
$css->add_property( '--tec-color-background-view-selector-list-item-hover', 'var(--global-palette7)' );
$css->add_property( '--tec-color-background-secondary', 'var(--global-palette8)' );
$css->add_property( '--tec-color-link-primary', 'var(--global-palette3)' );
$css->add_property( '--tec-color-icon-active', 'var(--global-palette3)' );
$css->add_property( '--tec-color-day-marker-month', 'var(--global-palette4)' );
$css->add_property( '--tec-color-border-active-month-grid-hover', 'var(--global-palette5)' );
$css->add_property( '--tec-color-accent-primary', 'var(--global-palette1)' );
$css->add_property( '--tec-color-border-default', 'var(--global-gray-400)' );
// Events Hero Title Area.
$css->set_selector( '.tribe_events-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'tribe_events_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'tribe_events_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'tribe_events_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.tribe_events-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'tribe_events_title_height' ), 'desktop' ) );
$css->set_selector( '.tribe_events-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'tribe_events_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.tribe_events-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'tribe_events_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'tribe_events_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'tribe_events_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.tribe_events-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'tribe_events_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.tribe_events-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'tribe_events_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'tribe_events_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'tribe_events_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.tribe_events-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'tribe_events_title_height' ), 'mobile' ) );
$css->stop_media_query();
// Events Title Font.
$css->set_selector( '.single-tribe_events #inner-wrap .tribe_events-title h1' );
$css->render_font( kadence()->option( 'tribe_events_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.single-tribe_events #inner-wrap .tribe_events-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'tribe_events_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'tribe_events_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'tribe_events_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.single-tribe_events #inner-wrap .tribe_events-title h1' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'tribe_events_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'tribe_events_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'tribe_events_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Events Title Breadcrumbs.
$css->set_selector( '.tribe_events-title .kadence-breadcrumbs' );
$css->render_font( kadence()->option( 'tribe_events_title_breadcrumb_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'tribe_events_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.tribe_events-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'tribe_events_title_breadcrumb_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.tribe_events-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'tribe_events_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'tribe_events_title_breadcrumb_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'tribe_events_title_breadcrumb_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.tribe_events-title .kadence-breadcrumbs' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'tribe_events_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'tribe_events_title_breadcrumb_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'tribe_events_title_breadcrumb_font' ), 'mobile' ) );
$css->stop_media_query();
// Events Title Back Link.
$css->set_selector( '.tribe_events-title .tribe-events-back a' );
$css->render_font( kadence()->option( 'tribe_events_title_back_link_font' ), $css );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'tribe_events_title_back_link_color', 'color' ) ) );
$css->set_selector( '.tribe_events-title .tribe-events-back a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'tribe_events_title_back_link_color', 'hover' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.tribe_events-title .tribe-events-back a' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'tribe_events_title_back_link_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'tribe_events_title_back_link_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'tribe_events_title_back_link_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.tribe_events-title .tribe-events-back a' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'tribe_events_title_back_link_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'tribe_events_title_back_link_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'tribe_events_title_back_link_font' ), 'mobile' ) );
$css->stop_media_query();
// Single Event Backgrounds.
$css->set_selector( 'body.single-tribe_events' );
$css->render_background( kadence()->sub_option( 'tribe_events_background', 'desktop' ), $css );
$css->set_selector( 'body.single-tribe_events .content-bg, body.content-style-unboxed.single-tribe_events .site' );
$css->render_background( kadence()->sub_option( 'tribe_events_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.single-tribe_events' );
$css->render_background( kadence()->sub_option( 'tribe_events_background', 'tablet' ), $css );
$css->set_selector( 'body.single-tribe_events .content-bg, body.content-style-unboxed.single-tribe_events .site' );
$css->render_background( kadence()->sub_option( 'tribe_events_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.single-tribe_events' );
$css->render_background( kadence()->sub_option( 'tribe_events_background', 'mobile' ), $css );
$css->set_selector( 'body.single-tribe_events .content-bg, body.content-style-unboxed.single-tribe_events .site' );
$css->render_background( kadence()->sub_option( 'tribe_events_content_background', 'mobile' ), $css );
$css->stop_media_query();
// Events Backgrounds.
$css->set_selector( 'body.post-type-archive-tribe_events .site, body.post-type-archive-tribe_events.content-style-unboxed .site' );
$css->render_background( kadence()->sub_option( 'tribe_events_archive_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.post-type-archive-tribe_events .site, body.post-type-archive-tribe_events.content-style-unboxed .site' );
$css->render_background( kadence()->sub_option( 'tribe_events_archive_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.post-type-archive-tribe_events .site, body.post-type-archive-tribe_events.content-style-unboxed .site' );
$css->render_background( kadence()->sub_option( 'tribe_events_archive_content_background', 'mobile' ), $css );
$css->stop_media_query();
$new_styles = [];
$css->set_selector( '#primary .tribe-events, #primary .tribe-events-single' );
// Events Bar.
if ( $this->should_include_tribe_setting_css( 'tec_events_bar', 'events_bar_text_color' ) ) {
$text_color = $this->get_tribe_option( 'tec_events_bar', 'events_bar_text_color' );
// Text color.
if ( ! empty( $text_color ) ) {
$css->add_property( '--tec-color-text-events-bar-input', $text_color);
$css->add_property( '--tec-color-text-events-bar-input-placeholder', $text_color);
$css->add_property( '--tec-color-text-view-selector-list-item', $text_color);
$css->add_property( '--tec-color-text-view-selector-list-item-hover', $text_color);
}
}
if ( $this->should_include_tribe_setting_css( 'tec_events_bar', 'find_events_button_text_color' ) ) {
$button_text_color = $this->get_tribe_option( 'tec_events_bar', 'find_events_button_text_color' );
if ( ! empty( $button_text_color ) ) {
$css->add_property( '--tec-color-text-events-bar-submit-button', $button_text_color);
}
}
if ( $this->should_include_tribe_setting_css( 'tec_events_bar', 'events_bar_icon_color_choice' ) ) {
if ( 'custom' === $this->get_tribe_option( 'tec_events_bar', 'events_bar_icon_color_choice' ) ) {
$icon_color = $this->get_tribe_option( 'tec_events_bar', 'events_bar_icon_color' );
} elseif (
'accent' === $this->get_tribe_option( 'tec_events_bar', 'events_bar_icon_color_choice' )
&& $this->should_include_tribe_setting_css( 'global_elements', 'accent_color' )
) {
$icon_color = $this->get_tribe_option( 'global_elements', 'accent_color' );
}
if ( ! empty( $icon_color ) ) {
$css->add_property( '--tec-color-icon-events-bar', $icon_color);
$css->add_property( '--tec-color-icon-events-bar-hover', $icon_color);
$css->add_property( '--tec-color-icon-events-bar-active', $icon_color);
}
}
if ( $this->should_include_tribe_setting_css( 'tec_events_bar', 'find_events_button_color_choice' ) ) {
$button_color = $this->get_tribe_option( 'tec_events_bar', 'find_events_button_color' );
$button_color_rgb = $css->hex2rgb( $button_color );
} elseif ( $this->should_include_tribe_setting_css( 'global_elements', 'accent_color' ) ) {
$button_color = $this->get_tribe_option( 'global_elements', 'accent_color' );
$button_color_rgb = $css->hex2rgb( $button_color );
}
if ( ! empty( $button_color ) ) {
$css->add_property( '--tec-color-background-events-bar-submit-button', $button_color);
//$new_styles[] = "--tec-color-background-events-bar-submit-button: {$button_color};";
}
if ( ! empty( $button_color_rgb ) ) {
$css->add_property( '--tec-color-background-events-bar-submit-button-hover', 'rgba( ' . $button_color_rgb . ', 0.8)');
$css->add_property( '--tec-color-background-events-bar-submit-button-active', 'rgba( ' . $button_color_rgb . ', 0.9)');
}
if ( $this->should_include_tribe_setting_css( 'tec_events_bar', 'events_bar_background_color_choice' ) ) {
if ( $this->should_include_tribe_setting_css( 'tec_events_bar', 'events_bar_background_color' ) ) {
if ( 'custom' == $this->get_tribe_option( 'tec_events_bar', 'events_bar_background_color_choice' ) ) {
$background_color = $this->get_tribe_option( 'tec_events_bar', 'events_bar_background_color' );
} elseif (
'global_background' == $this->get_tribe_option( 'tec_events_bar', 'events_bar_background_color_choice' )
&& $this->should_include_tribe_setting_css( 'global_elements', 'background_color' )
) {
$background_color = $this->get_tribe_option( 'global_elements', 'background_color' );
}
}
if ( ! empty( $background_color ) ) {
$css->add_property( '--tec-color-background-events-bar', $background_color);
$css->add_property( '--tec-color-background-events-bar-tabs', $background_color);
}
}
if ( $this->should_include_tribe_setting_css( 'tec_events_bar', 'events_bar_border_color_choice' ) ) {
$border_color = $this->get_tribe_option( 'tec_events_bar', 'events_bar_border_color' );
if ( ! empty( $border_color ) ) {
$css->add_property( '--tec-color-border-events-bar', $border_color);
}
}
// Event Title overrides.
if ( $this->should_include_tribe_setting_css( 'global_elements', 'event_title_color' ) ) {
$title_color = $this->get_tribe_option( 'global_elements', 'event_title_color' );
$css->add_property( '--tec-color-text-events-title', $title_color);
$css->add_property( '--tec-color-text-event-title', $title_color);
}
if (
$this->should_include_tribe_setting_css( 'month_view', 'multiday_event_bar_color_choice' )
&& $this->should_include_tribe_setting_css( 'month_view', 'multiday_event_bar_color' )
) {
$bar_color = $this->get_tribe_option( 'month_view', 'multiday_event_bar_color' );
$bar_color_rgb = $css->hex2rgb( $bar_color );
$css->add_property( '--tec-color-background-primary-multiday', 'rgba( ' . $bar_color_rgb . ', 0.24)');
$css->add_property( '--tec-color-background-primary-multiday-hover', 'rgba( ' . $bar_color_rgb . ', 0.34)');
$css->add_property( '--tec-color-background-primary-multiday-active', 'rgba( ' . $bar_color_rgb . ', 0.34)');
$css->add_property( '--tec-color-background-secondary-multiday', 'rgba( ' . $bar_color_rgb . ', 0.24)');
$css->add_property( '--tec-color-background-secondary-multiday-hover', 'rgba( ' . $bar_color_rgb . ', 0.34)');
}
if ( $this->should_include_tribe_setting_css( 'month_view', 'date_marker_color' ) ) {
$date_marker_color = $this->get_tribe_option( 'month_view', 'date_marker_color' );
$css->add_property( '--tec-color-day-marker-month', $date_marker_color);
$css->add_property( '--tec-color-day-marker-past-month', $date_marker_color);
}
if ( $this->should_include_tribe_setting_css( 'month_view', 'days_of_week_color' ) ) {
$days_of_week_color = $this->get_tribe_option( 'month_view', 'days_of_week_color' );$css->add_property( '--tec-color-text-day-of-week-month', $days_of_week_color);
}
self::$google_fonts = $css->fonts_output();
return $css->css_output();
}
/**
* Function to simplify getting an option value.
*
* @since 4.13.3
*
* @param string $setting The setting slug, like 'grid_lines_color'.
*
* @return string The setting value;
*/
public function get_tribe_option( $section, $setting ) {
if ( empty( $setting ) || empty( $section ) ) {
return '';
}
if ( ! function_exists( 'tribe' ) ) {
return '';
}
return tribe( 'customizer' )->get_option( array( $section, $setting ) );
}
/**
* Check if a setting should be included in the CSS output by making sure it's not the default.
*
* @param string $section_slug The slug for the section.
* @param string $setting The setting slug.
*
* @return boolean If the setting should be added to the style template.
*/
public function should_include_tribe_setting_css( $section_slug, $setting ) {
if ( empty( $setting ) || empty( $section_slug ) ) {
return false;
}
if ( ! function_exists( 'tribe' ) ) {
return false;
}
$setting_value = tribe( 'customizer' )->get_option( array( $section_slug, $setting ) );
$section = tribe( 'customizer' )->get_section( $section_slug );
// Something has gone wrong and we can't get the section.
if ( false === $section ) {
return false;
}
return ! empty( $setting_value ) && $section->get_default( $setting ) !== $setting_value;
}
/**
* Outputs the theme wrappers.
*/
public function tribe_event_title_area( $area = 'normal', $template_class = null ) {
$enable = kadence()->option( 'tribe_events_title' );
if ( ! $enable ) {
return;
}
$placement = kadence()->option( 'tribe_events_title_layout' );
if ( $area !== $placement ) {
return;
}
if ( 'normal' === $area ) {
if ( ! kadence()->show_in_content_title() ) {
return;
}
$classes = array();
$classes[] = 'entry-header';
$classes[] = 'tribe_events-title';
$classes[] = 'title-align-' . ( kadence()->sub_option( 'tribe_events_title_align', 'desktop' ) ? kadence()->sub_option( 'tribe_events_title_align', 'desktop' ) : 'inherit' );
$classes[] = 'title-tablet-align-' . ( kadence()->sub_option( 'tribe_events_title_align', 'tablet' ) ? kadence()->sub_option( 'tribe_events_title_align', 'tablet' ) : 'inherit' );
$classes[] = 'title-mobile-align-' . ( kadence()->sub_option( 'tribe_events_title_align', 'mobile' ) ? kadence()->sub_option( 'tribe_events_title_align', 'mobile' ) : 'inherit' );
?>
<div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
<?php
}
$elements = kadence()->option( 'tribe_events_title_elements' );
if ( isset( $elements ) && is_array( $elements ) && ! empty( $elements ) ) {
foreach ( $elements as $item ) {
if ( kadence()->sub_option( 'tribe_events_title_element_' . $item, 'enabled' ) ) {
switch ( $item ) {
case 'breadcrumb':
$template = apply_filters( 'kadence_title_elements_template_path', 'template-parts/title/' . $item, $item, $area );
get_template_part( $template );
break;
case 'back_link':
if ( null !== $template_class & is_object( $template_class ) ) {
$template_class->template( 'single-event/back-link' );
} else {
$template = apply_filters( 'kadence_title_elements_template_path', 'template-parts/title/' . $item, $item, $area );
get_template_part( $template );
}
break;
case 'title':
do_action( 'kadence_single_before_entry_title' );
if ( null !== $template_class & is_object( $template_class ) ) {
$template_class->template( 'single-event/title' );
} else {
the_title( '<h1 class="entry-title tribe-events-single-event-title">', '</h1>' );
}
do_action( 'kadence_single_after_entry_title' );
break;
default:
# code...
break;
}
}
}
}
if ( 'normal' === $area ) {
?>
</div>
<?php
}
}
/**
* Add Defaults
*
* @access public
* @param array $defaults registered option defaults with kadence theme.
* @return array
*/
public function add_option_defaults( $defaults ) {
// event.
$event_addons = array(
'tribe_events_title' => true,
'tribe_events_title_layout' => 'normal',
'tribe_events_title_inner_layout' => 'standard',
'tribe_events_title_height' => array(
'size' => array(
'mobile' => '',
'tablet' => '',
'desktop' => '',
),
'unit' => array(
'mobile' => 'px',
'tablet' => 'px',
'desktop' => 'px',
),
),
'tribe_events_title_font' => array(
'size' => array(
'desktop' => '',
),
'lineHeight' => array(
'desktop' => '',
),
'family' => 'inherit',
'google' => false,
'weight' => '',
'variant' => '',
'color' => '',
),
'tribe_events_layout' => 'narrow',
'tribe_events_content_style' => 'boxed',
'tribe_events_vertical_padding' => 'show',
'tribe_events_sidebar_id' => 'sidebar-primary',
'tribe_events_title_elements' => array( 'breadcrumb', 'back_link', 'title' ),
'tribe_events_title_element_title' => array(
'enabled' => true,
),
'tribe_events_title_element_breadcrumb' => array(
'enabled' => false,
'show_title' => true,
),
'tribe_events_title_element_back_link' => array(
'enabled' => true,
),
'tribe_events_background' => '',
'tribe_events_content_background' => '',
'tribe_events_title_background' => array(
'desktop' => array(
'color' => '',
),
),
'tribe_events_title_featured_image' => false,
'tribe_events_title_overlay_color' => array(
'color' => '',
),
'tribe_events_title_top_border' => array(),
'tribe_events_title_bottom_border' => array(),
'tribe_events_title_align' => array(
'mobile' => '',
'tablet' => '',
'desktop' => '',
),
'tribe_events_title_breadcrumb_color' => array(
'color' => '',
'hover' => '',
),
'tribe_events_title_breadcrumb_font' => array(
'size' => array(
'desktop' => '',
),
'lineHeight' => array(
'desktop' => '',
),
'family' => 'inherit',
'google' => false,
'weight' => '',
'variant' => '',
),
'tribe_events_title_back_link_color' => array(
'color' => '',
'hover' => '',
),
'tribe_events_title_back_link_font' => array(
'size' => array(
'desktop' => '',
),
'lineHeight' => array(
'desktop' => '',
),
'family' => 'inherit',
'google' => false,
'weight' => '',
'variant' => '',
),
'tribe_events_archive_title' => false,
'tribe_events_archive_title_layout' => 'normal',
'tribe_events_archive_layout' => 'normal',
'tribe_events_archive_sidebar_id' => 'sidebar-primary',
'tribe_events_archive_content_style' => 'unboxed',
'tribe_events_archive_vertical_padding' => 'show',
'transparent_header_tribe_events_archive' => true,
);
$defaults = array_merge(
$defaults,
$event_addons
);
return $defaults;
}
/**
* Outputs the theme wrappers.
*/
public function tribe_archive_wapper_before() {
?>
<div id="primary" class="content-area">
<div class="content-container site-container">
<?php
}
/**
* Outputs the theme wrappers.
*/
public function tribe_archive_wapper_after() {
get_sidebar();
?>
</div>
</div>
<?php
}
/**
* Outputs the theme wrappers.
*/
public function tribe_wapper_before() {
/**
* Hook for Hero Section
*/
do_action( 'kadence_hero_header' );
?>
<div id="primary" class="content-area">
<div class="content-container site-container">
<?php
}
/**
* Outputs the theme wrappers.
*/
public function tribe_wapper_after() {
get_sidebar();
?>
</div>
</div>
<?php
}
/**
* Add some css styles for Tribe Events
*/
public function tribe_styles() {
wp_enqueue_style( 'kadence-tribe', get_theme_file_uri( '/assets/css/tribe-events.min.css' ), array(), KADENCE_VERSION );
}
/**
* Enqueue Frontend Fonts
*/
public function frontend_gfonts() {
if ( empty( self::$google_fonts ) ) {
return;
}
if ( class_exists( 'Kadence_Blocks_Frontend' ) ) {
$ktblocks_instance = Kadence_Blocks_Frontend::get_instance();
foreach ( self::$google_fonts as $key => $font ) {
if ( ! array_key_exists( $key, $ktblocks_instance::$gfonts ) ) {
$add_font = array(
'fontfamily' => $font['fontfamily'],
'fontvariants' => ( isset( $font['fontvariants'] ) && ! empty( $font['fontvariants'] ) && is_array( $font['fontvariants'] ) ? $font['fontvariants'] : array() ),
'fontsubsets' => ( isset( $font['fontsubsets'] ) && ! empty( $font['fontsubsets'] ) && is_array( $font['fontsubsets'] ) ? $font['fontsubsets'] : array() ),
);
$ktblocks_instance::$gfonts[ $key ] = $add_font;
} else {
foreach ( $font['fontvariants'] as $variant ) {
if ( ! in_array( $variant, $ktblocks_instance::$gfonts[ $key ]['fontvariants'], true ) ) {
array_push( $ktblocks_instance::$gfonts[ $key ]['fontvariants'], $variant );
}
}
}
}
} else {
add_filter( 'kadence_theme_google_fonts_array', array( $this, 'filter_in_fonts' ) );
}
}
/**
* Filters in pro fronts for output with free.
*
* @param array $font_array any custom css.
* @return array
*/
public function filter_in_fonts( $font_array ) {
// Enqueue Google Fonts.
foreach ( self::$google_fonts as $key => $font ) {
if ( ! array_key_exists( $key, $font_array ) ) {
$add_font = array(
'fontfamily' => $font['fontfamily'],
'fontvariants' => ( isset( $font['fontvariants'] ) && ! empty( $font['fontvariants'] ) && is_array( $font['fontvariants'] ) ? $font['fontvariants'] : array() ),
'fontsubsets' => ( isset( $font['fontsubsets'] ) && ! empty( $font['fontsubsets'] ) && is_array( $font['fontsubsets'] ) ? $font['fontsubsets'] : array() ),
);
$font_array[ $key ] = $add_font;
} else {
foreach ( $font['fontvariants'] as $variant ) {
if ( ! in_array( $variant, $font_array[ $key ]['fontvariants'], true ) ) {
array_push( $font_array[ $key ]['fontvariants'], $variant );
}
}
}
}
return $font_array;
}
}

View File

@@ -0,0 +1,130 @@
<?php
/**
* Kadence\Third_Party\Component class
*
* @package kadence
*/
namespace Kadence\Third_Party;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function add_filter;
use function get_template_part;
/**
* Class for integrating with the block Third_Party.
*
* @link https://wordpress.org/gutenberg/handbook/extensibility/theme-support/
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug(): string {
return 'third_party';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
// WeDocs.
remove_action( 'wedocs_before_main_content', 'wedocs_template_wrapper_start' );
remove_action( 'wedocs_after_main_content', 'wedocs_template_wrapper_end' );
add_action( 'wedocs_before_main_content', [ $this, 'output_content_wrapper' ] );
add_action( 'wedocs_after_main_content', [ $this, 'output_content_wrapper_end' ] );
add_action( 'kadence_gallery_post_before', [ $this, 'output_content_wrapper' ] );
add_action( 'kadence_gallery_post_after', [ $this, 'output_content_wrapper_end' ] );
add_action( 'kadence_gallery_post_before_content', [ $this, 'output_content_inner' ] );
add_action( 'kadence_gallery_post_after_content', [ $this, 'output_content_inner_end' ] );
add_filter( 'kadence_gallery_single_show_title', '__return_false' );
add_action( 'kadence_gallery_album_before', [ $this, 'output_content_wrapper' ] );
add_action( 'kadence_gallery_album_after', [ $this, 'output_content_wrapper_end' ] );
add_action( 'kadence_gallery_album_before_content', [ $this, 'output_archive_content_inner' ] );
add_action( 'kadence_gallery_album_after_content', [ $this, 'output_content_inner_end' ] );
}
/**
* Adds theme output Wrapper.
*/
public function output_content_inner() {
if ( kadence()->show_feature_above() ) {
get_template_part( 'template-parts/content/entry_thumbnail', get_post_type() );
}
?>
<div class="entry-content-wrap">
<?php
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/entry_header', get_post_type() );
}
if ( kadence()->show_feature_below() ) {
get_template_part( 'template-parts/content/entry_thumbnail', get_post_type() );
}
}
/**
* Adds theme output Wrapper.
*/
public function output_content_inner_end() {
?>
</div>
<?php
}
/**
* Adds theme output Wrapper.
*/
public function output_archive_content_inner() {
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_archive_content' );
if ( kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/archive_header' );
}
?>
<div id="archive-container" class="content-wrap">
<?php
}
/**
* Adds theme output Wrapper.
*/
public function output_content_wrapper() {
kadence()->print_styles( 'kadence-content' );
/**
* Hook for Hero Section
*/
do_action( 'kadence_hero_header' );
?>
<div id="primary" class="content-area">
<div class="content-container site-container">
<div id="main" class="site-main">
<?php
/**
* Hook for anything before main content
*/
do_action( 'kadence_before_main_content' );
?>
<div class="content-wrap">
<?php
}
/**
* Adds theme end output Wrapper.
*/
public function output_content_wrapper_end() {
/**
* Hook for anything after main content
*/
do_action( 'kadence_after_main_content' );
?>
</div><!-- #main -->
<?php
get_sidebar();
?>
</div>
</div><!-- #primary -->
<?php
}
}

View File

@@ -0,0 +1,476 @@
<?php
/**
* Kadence\TutorLMS\Component class
*
* @package kadence
*/
namespace Kadence\TutorLMS;
use Kadence\Kadence_CSS;
use Kadence\Component_Interface;
use Kadence_Blocks_Frontend;
use function Kadence\kadence;
use function add_action;
use function add_filter;
use function have_posts;
use function the_post;
use function is_search;
use function get_template_part;
use function get_post_type;
/**
* Class for adding TutorLMS plugin support.
*/
class Component implements Component_Interface {
/**
* Associative array of Google Fonts to load.
*
* Do not access this property directly, instead use the `get_google_fonts()` method.
*
* @var array
*/
protected static $google_fonts = array();
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'tutorlms';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'wp_enqueue_scripts', array( $this, 'tutorlms_styles' ), 60 );
add_filter( 'kadence_theme_options_defaults', array( $this, 'add_option_defaults' ) );
add_filter( 'kadence_dynamic_css', array( $this, 'dynamic_css' ), 20 );
add_action( 'wp_head', array( $this, 'frontend_gfonts' ), 80 );
add_filter( 'body_class', array( $this, 'filter_body_classes' ) );
// Courses.
// Outer Wrap.
add_action( 'tutor_course/single/before/wrap', array( $this, 'output_course_content_wrapper' ) );
add_action( 'tutor_course/single/after/wrap', array( $this, 'output_course_content_wrapper_end' ) );
add_action( 'tutor_course/single/enrolled/before/wrap', array( $this, 'output_course_content_wrapper_enrolled' ) );
add_action( 'tutor_course/single/enrolled/after/wrap', array( $this, 'output_course_content_wrapper_end' ) );
// Inner.
add_action( 'tutor_course/single/before/inner-wrap', array( $this, 'output_inner_content_wrapper' ) );
add_action( 'tutor_course/single/after/inner-wrap', array( $this, 'output_inner_content_wrapper_end' ) );
add_action( 'tutor_course/single/enrolled/before/inner-wrap', array( $this, 'output_inner_content_wrapper_enrolled' ) );
add_action( 'tutor_course/single/enrolled/after/inner-wrap', array( $this, 'output_inner_content_wrapper_end' ), 80 );
// Pages.
add_action( 'tutor_dashboard/before/wrap', array( $this, 'output_content_wrapper' ) );
add_action( 'tutor_dashboard/after/wrap', array( $this, 'output_content_wrapper_end' ) );
add_action( 'tutor_student/before/wrap', array( $this, 'output_content_wrapper' ) );
add_action( 'tutor_student/after/wrap', array( $this, 'output_content_wrapper_end' ) );
add_action( 'tutor_course/archive/before/wrap', array( $this, 'output_content_wrapper' ) );
add_action( 'tutor_course/archive/after/wrap', array( $this, 'output_content_wrapper_end' ) );
}
/**
* Outputs the above header tutor lead.
*/
public function header_lead_enrolled() {
get_template_part( 'tutor/single/course/enrolled/above-lead-info' );
}
/**
* Outputs the tutor lead.
*/
public function header_lead() {
if ( defined( 'TUTOR_VERSION' ) && version_compare( TUTOR_VERSION, '2.0.0' ) >= 0 ) {
$is_enrolled = tutor_utils()->is_enrolled();
( isset( $is_enrolled ) && $is_enrolled ) ? tutor_course_enrolled_lead_info() : tutor_course_lead_info();
// remove normal Lead template.
add_filter( 'should_tutor_load_template', array( $this, 'remove_lead_template' ), 10, 3 );
} else {
get_template_part( 'tutor/single/course/lead-info' );
}
}
/**
* Removes the content.
*
* @param bool $load if the template should load.
* @param string $template the name of the template.
* @param array $variables for the template.
*/
public function remove_lead_template( $load, $template, $variables ) {
if ( 'single.course.enrolled.lead-info' === $template || 'single.course.lead-info' === $template ) {
$load = false;
}
return $load;
}
/**
* Adds theme output Inner Wrapper.
*/
public function output_inner_content_wrapper_enrolled() {
echo '<div class="entry content-bg single-entry"><div class="entry-content-wrap">';
if ( 'above' === kadence()->option( 'courses_title_layout' ) ) {
// remove normal Lead template.
add_filter( 'should_tutor_load_template', array( $this, 'remove_lead_template' ), 10, 3 );
// Add content lead template.
if ( defined( 'TUTOR_VERSION' ) && ! ( version_compare( TUTOR_VERSION, '2.0.0' ) >= 0 ) ) {
get_template_part( 'tutor/single/course/enrolled/content-lead-info' );
}
}
}
/**
* Adds theme output Inner Wrapper.
*/
public function output_inner_content_wrapper() {
echo '<div class="entry content-bg single-entry"><div class="entry-content-wrap">';
if ( 'above' === kadence()->option( 'courses_title_layout' ) ) {
// remove normal Lead template.
add_filter( 'should_tutor_load_template', array( $this, 'remove_lead_template' ), 10, 3 );
// Add content lead template.
if ( defined( 'TUTOR_VERSION' ) && ! ( version_compare( TUTOR_VERSION, '2.0.0' ) >= 0 ) ) {
get_template_part( 'tutor/single/course/content-lead-info' );
}
}
}
/**
* Adds theme output Inner Wrapper.
*/
public function output_inner_content_wrapper_end() {
echo '</div></div>';
}
/**
* Adds theme output Wrapper enrolled.
*/
public function output_course_content_wrapper_enrolled() {
kadence()->print_styles( 'kadence-content' );
remove_action( 'kadence_entry_hero', 'Kadence\kadence_entry_header', 10, 2 );
add_action( 'kadence_entry_hero', array( $this, 'header_lead_enrolled' ), 10, 2 );
/**
* Hook for Hero Section
*/
do_action( 'kadence_hero_header' );
echo '<div id="primary" class="content-area"><div class="content-container site-container"><main id="main" class="site-main" role="main">';
}
/**
* Adds theme output Wrapper.
*/
public function output_course_content_wrapper() {
kadence()->print_styles( 'kadence-content' );
remove_action( 'kadence_entry_hero', 'Kadence\kadence_entry_header', 10, 2 );
add_action( 'kadence_entry_hero', array( $this, 'header_lead' ), 10, 2 );
/**
* Hook for Hero Section
*/
do_action( 'kadence_hero_header' );
echo '<div id="primary" class="content-area"><div class="content-container site-container"><main id="main" class="site-main" role="main">';
}
/**
* Adds theme end output Wrapper.
*/
public function output_course_content_wrapper_end() {
echo '</main></div></div>';
}
/**
* Adds theme output Wrapper.
*/
public function output_content_wrapper() {
kadence()->print_styles( 'kadence-content' );
if ( is_archive() ) {
/**
* Hook for Hero Section
*/
do_action( 'kadence_hero_header' );
}
echo '<div id="primary" class="content-area"><div class="content-container site-container"><main id="main" class="site-main" role="main">';
if ( is_archive() && kadence()->show_in_content_title() ) {
get_template_part( 'template-parts/content/archive_header' );
}
}
/**
* Adds theme end output Wrapper.
*/
public function output_content_wrapper_end() {
echo '</main>';
if ( is_archive() ) {
get_sidebar();
}
echo '</div></div>';
}
/**
* Add some css styles for tutorlms
*/
public function tutorlms_styles() {
wp_enqueue_style( 'kadence-tutorlms', get_theme_file_uri( '/assets/css/tutorlms.min.css' ), array(), KADENCE_VERSION );
}
/**
* Add Defaults
*
* @access public
* @param array $defaults registered option defaults with kadence theme.
* @return array
*/
public function add_option_defaults( $defaults ) {
// Tutor.
$tutor_addons = array(
'courses_title_layout' => 'normal',
'courses_title_inner_layout' => 'standard',
'courses_title_align' => 'left',
'courses_enroll_overlay' => true,
'courses_title_height' => array(
'size' => array(
'mobile' => '',
'tablet' => '',
'desktop' => 375,
),
'unit' => array(
'mobile' => 'px',
'tablet' => 'px',
'desktop' => 'px',
),
),
'courses_title_font' => array(
'size' => array(
'desktop' => '',
),
'lineHeight' => array(
'desktop' => '',
),
'family' => 'inherit',
'google' => false,
'weight' => '',
'variant' => '',
'color' => '',
),
'courses_layout' => 'right',
'courses_content_style' => 'boxed',
'courses_vertical_padding' => 'show',
'courses_archive_title' => true,
'courses_archive_title_layout' => 'above',
'courses_archive_layout' => 'normal',
'courses_archive_sidebar_id' => 'sidebar-primary',
'courses_archive_content_style' => 'unboxed',
'courses_archive_vertical_padding' => 'show',
'courses_archive_title_inner_layout' => 'standard',
'courses_archive_title_elements' => array( 'breadcrumb', 'title' ),
'courses_archive_title_element_title' => array(
'enabled' => true,
),
'courses_archive_title_element_breadcrumb' => array(
'enabled' => false,
'show_title' => true,
),
// 'courses_title_elements' => array( 'breadcrumb', 'reviews', 'title', 'meta' ),
// 'courses_title_element_title' => array(
// 'enabled' => true,
// ),
// 'courses_title_element_breadcrumb' => array(
// 'enabled' => false,
// ),
// 'courses_title_element_reviews' => array(
// 'enabled' => true,
// ),
// 'courses_title_element_meta' => array(
// 'id' => 'meta',
// 'enabled' => false,
// 'author' => true,
// 'authorImage' => true,
// 'authorEnableLabel' => true,
// 'authorLabel' => '',
// 'courseLevel' => true,
// 'courseShare' => false,
// ),
// 'header_html2_typography' => array(
// 'size' => array(
// 'desktop' => '',
// ),
// 'lineHeight' => array(
// 'desktop' => '',
// ),
// 'family' => 'inherit',
// 'google' => false,
// 'weight' => '',
// 'variant' => '',
// 'color' => '',
// ),
);
$defaults = array_merge(
$defaults,
$tutor_addons
);
return $defaults;
}
/**
* Enqueue Frontend Fonts
*/
public function frontend_gfonts() {
if ( empty( self::$google_fonts ) ) {
return;
}
if ( class_exists( 'Kadence_Blocks_Frontend' ) ) {
$ktblocks_instance = Kadence_Blocks_Frontend::get_instance();
foreach ( self::$google_fonts as $key => $font ) {
if ( ! array_key_exists( $key, $ktblocks_instance::$gfonts ) ) {
$add_font = array(
'fontfamily' => $font['fontfamily'],
'fontvariants' => ( isset( $font['fontvariants'] ) && ! empty( $font['fontvariants'] ) && is_array( $font['fontvariants'] ) ? $font['fontvariants'] : array() ),
'fontsubsets' => ( isset( $font['fontsubsets'] ) && ! empty( $font['fontsubsets'] ) && is_array( $font['fontsubsets'] ) ? $font['fontsubsets'] : array() ),
);
$ktblocks_instance::$gfonts[ $key ] = $add_font;
} else {
foreach ( $font['fontvariants'] as $variant ) {
if ( ! in_array( $variant, $ktblocks_instance::$gfonts[ $key ]['fontvariants'], true ) ) {
array_push( $ktblocks_instance::$gfonts[ $key ]['fontvariants'], $variant );
}
}
}
}
} else {
add_filter( 'kadence_theme_google_fonts_array', array( $this, 'filter_in_fonts' ) );
}
}
/**
* Filters in pro fronts for output with free.
*
* @param array $font_array any custom css.
* @return array
*/
public function filter_in_fonts( $font_array ) {
// Enqueue Google Fonts.
foreach ( self::$google_fonts as $key => $font ) {
if ( ! array_key_exists( $key, $font_array ) ) {
$add_font = array(
'fontfamily' => $font['fontfamily'],
'fontvariants' => ( isset( $font['fontvariants'] ) && ! empty( $font['fontvariants'] ) && is_array( $font['fontvariants'] ) ? $font['fontvariants'] : array() ),
'fontsubsets' => ( isset( $font['fontsubsets'] ) && ! empty( $font['fontsubsets'] ) && is_array( $font['fontsubsets'] ) ? $font['fontsubsets'] : array() ),
);
$font_array[ $key ] = $add_font;
} else {
foreach ( $font['fontvariants'] as $variant ) {
if ( ! in_array( $variant, $font_array[ $key ]['fontvariants'], true ) ) {
array_push( $font_array[ $key ]['fontvariants'], $variant );
}
}
}
}
return $font_array;
}
/**
* Generates the dynamic css based on customizer options.
*
* @param string $css any custom css.
* @return string
*/
public function dynamic_css( $css ) {
$generated_css = $this->generate_tutor_css();
if ( ! empty( $generated_css ) ) {
$css .= "\n/* Kadence Tutor CSS */\n" . $generated_css;
}
return $css;
}
/**
* Generates the dynamic css based on page options.
*
* @return string
*/
public function generate_tutor_css() {
$css = new Kadence_CSS();
$media_query = array();
$media_query['mobile'] = apply_filters( 'kadence_mobile_media_query', '(max-width: 767px)' );
$media_query['tablet'] = apply_filters( 'kadence_tablet_media_query', '(max-width: 1024px)' );
$media_query['desktop'] = apply_filters( 'kadence_desktop_media_query', '(min-width: 1025px)' );
// Above Course Title.
$css->set_selector( '.courses-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'courses_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'courses_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'courses_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.courses-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'courses_title_height' ), 'desktop' ) );
$css->set_selector( '.courses-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color( kadence()->sub_option( 'courses_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.courses-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'courses_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'courses_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'courses_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.courses-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'courses_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.courses-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'courses_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'courses_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'courses_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.courses-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'courses_title_height' ), 'mobile' ) );
$css->stop_media_query();
// Course Title.
$css->set_selector( '.tutor-single-course-lead-info h1.tutor-course-header-h1, .tutor-course-details-title.tutor-fs-4' );
$css->render_font( kadence()->option( 'courses_title_font' ), $css, 'heading' );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.tutor-single-course-lead-info h1.tutor-course-header-h1, .tutor-course-details-title.tutor-fs-4' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'courses_title_font' ), 'tablet' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'courses_title_font' ), 'tablet' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'courses_title_font' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.tutor-single-course-lead-info h1.tutor-course-header-h1, .tutor-course-details-title.tutor-fs-4' );
$css->add_property( 'font-size', $css->render_font_size( kadence()->option( 'courses_title_font' ), 'mobile' ) );
$css->add_property( 'line-height', $css->render_font_height( kadence()->option( 'courses_title_font' ), 'mobile' ) );
$css->add_property( 'letter-spacing', $css->render_font_spacing( kadence()->option( 'courses_title_font' ), 'mobile' ) );
$css->stop_media_query();
// Courses Backgrounds.
$css->set_selector( 'body.post-type-archive-courses .site, body.post-type-archive-courses.content-style-unboxed .site' );
$css->render_background( kadence()->sub_option( 'courses_archive_content_background', 'desktop' ), $css );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( 'body.post-type-archive-courses .site, body.post-type-archive-courses.content-style-unboxed .site' );
$css->render_background( kadence()->sub_option( 'courses_archive_content_background', 'tablet' ), $css );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( 'body.post-type-archive-courses .site, body.post-type-archive-courses.content-style-unboxed .site' );
$css->render_background( kadence()->sub_option( 'courses_archive_content_background', 'mobile' ), $css );
$css->stop_media_query();
// Events Hero Title Area.
$css->set_selector( '.courses-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'courses_archive_title_background', 'desktop' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'courses_archive_title_top_border', 'desktop' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'courses_archive_title_bottom_border', 'desktop' ) ) );
$css->set_selector( '.entry-hero.courses-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'courses_archive_title_height' ), 'desktop' ) );
$css->set_selector( '.courses-archive-hero-section .hero-section-overlay' );
$css->add_property( 'background', $css->render_color_or_gradient( kadence()->sub_option( 'courses_archive_title_overlay_color', 'color' ) ) );
$css->start_media_query( $media_query['tablet'] );
$css->set_selector( '.courses-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'courses_archive_title_background', 'tablet' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'courses_archive_title_top_border', 'tablet' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'courses_archive_title_bottom_border', 'tablet' ) ) );
$css->set_selector( '.entry-hero.courses-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'courses_archive_title_height' ), 'tablet' ) );
$css->stop_media_query();
$css->start_media_query( $media_query['mobile'] );
$css->set_selector( '.courses-archive-hero-section .entry-hero-container-inner' );
$css->render_background( kadence()->sub_option( 'courses_archive_title_background', 'mobile' ), $css );
$css->add_property( 'border-top', $css->render_border( kadence()->sub_option( 'courses_archive_title_top_border', 'mobile' ) ) );
$css->add_property( 'border-bottom', $css->render_border( kadence()->sub_option( 'courses_archive_title_bottom_border', 'mobile' ) ) );
$css->set_selector( '.entry-hero.courses-archive-hero-section .entry-header' );
$css->add_property( 'min-height', $css->render_range( kadence()->option( 'courses_archive_title_height' ), 'mobile' ) );
$css->stop_media_query();
$css->set_selector( '.wp-site-blocks .courses-archive-title h1' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'courses_archive_title_color', 'color' ) ) );
$css->set_selector( '.courses-archive-title .kadence-breadcrumbs' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'courses_archive_title_breadcrumb_color', 'color' ) ) );
$css->set_selector( '.courses-archive-title .kadence-breadcrumbs a:hover' );
$css->add_property( 'color', $css->render_color( kadence()->sub_option( 'courses_archive_title_breadcrumb_color', 'hover' ) ) );
self::$google_fonts = $css->fonts_output();
return $css->css_output();
}
/**
* Adds custom classes to indicate whether a sidebar is present to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array Filtered body classes.
*/
public function filter_body_classes( array $classes ) : array {
if ( is_singular( 'courses' ) ) {
$classes[] = 'courses-sidebar-overlay-' . ( kadence()->option( 'courses_enroll_overlay' ) ? 'true' : 'false' );
}
return $classes;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
<?php
/**
* Kadence\Zoom_Recipe_Card\Component class
*
* @package kadence
*/
namespace Kadence\Zoom_Recipe_Card;
use Kadence\Component_Interface;
use function Kadence\kadence;
use function add_action;
use function have_posts;
use function the_post;
use function is_search;
use function get_template_part;
use function get_post_type;
/**
* Class for adding Woocommerce plugin support.
*/
class Component implements Component_Interface {
/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'zoom_recipe_card';
}
/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {
add_action( 'wp_enqueue_scripts', array( $this, 'zoom_recipe_card_styles' ), 60 );
add_action( 'after_setup_theme', array( $this, 'action_add_editor_styles' ) );
}
/**
* Enqueues WordPress theme styles for the editor.
*/
public function action_add_editor_styles() {
// Enqueue block editor stylesheet.
add_editor_style( 'assets/css/editor/zoom-recipe-editor-styles.min.css' );
}
/**
* Add some css styles for zoom_recipe_card
*/
public function zoom_recipe_card_styles() {
wp_enqueue_style( 'kadence-zoom-recipe-card', get_theme_file_uri( '/assets/css/zoom-recipe-card.min.css' ), array(), KADENCE_VERSION );
}
}

View File

@@ -0,0 +1,132 @@
<?php
/**
* Class for the Customizer
*
* @package Kadence
*/
namespace Kadence;
use WP_Customize_Control;
use function sanitize_text_field;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class for Customizer Sanitize
*
* @category class
*/
class Customizer_Sanitize {
/**
* Sanitize string, remove spaces and special characters.
*
* @param string $value the string to be sanitized.
*
* @return string
*/
public static function kadence_sanitize_key_string( $value ) {
// To allow for strings with capitals, dashes, underscores, remove other special characters and spaces.
return preg_replace( '/[^A-Za-z0-9_\-]/', '', $value );
}
/**
* Sanitize customizer setting. If a string use sanitize_key, for an array, loop through each item.
* For the key use sanitize_key and the value strip out most special characters.
*
* @param mixed $start_value the value before sanitized.
*
* @return mixed
*/
public static function kadence_sanitize_option( $start_value ) {
if ( empty( $start_value ) ) {
return '';
}
if ( ! is_array( $start_value ) ) {
return self::kadence_sanitize_key_string( $start_value );
}
$new_value = array();
foreach ( $start_value as $key => $value ) {
// Sanitize key, remove spaces and special characters.
$key = self::kadence_sanitize_key_string( $key );
if ( is_array( $value ) ) {
$new_value[ $key ] = self::kadence_sanitize_option( $value );
} else {
switch ( $key ) {
case 'family':
case 'label':
// Font family names can have special characters and can be custom so treat like an text field, label is a text field.
$new_value[ $key ] = sanitize_text_field( $value );
break;
case 'color':
case 'hover':
case 'active':
case 'link':
case 'background':
case 'backgroundHover':
case 'border':
case 'borderHover':
// To allow hex, rgba(), and var() values or custom values like transparent run through custom preg_replace to remove most special characters and spaces.
if ( strpos( $value, '#' ) === 0 ) {
$new_value[ $key ] = sanitize_hex_color( $value );
} else {
$new_value[ $key ] = preg_replace( '/[^A-Za-z0-9_)(\-,.]/', '', $value );
}
break;
case 'gradient':
// gradient has some extra symbols that need to be allowed.
$new_value[ $key ] = sanitize_text_field( $value );
break;
case 'enabled':
case 'locked':
// return a boolean.
$new_value[ $key ] = ( ( isset( $value ) && true == $value ) ? true : false );
break;
case 'url':
// URL is used for custom social images and background images so save as a url.
$new_value[ $key ] = esc_url_raw( $value );
break;
default:
// To allow for strings with capitals, negative numbers and decimals. Remove other special characters and spaces.
$new_value[ $key ] = preg_replace( '/[^A-Za-z0-9_\-.]/', '', $value );
break;
}
}
}
return $new_value;
}
/**
* Sanitize customizer toggle setting.
*
* @param mixed $value the value before sanitized.
*
* @return bool
*/
public static function kadence_sanitize_toggle( $value ) {
return ( ( isset( $value ) && true == $value ) ? true : false );
}
/**
* Sanitize customizer google subset setting.
*
* @param mixed $start_value the value before sanitized.
*
* @return mixed
*/
public static function kadence_sanitize_google_subsets( $start_value ) {
if ( empty( $start_value ) ) {
return '';
}
if ( ! is_array( $start_value ) ) {
return '';
}
$new_value = array();
foreach ( $start_value as $key => $value ) {
// Sanitize key, remove spaces and special characters.
$key = self::kadence_sanitize_key_string( $key );
$new_value[ $key ] = ( ( isset( $value ) && true == $value ) ? true : false );
}
return $new_value;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,100 @@
.primary-menu-container .customize-partial-edit-shortcut {
display: none;
}
.secondary-menu-container .customize-partial-edit-shortcut {
display: none;
}
.footer-menu-container .customize-partial-edit-shortcut {
display: none;
}
span.customize-partial-edit-shortcut.customize-partial-edit-shortcut-header_desktop_items {
display: none;
}
.site-branding .site-title .customize-partial-edit-shortcut, .site-branding .site-description .customize-partial-edit-shortcut {
display: none !important;
}
.menu-toggle-open .customize-partial-edit-shortcut {
display: none;
}
.mobile-menu-container .customize-partial-edit-shortcut {
display: none;
}
.site-header-focus-item {
outline: 2px solid transparent;
position: relative;
transition: all 0.3s;
box-shadow: 0 2px 1px rgba(46, 68, 83, 0);
}
.site-header-focus-item .customize-partial-edit-shortcut {
opacity: 0;
left: 0;
transition: all 0.3s;
}
.site-header-focus-item .customize-partial-edit-shortcut button {
border-radius: 0;
border: 0;
box-shadow: none;
}
.site-header-focus-item:hover {
outline: 2px solid #0085ba !important;
box-shadow: 0 2px 1px rgba(46, 68, 83, 0.15);
}
.site-header-focus-item:hover > * > .customize-partial-edit-shortcut {
opacity: 1;
}
.site-footer-focus-item {
outline: 2px solid transparent;
position: relative;
transition: all 0.3s;
box-shadow: 0 2px 1px rgba(46, 68, 83, 0);
}
.site-footer-focus-item .customize-partial-edit-shortcut {
opacity: 0;
left: 0;
transition: all 0.3s;
}
.site-footer-focus-item .customize-partial-edit-shortcut button {
border-radius: 0;
border: 0;
box-shadow: none;
}
.site-footer-focus-item:hover {
outline: 2px solid #0085ba !important;
box-shadow: 0 2px 1px rgba(46, 68, 83, 0.15);
}
.site-footer-focus-item:hover > * > .customize-partial-edit-shortcut {
opacity: 1;
}
.site-footer-focus-item:hover > * > *:first-child > .customize-partial-edit-shortcut {
opacity: 1;
}
.site-header-row-container-inner > .customize-partial-edit-shortcut button {
left: 0;
}
.site-footer-row-container-inner > .customize-partial-edit-shortcut button {
left: 0;
}
.site-header-row-layout-contained .site-header-row-container-inner > .customize-partial-edit-shortcut button {
left: calc(-30px - 1.5rem);
}
.site-footer-row-layout-contained .site-footer-row-container-inner > .customize-partial-edit-shortcut button {
left: calc(-30px - 1.5rem);
}
#kt-scroll-up .customize-partial-edit-shortcut {
display: none;
}

View File

@@ -0,0 +1,87 @@
.primary-menu-container .customize-partial-edit-shortcut {
display:none;
}
.secondary-menu-container .customize-partial-edit-shortcut {
display:none;
}
.footer-menu-container .customize-partial-edit-shortcut {
display:none;
}
span.customize-partial-edit-shortcut.customize-partial-edit-shortcut-header_desktop_items {
display: none;
}
.site-branding .site-title, .site-branding .site-description {
.customize-partial-edit-shortcut {
display: none !important;
}
}
.menu-toggle-open .customize-partial-edit-shortcut {
display: none;
}
.mobile-menu-container .customize-partial-edit-shortcut {
display:none;
}
.site-header-focus-item {
outline: 2px solid transparent;
position: relative;
transition: all 0.3s;
box-shadow: 0 2px 1px rgba(46,68,83,0);
.customize-partial-edit-shortcut{
opacity: 0;
left:0;
transition: all 0.3s;
button {
border-radius: 0;
border: 0;
box-shadow: none;
}
}
}
.site-header-focus-item:hover {
outline: 2px solid #0085ba!important;
box-shadow: 0 2px 1px rgba(46,68,83,.15);
> * > .customize-partial-edit-shortcut{
opacity: 1;
}
}
.site-footer-focus-item {
outline: 2px solid transparent;
position: relative;
transition: all 0.3s;
box-shadow: 0 2px 1px rgba(46,68,83,0);
.customize-partial-edit-shortcut{
opacity: 0;
left:0;
transition: all 0.3s;
button {
border-radius: 0;
border: 0;
box-shadow: none;
}
}
}
.site-footer-focus-item:hover {
outline: 2px solid #0085ba!important;
box-shadow: 0 2px 1px rgba(46,68,83,.15);
> * > .customize-partial-edit-shortcut{
opacity: 1;
}
> * > *:first-child > .customize-partial-edit-shortcut{
opacity: 1;
}
}
.site-header-row-container-inner > .customize-partial-edit-shortcut button {
left: 0;
}
.site-footer-row-container-inner > .customize-partial-edit-shortcut button {
left: 0;
}
.site-header-row-layout-contained .site-header-row-container-inner > .customize-partial-edit-shortcut button {
left: calc(-30px + -1.5rem);
}
.site-footer-row-layout-contained .site-footer-row-container-inner > .customize-partial-edit-shortcut button {
left: calc(-30px + -1.5rem);
}
#kt-scroll-up .customize-partial-edit-shortcut {
display: none;
}

View File

@@ -0,0 +1,102 @@
.customize-control:not(.customize-control-kadence_blank_control):not(.customize-control-kadence_tab_control) + .customize-control {
border-top: 1px solid #ddd;
padding-top: 10px;
}
.kadence-builder-hide .customize-control-kadence_blank_control .kadence-builder-show-button.kadence-builder-tab-toggle {
visibility: visible;
opacity: 1;
}
.kadence-builder-is-active .preview-desktop #customize-preview, .kadence-builder-is-active .preview-tablet #customize-preview {
height: auto;
}
.customize-control-kadence_blank_control .customize-control-description {
position: relative;
}
.customize-control-kadence_blank_control .kadence-builder-tab-toggle {
position: absolute;
right: 10px;
top: 5px;
z-index: 1000;
display: flex;
align-items: center;
}
.customize-control-kadence_blank_control .kadence-builder-tab-toggle span.dashicons {
font-size: 12px;
vertical-align: middle;
line-height: 20px;
}
.customize-control-kadence_blank_control .kadence-builder-show-button.kadence-builder-tab-toggle {
visibility: hidden;
margin-bottom: 20px;
opacity: 0;
bottom: 100%;
top: auto;
}
#customize-theme-controls #sub-accordion-section-kadence_customizer_header_builder .customize-control {
margin: 0;
padding: 0;
}
#customize-theme-controls #sub-accordion-section-kadence_customizer_header_builder .customize-control .description {
padding: 0 20px;
}
.kadence-compontent-tabs {
display: flex;
width: auto;
margin-top: -15px;
margin-left: -24px;
margin-right: -24px;
padding: 0;
margin-bottom: 0;
border-bottom: 1px solid #ccc;
}
.kadence-compontent-tabs .kadence-compontent-tabs-button {
flex: 1 1 0;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
font-size: 11px;
font-weight: 600;
font-style: normal;
text-transform: uppercase;
height: 40px;
margin: 0;
margin-bottom: -1px;
box-sizing: content-box;
padding: 0 10px;
cursor: pointer;
border: 0;
background: transparent;
border-bottom: 4px solid transparent;
border-radius: 0;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.kadence-compontent-tabs .kadence-compontent-tabs-button:not(:first-child) {
margin-left: 0px;
}
.kadence-compontent-tabs .kadence-compontent-tabs-button:hover {
box-shadow: none !important;
}
.kadence-compontent-tabs .kadence-compontent-tabs-button:not(.nav-tab-active):hover {
background: #e5e5e5 !important;
color: #444 !important;
border-bottom-color: #f9f9f9;
}
.kadence-compontent-tabs .kadence-compontent-tabs-button.nav-tab-active {
border-bottom-color: #007cba;
background: #f9f9f9;
color: #000;
}
.kadence-compontent-tabs .kadence-compontent-tabs-button.nav-tab-active:focus {
outline: 0;
box-shadow: none;
}

View File

@@ -0,0 +1,101 @@
.customize-control:not(.customize-control-kadence_blank_control):not(.customize-control-kadence_tab_control) + .customize-control {
border-top: 1px solid #ddd;
padding-top: 10px;
}
.kadence-builder-hide .customize-control-kadence_blank_control .kadence-builder-show-button.kadence-builder-tab-toggle {
visibility: visible;
opacity: 1;
}
.kadence-builder-is-active .preview-desktop #customize-preview, .kadence-builder-is-active .preview-tablet #customize-preview {
height: auto;
}
// Top Tabs
.customize-control-kadence_blank_control {
.customize-control-description {
position:relative;
}
.kadence-builder-tab-toggle {
position: absolute;
right: 10px;
top: 5px;
z-index: 1000;
display: flex;
align-items: center;
span.dashicons {
font-size: 12px;
vertical-align: middle;
line-height: 20px;
}
}
.kadence-builder-show-button.kadence-builder-tab-toggle {
visibility: hidden;
margin-bottom: 20px;
opacity: 0;
bottom: 100%;
top: auto;
}
}
#customize-theme-controls #sub-accordion-section-kadence_customizer_header_builder .customize-control {
margin: 0;
padding: 0;
.description {
padding: 0 20px;
}
}
.kadence-compontent-tabs {
display: flex;
width:auto;
margin-top: -15px;
margin-left: -24px;
margin-right: -24px;
padding: 0;
margin-bottom: 0;
border-bottom: 1px solid #ccc;
.kadence-compontent-tabs-button {
flex: 1 1 0;;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
font-size: 11px;
font-weight: 600;
font-style: normal;
text-transform: uppercase;
height: 40px;
margin: 0;
margin-bottom: -1px;
box-sizing: content-box;
padding: 0 10px;
cursor: pointer;
border: 0;
background: transparent;
border-bottom: 4px solid transparent;
border-radius: 0;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
&:not(:first-child) {
margin-left: 0px;
}
&:hover {
box-shadow: none !important;
}
&:not(.nav-tab-active):hover {
background: #e5e5e5 !important;
color: #444 !important;
border-bottom-color: #f9f9f9;
}
&.nav-tab-active {
border-bottom-color: #007cba;
background: #f9f9f9;
color:#000;
&:focus {
outline: 0;
box-shadow: none;
}
}
}
}

View File

@@ -0,0 +1,41 @@
@media (min-width: 1660px) {
.rtl #customize-theme-controls #sub-accordion-section-kadence_customizer_header_builder, .rtl #customize-theme-controls #sub-accordion-section-kadence_customizer_footer_builder {
right: 18%;
left: 0;
}
}
.rtl .customize-control-kadence_blank_control .kadence-builder-tab-toggle {
left: 10px;
right: auto;
}
.rtl .kadence-builder-item > .kadence-builder-item-icon {
margin-right: 0;
margin-left: -10px;
}
.rtl .kadence-builder-item > .kadence-builder-item-icon.kadence-move-icon {
margin-right: -10px;
margin-left: 0;
}
.rtl .kadence-builder-item > .kadence-builder-item-icon svg.dashicons-arrow-right-alt2 {
transform: rotate(180deg);
}
.rtl .kadence-builder-areas.popup-vertical-group {
padding-left: 20px;
padding-right: 0;
}
.rtl #customize-theme-controls .add-new-menu-item, #customize-theme-controls .add-new-widget {
float: right;
}
.rtl .footer-column-row .kadence-builder-area:last-child {
border-right: 1px dashed #A0AEC0;
}
.rtl .footer-column-row .kadence-builder-area:first-child {
border-right: 0;
}

View File

@@ -0,0 +1,35 @@
// Builder.
@media (min-width: 1660px) {
.rtl #customize-theme-controls #sub-accordion-section-kadence_customizer_header_builder, .rtl #customize-theme-controls #sub-accordion-section-kadence_customizer_footer_builder {
right: 18%;
left: 0;
}
}
.rtl .customize-control-kadence_blank_control .kadence-builder-tab-toggle {
left:10px;
right:auto;
}
.rtl .kadence-builder-item>.kadence-builder-item-icon {
margin-right: 0;
margin-left: -10px;
}
.rtl .kadence-builder-item>.kadence-builder-item-icon.kadence-move-icon {
margin-right: -10px;
margin-left: 0;
}
.rtl .kadence-builder-item>.kadence-builder-item-icon svg.dashicons-arrow-right-alt2 {
transform: rotate(180deg);
}
.rtl .kadence-builder-areas.popup-vertical-group {
padding-left: 20px;
padding-right: 0;
}
.rtl #customize-theme-controls .add-new-menu-item, #customize-theme-controls .add-new-widget {
float: right;
}
.rtl .footer-column-row .kadence-builder-area:last-child {
border-right: 1px dashed #A0AEC0;
}
.rtl .footer-column-row .kadence-builder-area:first-child {
border-right: 0;
}

View File

@@ -0,0 +1,43 @@
<?php
/**
* The blank customize control extends the WP_Customize_Control class.
*
* @package customizer-controls
*/
if ( ! class_exists( 'WP_Customize_Control' ) ) {
return;
}
/**
* Class Kadence_Control_Blank
*
* @access public
*/
class Kadence_Control_Blank extends WP_Customize_Control {
/**
* Control type
*
* @var string
*/
public $type = 'kadence_blank_control';
/**
* Render the control in the customizer
*/
public function render_content() {
if ( ! empty( $this->label ) ) :
?>
<span class="customize-control-title"><?php echo $this->label; // phpcs:ignore ?></span>
<?php
endif;
if ( ! empty( $this->description ) ) :
?>
<span class="customize-control-description"><?php echo $this->description; // phpcs:ignore ?></span>
<?php
endif;
?>
<?php
}
}

View File

@@ -0,0 +1,63 @@
<?php
/**
* The Radio Icon customize control extends the WP_Customize_Control class.
*
* @package customizer-controls
*/
if ( ! class_exists( 'WP_Customize_Control' ) ) {
return;
}
/**
* Class Kadence_Control_Import_Export
*
* @access public
*/
class Kadence_Control_Import_Export extends WP_Customize_Control {
/**
* Control type
*
* @var string
*/
public $type = 'kadence_import_export_control';
/**
* Empty Render Function to prevent errors.
*/
public function render_content() {
?>
<span class="customize-control-title">
<?php esc_html_e( 'Export', 'kadence' ); ?>
</span>
<span class="description customize-control-description">
<?php esc_html_e( 'Click the button below to export the customization settings for this theme.', 'kadence' ); ?>
</span>
<input type="button" class="button kadence-theme-export kadence-theme-button" name="kadence-theme-export-button" value="<?php esc_attr_e( 'Export', 'kadence' ); ?>" />
<hr class="kt-theme-hr" />
<span class="customize-control-title">
<?php esc_html_e( 'Import', 'kadence' ); ?>
</span>
<span class="description customize-control-description">
<?php esc_html_e( 'Upload a file to import customization settings for this theme.', 'kadence' ); ?>
</span>
<div class="kadence-theme-import-controls">
<input type="file" name="kadence-theme-import-file" class="kadence-theme-import-file" />
<?php wp_nonce_field( 'kadence-theme-importing', 'kadence-theme-import' ); ?>
</div>
<div class="kadence-theme-uploading"><?php esc_html_e( 'Uploading...', 'kadence' ); ?></div>
<input type="button" class="button kadence-theme-import kadence-theme-button" name="kadence-theme-import-button" value="<?php esc_attr_e( 'Import', 'kadence' ); ?>" />
<hr class="kt-theme-hr" />
<span class="customize-control-title">
<?php esc_html_e( 'Reset', 'kadence' ); ?>
</span>
<span class="description customize-control-description">
<?php esc_html_e( 'Click the button to reset all theme settings.', 'kadence' ); ?>
</span>
<input type="button" class="components-button is-destructive kadence-theme-reset kadence-theme-button" name="kadence-theme-reset-button" value="<?php esc_attr_e( 'Reset', 'kadence' ); ?>" />
<?php
}
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* The pro customize section extends the WP_Customize_Control class.
*
* @package kadence
*/
if ( ! class_exists( 'WP_Customize_Section' ) ) {
return;
}
/**
* Class Kadence_Section_Pro
*
* @access public
*/
class Kadence_Section_Pro extends WP_Customize_Section {
/**
* Control type
*
* @var string
*/
public $type = 'kadence_section_pro';
/**
* Link for pro version.
*
* @since 1.0.10
* @access public
* @var string
*/
public $pro_link = '';
/**
* Gather the parameters passed to client JavaScript via JSON.
*
* @since 4.1.0
*
* @return array The array to be exported to the client as JSON.
*/
public function json() {
$json = parent::json();
$json['pro_link'] = esc_url_raw( $this->pro_link );
return $json;
}
/**
* An Underscore (JS) template for rendering this section.
*
* Class variables for this section class are available in the `data` JS object;
* export custom variables by overriding WP_Customize_Section::json().
*
* @since 4.3.0
*
* @see WP_Customize_Section::print_template()
*/
protected function render_template() {
?>
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section cannon-expand control-section-{{ data.type }}">
<h3 class="wp-ui-highlight">
<a href="{{ data.pro_link }}" class="wp-ui-text-highlight" target="_blank" rel="noopener">{{ data.title }}</a>
</h3>
</li>
<?php
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,39 @@
/**
* manually run this file to generate array for google fonts inc/customizer/google-font-variants.php file)
* run the script on a page with a div with class .google-fonts class.
* you'll also need to put in a google webfonts api key.
*/
$.getJSON('https://www.googleapis.com/webfonts/v1/webfonts?key={{API_KEY}}', function(data) {
$.each( data.items, function( index, font ) {
var category = [];
category.push( font.category );
var variants = font.variants;
var weights = font.variants.slice();
var styles = ['normal'];
for( var i = 0; i < weights.length; i++){
if ( weights[i].includes('italic') ) {
weights.splice(i, 1);
}
};
if ( variants.includes('italic') ) {
styles.push('italic');
}
$('.google-fonts').append("'" + font.family + "' => array( 'v' => array(");
for(var i = 0; i < variants.length; i++) {
if( 0 === i ) {
$('.google-fonts').append("'" + variants[i] + "'");
} else {
$('.google-fonts').append(",'" + variants[i] + "'");
}
}
$('.google-fonts').append(")" + ",'c' => array(");
for(var i = 0; i < category.length; i++) {
if( 0 === i ) {
$('.google-fonts').append("'" + category[i] + "'");
} else {
$('.google-fonts').append(",'" + category[i] + "'");
}
}
$('.google-fonts').append(")" + "),");
});
});

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,212 @@
<?php
/**
* 404 Layout options.
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
$layout_404_settings = array(
'404_tabs' => array(
'control_type' => 'kadence_tab_control',
'section' => 'general_404',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'general_404',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'general_404_design',
),
'active' => 'general',
),
),
'404_tabs_design' => array(
'control_type' => 'kadence_tab_control',
'section' => 'general_404_design',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'general_404',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'general_404_design',
),
'active' => 'design',
),
),
'info_404_layout' => array(
'control_type' => 'kadence_title_control',
'section' => 'general_404',
'priority' => 10,
'label' => esc_html__( '404 Layout', 'kadence' ),
'settings' => false,
),
'info_404_layout_design' => array(
'control_type' => 'kadence_title_control',
'section' => 'general_404_design',
'priority' => 10,
'label' => esc_html__( '404 Layout', 'kadence' ),
'settings' => false,
),
'404_layout' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'general_404',
'label' => esc_html__( '404 Layout', 'kadence' ),
'transport' => 'refresh',
'priority' => 10,
'default' => kadence()->default( '404_layout' ),
'input_attrs' => array(
'layout' => array(
'normal' => array(
'name' => __( 'Normal', 'kadence' ),
'icon' => 'normal',
),
'narrow' => array(
'name' => __( 'Narrow', 'kadence' ),
'icon' => 'narrow',
),
'fullwidth' => array(
'name' => __( 'Fullwidth', 'kadence' ),
'icon' => 'fullwidth',
),
'left' => array(
'name' => __( 'Left Sidebar', 'kadence' ),
'icon' => 'leftsidebar',
),
'right' => array(
'name' => __( 'Right Sidebar', 'kadence' ),
'icon' => 'rightsidebar',
),
),
'class' => 'kadence-three-col',
'responsive' => false,
),
),
'404_sidebar_id' => array(
'control_type' => 'kadence_select_control',
'section' => 'general_404',
'label' => esc_html__( '404 Default Sidebar', 'kadence' ),
'transport' => 'refresh',
'priority' => 10,
'default' => kadence()->default( '404_sidebar_id' ),
'input_attrs' => array(
'options' => kadence()->sidebar_options(),
),
),
'404_content_style' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'general_404',
'label' => esc_html__( 'Content Style', 'kadence' ),
'priority' => 10,
'default' => kadence()->default( '404_content_style' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => 'body.error404',
'pattern' => 'content-style-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'boxed' => array(
'name' => __( 'Boxed', 'kadence' ),
'icon' => 'boxed',
),
'unboxed' => array(
'name' => __( 'Unboxed', 'kadence' ),
'icon' => 'narrow',
),
),
'responsive' => false,
'class' => 'kadence-two-col',
),
),
'404_vertical_padding' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'general_404',
'label' => esc_html__( 'Content Vertical Padding', 'kadence' ),
'priority' => 10,
'default' => kadence()->default( '404_vertical_padding' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => 'body.error404',
'pattern' => 'content-vertical-padding-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'show' => array(
'name' => __( 'Enable', 'kadence' ),
),
'hide' => array(
'name' => __( 'Disable', 'kadence' ),
),
'top' => array(
'name' => __( 'Top Only', 'kadence' ),
),
'bottom' => array(
'name' => __( 'Bottom Only', 'kadence' ),
),
),
'responsive' => false,
'class' => 'kadence-two-grid',
),
),
'404_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'general_404_design',
'label' => esc_html__( 'Site Background', 'kadence' ),
'default' => kadence()->default( '404_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => 'body.error404',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( '404 Background', 'kadence' ),
),
),
'404_content_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'general_404_design',
'label' => esc_html__( 'Content Background', 'kadence' ),
'default' => kadence()->default( '404_content_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => 'body.error404 .content-bg, body.error404.content-style-unboxed .site',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( '404 Content Background', 'kadence' ),
),
),
);
Theme_Customizer::add_settings( $layout_404_settings );

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,634 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
<a href="#" class="nav-tab kadence-design-tab kadence-compontent-tabs-button" data-tab="design">
<span><?php esc_html_e( 'Design', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
ob_start(); ?>
<div class="kadence-compontent-description">
<p style="margin:0"><?php echo esc_html__( 'Title and Content settings affect legacy widgets. For block editor widgets use settings in the editor.', 'kadence' ); ?></p>
</div>
<?php
$component_description = ob_get_clean();
Theme_Customizer::add_settings(
array(
'footer_bottom_tabs' => array(
'control_type' => 'kadence_tab_control',
'section' => 'footer_bottom',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'footer_bottom',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'footer_bottom_design',
),
'active' => 'general',
),
),
'footer_bottom_tabs_design' => array(
'control_type' => 'kadence_tab_control',
'section' => 'footer_bottom_design',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'footer_bottom',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'footer_bottom_design',
),
'active' => 'design',
),
),
'footer_bottom_contain' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_bottom',
'priority' => 4,
'default' => kadence()->default( 'footer_bottom_contain' ),
'label' => esc_html__( 'Container Width', 'kadence' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-bottom-footer-wrap',
'pattern' => array(
'desktop' => 'site-footer-row-layout-$',
'tablet' => 'site-footer-row-tablet-layout-$',
'mobile' => 'site-footer-row-mobile-layout-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'standard' => array(
'tooltip' => __( 'Background Fullwidth, Content Contained', 'kadence' ),
'name' => __( 'Standard', 'kadence' ),
'icon' => '',
),
'fullwidth' => array(
'tooltip' => __( 'Background & Content Fullwidth', 'kadence' ),
'name' => __( 'Fullwidth', 'kadence' ),
'icon' => '',
),
'contained' => array(
'tooltip' => __( 'Background & Content Contained', 'kadence' ),
'name' => __( 'Contained', 'kadence' ),
'icon' => '',
),
),
),
),
'footer_bottom_columns' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_bottom',
'label' => esc_html__( 'Columns', 'kadence' ),
'priority' => 5,
//'transport' => 'refresh',
'default' => kadence()->default( 'footer_bottom_columns' ),
'partial' => array(
'selector' => '#colophon',
'container_inclusive' => true,
'render_callback' => 'Kadence\footer_markup',
),
'input_attrs' => array(
'layout' => array(
'1' => array(
'name' => __( '1', 'kadence' ),
),
'2' => array(
'name' => __( '2', 'kadence' ),
),
'3' => array(
'name' => __( '3', 'kadence' ),
),
'4' => array(
'name' => __( '4', 'kadence' ),
),
'5' => array(
'name' => __( '5', 'kadence' ),
),
),
'responsive' => false,
'footer' => 'bottom',
),
),
'footer_bottom_layout' => array(
'control_type' => 'kadence_row_control',
'section' => 'footer_bottom',
'label' => esc_html__( 'Layout', 'kadence' ),
'priority' => 5,
//'transport' => 'refresh',
'default' => kadence()->default( 'footer_bottom_layout' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-top-footer-inner-wrap',
'pattern' => array(
'desktop' => 'site-footer-row-column-layout-$',
'tablet' => 'site-footer-row-tablet-column-layout-$',
'mobile' => 'site-footer-row-mobile-column-layout-$',
),
'key' => '',
),
),
'input_attrs' => array(
'responsive' => true,
'footer' => 'bottom',
),
),
'footer_bottom_collapse' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_bottom',
'priority' => 5,
'default' => kadence()->default( 'footer_bottom_collapse' ),
'label' => esc_html__( 'Row Collapse', 'kadence' ),
'context' => array(
array(
'setting' => '__device',
'operator' => 'in',
'value' => array( 'tablet', 'mobile' ),
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-bottom-footer-inner-wrap',
'pattern' => 'ft-ro-collapse-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'normal' => array(
'name' => __( 'Left to Right', 'kadence' ),
'icon' => '',
),
'rtl' => array(
'name' => __( 'Right to Left', 'kadence' ),
'icon' => '',
),
),
'responsive' => false,
'footer' => 'bottom',
),
),
'footer_bottom_direction' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_bottom',
'priority' => 5,
'default' => kadence()->default( 'footer_bottom_direction' ),
'label' => esc_html__( 'Column Direction', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-bottom-footer-inner-wrap',
'pattern' => array(
'desktop' => 'ft-ro-dir-$',
'tablet' => 'ft-ro-t-dir-$',
'mobile' => 'ft-ro-m-dir-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'row' => array(
'tooltip' => __( 'Left to Right', 'kadence' ),
'name' => __( 'Row', 'kadence' ),
'icon' => '',
),
'column' => array(
'tooltip' => __( 'Top to Bottom', 'kadence' ),
'name' => __( 'Column', 'kadence' ),
'icon' => '',
),
),
'responsive' => true,
'footer' => 'bottom',
),
),
'footer_bottom_column_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_bottom',
'priority' => 5,
'label' => esc_html__( 'Column Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'property' => 'grid-column-gap',
'selector' => '#colophon .site-bottom-footer-inner-wrap',
'pattern' => '$',
'key' => 'size',
),
array(
'type' => 'css',
'property' => 'grid-row-gap',
'selector' => '#colophon .site-bottom-footer-inner-wrap',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_bottom_column_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_bottom_widget_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_bottom',
'priority' => 5,
'label' => esc_html__( 'Widget Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'property' => 'margin-bottom',
'selector' => '.site-bottom-footer-inner-wrap .widget',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_bottom_widget_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_bottom_top_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_bottom',
'priority' => 5,
'label' => esc_html__( 'Top Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-bottom-footer-inner-wrap',
'pattern' => '$',
'property' => 'padding-top',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_bottom_top_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_bottom_bottom_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_bottom',
'priority' => 5,
'label' => esc_html__( 'Bottom Spacing', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-bottom-footer-inner-wrap',
'pattern' => '$',
'property' => 'padding-bottom',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_bottom_bottom_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_bottom_height' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_bottom',
'priority' => 5,
'label' => esc_html__( 'Min Height', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-bottom-footer-inner-wrap',
'pattern' => '$',
'property' => 'min-height',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_bottom_height' ),
'input_attrs' => array(
'min' => array(
'px' => 10,
'em' => 1,
'rem' => 1,
'vh' => 2,
),
'max' => array(
'px' => 400,
'em' => 12,
'rem' => 12,
'vh' => 40,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vh' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vh' ),
),
),
'footer_bottom_widget_settings' => array(
'control_type' => 'kadence_blank_control',
'section' => 'footer_bottom_design',
'settings' => false,
'priority' => 1,
'description' => $component_description,
),
'footer_bottom_widget_title' => array(
'control_type' => 'kadence_typography_control',
'section' => 'footer_bottom_design',
'label' => esc_html__( 'Widget Titles', 'kadence' ),
'default' => kadence()->default( 'footer_bottom_widget_title' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.site-bottom-footer-wrap .site-footer-row-container-inner .widget-title',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'footer_bottom_widget_title',
),
),
'footer_bottom_widget_content' => array(
'control_type' => 'kadence_typography_control',
'section' => 'footer_bottom_design',
'label' => esc_html__( 'Widget Content', 'kadence' ),
'default' => kadence()->default( 'footer_bottom_widget_content' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.site-bottom-footer-wrap .site-footer-row-container-inner',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'footer_bottom_widget_content',
),
),
'footer_bottom_link_colors' => array(
'control_type' => 'kadence_color_control',
'section' => 'footer_bottom_design',
'label' => esc_html__( 'Link Colors', 'kadence' ),
'default' => kadence()->default( 'footer_bottom_link_colors' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.site-footer .site-bottom-footer-wrap .site-footer-row-container-inner a:where(:not(.button):not(.wp-block-button__link):not(.wp-element-button))',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.site-footer .site-bottom-footer-wrap .site-footer-row-container-inner a:where(:not(.button):not(.wp-block-button__link):not(.wp-element-button)):hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'footer_bottom_link_style' => array(
'control_type' => 'kadence_select_control',
'section' => 'footer_bottom_design',
'default' => kadence()->default( 'footer_bottom_link_style' ),
'label' => esc_html__( 'Link Style', 'kadence' ),
'input_attrs' => array(
'options' => array(
'plain' => array(
'name' => __( 'Underline on Hover', 'kadence' ),
),
'normal' => array(
'name' => __( 'Underline', 'kadence' ),
),
'noline' => array(
'name' => __( 'No Underline', 'kadence' ),
),
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-bottom-footer-inner-wrap',
'pattern' => 'ft-ro-lstyle-$',
'key' => '',
),
),
),
'footer_bottom_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'footer_bottom_design',
'label' => esc_html__( 'Bottom Row Background', 'kadence' ),
'default' => kadence()->default( 'footer_bottom_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => '.site-bottom-footer-wrap .site-footer-row-container-inner',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Bottom Row Background', 'kadence' ),
),
),
'footer_bottom_column_border' => array(
'control_type' => 'kadence_border_control',
'section' => 'footer_bottom_design',
'label' => esc_html__( 'Column Border', 'kadence' ),
'default' => kadence()->default( 'footer_bottom_column_border' ),
'live_method' => array(
array(
'type' => 'css_border',
'selector' => '.site-bottom-footer-inner-wrap .site-footer-section:not(:last-child):after',
'pattern' => '$',
'property' => 'border-right',
'pattern' => '$',
'key' => 'border',
),
),
),
'footer_bottom_border' => array(
'control_type' => 'kadence_borders_control',
'section' => 'footer_bottom_design',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'footer_bottom_border' ),
'settings' => array(
'border_top' => 'footer_bottom_top_border',
'border_bottom' => 'footer_bottom_bottom_border',
),
'live_method' => array(
'footer_bottom_top_border' => array(
array(
'type' => 'css_border',
'selector' => array(
'desktop' => '.site-bottom-footer-wrap .site-footer-row-container-inner',
'tablet' => '.site-bottom-footer-wrap .site-footer-row-container-inner',
'mobile' => '.site-bottom-footer-wrap .site-footer-row-container-inner',
),
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'border-top',
'pattern' => '$',
'key' => 'border',
),
),
'footer_bottom_bottom_border' => array(
array(
'type' => 'css_border',
'selector' => array(
'desktop' => '.site-bottom-footer-wrap .site-footer-row-container-inner',
'tablet' => '.site-bottom-footer-wrap .site-footer-row-container-inner',
'mobile' => '.site-bottom-footer-wrap .site-footer-row-container-inner',
),
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'border-bottom',
'pattern' => '$',
'key' => 'border',
),
),
),
),
)
);

View File

@@ -0,0 +1,184 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<!-- <div class="kadence-build-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab preview-desktop kadence-build-tabs-button" data-device="desktop">
<span class="dashicons dashicons-desktop"></span>
<span><?php esc_html_e( 'Desktop', 'kadence' ); ?></span>
</a>
<a href="#" class="nav-tab preview-tablet preview-mobile kadence-build-tabs-button" data-device="tablet">
<span class="dashicons dashicons-smartphone"></span>
<span><?php esc_html_e( 'Tablet / Mobile', 'kadence' ); ?></span>
</a>
</div> -->
<span class="button button-secondary kadence-builder-hide-button kadence-builder-tab-toggle"><span class="dashicons dashicons-no"></span><?php esc_html_e( 'Hide', 'kadence' ); ?></span>
<span class="button button-secondary kadence-builder-show-button kadence-builder-tab-toggle"><span class="dashicons dashicons-edit"></span><?php esc_html_e( 'Footer Builder', 'kadence' ); ?></span>
<?php
$builder_tabs = ob_get_clean();
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
<a href="#" class="nav-tab kadence-design-tab kadence-compontent-tabs-button" data-tab="design">
<span><?php esc_html_e( 'Design', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
$settings = array(
'footer_builder' => array(
'control_type' => 'kadence_blank_control',
'section' => 'footer_builder',
'settings' => false,
'description' => $builder_tabs,
),
'footer_items' => array(
'control_type' => 'kadence_builder_control',
'section' => 'footer_builder',
'default' => kadence()->default( 'footer_items' ),
'partial' => array(
'selector' => '#colophon',
'container_inclusive' => true,
'render_callback' => 'Kadence\footer_markup',
),
'choices' => array(
'footer-navigation' => array(
'name' => esc_html__( 'Footer Navigation', 'kadence' ),
'section' => 'kadence_customizer_footer_navigation',
),
'footer-social' => array(
'name' => esc_html__( 'Social', 'kadence' ),
'section' => 'kadence_customizer_footer_social',
),
'footer-html' => array(
'name' => esc_html__( 'Copyright', 'kadence' ),
'section' => 'kadence_customizer_footer_html',
),
'footer-widget1' => array(
'name' => esc_html__( 'Widget 1', 'kadence' ),
'section' => 'sidebar-widgets-footer1',
),
'footer-widget2' => array(
'name' => esc_html__( 'Widget 2', 'kadence' ),
'section' => 'sidebar-widgets-footer2',
),
'footer-widget3' => array(
'name' => esc_html__( 'Widget 3', 'kadence' ),
'section' => 'sidebar-widgets-footer3',
),
'footer-widget4' => array(
'name' => esc_html__( 'Widget 4', 'kadence' ),
'section' => 'sidebar-widgets-footer4',
),
'footer-widget5' => array(
'name' => esc_html__( 'Widget 5', 'kadence' ),
'section' => 'sidebar-widgets-footer5',
),
'footer-widget6' => array(
'name' => esc_html__( 'Widget 6', 'kadence' ),
'section' => 'sidebar-widgets-footer6',
),
),
'input_attrs' => array(
'group' => 'footer_items',
'rows' => array( 'top', 'middle', 'bottom' ),
'zones' => array(
'top' => array(
'top_1' => esc_html__( 'Top - 1', 'kadence' ),
'top_2' => esc_html__( 'Top - 2', 'kadence' ),
'top_3' => esc_html__( 'Top - 3', 'kadence' ),
'top_4' => esc_html__( 'Top - 4', 'kadence' ),
'top_5' => esc_html__( 'Top - 5', 'kadence' ),
),
'middle' => array(
'middle_1' => esc_html__( 'Middle - 1', 'kadence' ),
'middle_2' => esc_html__( 'Middle - 2', 'kadence' ),
'middle_3' => esc_html__( 'Middle - 3', 'kadence' ),
'middle_4' => esc_html__( 'Middle - 4', 'kadence' ),
'middle_5' => esc_html__( 'Middle - 5', 'kadence' ),
),
'bottom' => array(
'bottom_1' => esc_html__( 'Bottom - 1', 'kadence' ),
'bottom_2' => esc_html__( 'Bottom - 2', 'kadence' ),
'bottom_3' => esc_html__( 'Bottom - 3', 'kadence' ),
'bottom_4' => esc_html__( 'Bottom - 4', 'kadence' ),
'bottom_5' => esc_html__( 'Bottom - 5', 'kadence' ),
),
),
),
),
'footer_tab_settings' => array(
'control_type' => 'kadence_blank_control',
'section' => 'footer_layout',
'settings' => false,
'priority' => 1,
'description' => $compontent_tabs,
),
'footer_available_items' => array(
'control_type' => 'kadence_available_control',
'section' => 'footer_layout',
'settings' => false,
'input_attrs' => array(
'group' => 'footer_items',
'zones' => array( 'top', 'middle', 'bottom' ),
),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
),
'footer_wrap_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'footer_layout',
'label' => esc_html__( 'Footer Background', 'kadence' ),
'default' => kadence()->default( 'footer_wrap_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => '#colophon',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'input_attrs' => array(
'tooltip' => __( 'Footer Background', 'kadence' ),
),
),
'enable_footer_on_bottom' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'footer_layout',
'default' => kadence()->default( 'enable_footer_on_bottom' ),
'label' => esc_html__( 'Keep footer on bottom of screen', 'kadence' ),
'transport' => 'refresh',
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,264 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
<a href="#" class="nav-tab kadence-design-tab kadence-compontent-tabs-button" data-tab="design">
<span><?php esc_html_e( 'Design', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
$settings = array(
'footer_html_tabs' => array(
'control_type' => 'kadence_blank_control',
'section' => 'footer_html',
'settings' => false,
'priority' => 1,
'description' => $compontent_tabs,
),
'footer_html_content' => array(
'control_type' => 'kadence_editor_control',
'sanitize' => 'wp_kses_post',
'section' => 'footer_html',
'description' => esc_html__( 'Available Placeholders: {copyright} {year} {site-title} {theme-credit}', 'kadence' ),
'priority' => 4,
'default' => kadence()->default( 'footer_html_content' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'input_attrs' => array(
'id' => 'footer_html',
),
'partial' => array(
'selector' => '.footer-html',
'container_inclusive' => true,
'render_callback' => 'Kadence\footer_html',
),
),
'footer_html_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_html',
'label' => esc_html__( 'Content Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_html_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-info',
'pattern' => array(
'desktop' => 'content-align-$',
'tablet' => 'content-tablet-align-$',
'mobile' => 'content-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'footer_html_vertical_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_html',
'label' => esc_html__( 'Content Vertical Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_html_vertical_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-info',
'pattern' => array(
'desktop' => 'content-valign-$',
'tablet' => 'content-tablet-valign-$',
'mobile' => 'content-mobile-valign-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'top' => array(
'tooltip' => __( 'Top Align', 'kadence' ),
'icon' => 'aligntop',
),
'middle' => array(
'tooltip' => __( 'Middle Align', 'kadence' ),
'icon' => 'alignmiddle',
),
'bottom' => array(
'tooltip' => __( 'Bottom Align', 'kadence' ),
'icon' => 'alignbottom',
),
),
'responsive' => true,
),
),
'footer_html_typography' => array(
'control_type' => 'kadence_typography_control',
'section' => 'footer_html',
'label' => esc_html__( 'Font', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'default' => kadence()->default( 'footer_html_typography' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '#colophon .footer-html',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'footer_html_typography',
),
),
'footer_html_link_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'footer_html',
'label' => esc_html__( 'Link Colors', 'kadence' ),
'default' => kadence()->default( 'footer_html_link_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-footer-row-container .site-footer-row .footer-html a',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '#colophon .site-footer-row-container .site-footer-row .footer-html a:hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'footer_html_link_style' => array(
'control_type' => 'kadence_select_control',
'section' => 'footer_html',
'default' => kadence()->default( 'footer_html_link_style' ),
'label' => esc_html__( 'Link Style', 'kadence' ),
'input_attrs' => array(
'options' => array(
'normal' => array(
'name' => __( 'Underline', 'kadence' ),
),
'plain' => array(
'name' => __( 'No Underline', 'kadence' ),
),
),
),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '#colophon .footer-html',
'pattern' => 'inner-link-style-$',
'key' => '',
),
),
),
'footer_html_margin' => array(
'control_type' => 'kadence_measure_control',
'section' => 'footer_html',
'priority' => 10,
'default' => kadence()->default( 'footer_html_margin' ),
'label' => esc_html__( 'Margin', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .footer-html',
'property' => 'margin',
'pattern' => '$',
'key' => 'measure',
),
),
'input_attrs' => array(
'responsive' => false,
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,744 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
<a href="#" class="nav-tab kadence-design-tab kadence-compontent-tabs-button" data-tab="design">
<span><?php esc_html_e( 'Design', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
ob_start(); ?>
<div class="kadence-compontent-description">
<p style="margin:0"><?php echo esc_html__( 'Title and Content settings affect legacy widgets. For block editor widgets use settings in the editor.', 'kadence' ); ?></p>
</div>
<?php
$component_description = ob_get_clean();
$settings = array(
'footer_middle_tabs' => array(
'control_type' => 'kadence_blank_control',
'section' => 'footer_middle',
'settings' => false,
'priority' => 1,
'description' => $compontent_tabs,
),
'footer_middle_contain' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_middle',
'priority' => 4,
'default' => kadence()->default( 'footer_middle_contain' ),
'label' => esc_html__( 'Container Width', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-middle-footer-wrap',
'pattern' => array(
'desktop' => 'site-footer-row-layout-$',
'tablet' => 'site-footer-row-tablet-layout-$',
'mobile' => 'site-footer-row-mobile-layout-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'standard' => array(
'tooltip' => __( 'Background Fullwidth, Content Contained', 'kadence' ),
'name' => __( 'Standard', 'kadence' ),
'icon' => '',
),
'fullwidth' => array(
'tooltip' => __( 'Background & Content Fullwidth', 'kadence' ),
'name' => __( 'Fullwidth', 'kadence' ),
'icon' => '',
),
'contained' => array(
'tooltip' => __( 'Background & Content Contained', 'kadence' ),
'name' => __( 'Contained', 'kadence' ),
'icon' => '',
),
),
),
),
'footer_middle_columns' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_middle',
'label' => esc_html__( 'Columns', 'kadence' ),
'priority' => 5,
//'transport' => 'refresh',
'default' => kadence()->default( 'footer_middle_columns' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'partial' => array(
'selector' => '#colophon',
'container_inclusive' => true,
'render_callback' => 'Kadence\footer_markup',
),
'input_attrs' => array(
'layout' => array(
'1' => array(
'name' => __( '1', 'kadence' ),
),
'2' => array(
'name' => __( '2', 'kadence' ),
),
'3' => array(
'name' => __( '3', 'kadence' ),
),
'4' => array(
'name' => __( '4', 'kadence' ),
),
'5' => array(
'name' => __( '5', 'kadence' ),
),
),
'responsive' => false,
'footer' => 'middle',
),
),
'footer_middle_layout' => array(
'control_type' => 'kadence_row_control',
'section' => 'footer_middle',
'label' => esc_html__( 'Layout', 'kadence' ),
'priority' => 5,
//'transport' => 'refresh',
'default' => kadence()->default( 'footer_middle_layout' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-middle-footer-inner-wrap',
'pattern' => array(
'desktop' => 'site-footer-row-column-layout-$',
'tablet' => 'site-footer-row-tablet-column-layout-$',
'mobile' => 'site-footer-row-mobile-column-layout-$',
),
'key' => '',
),
),
'input_attrs' => array(
'responsive' => true,
'footer' => 'middle',
),
),
'footer_middle_collapse' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_middle',
'priority' => 5,
'default' => kadence()->default( 'footer_middle_collapse' ),
'label' => esc_html__( 'Row Collapse', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
array(
'setting' => '__device',
'operator' => 'in',
'value' => array( 'tablet', 'mobile' ),
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-middle-footer-inner-wrap',
'pattern' => 'ft-ro-collapse-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'normal' => array(
'name' => __( 'Left to Right', 'kadence' ),
'icon' => '',
),
'rtl' => array(
'name' => __( 'Right to Left', 'kadence' ),
'icon' => '',
),
),
'responsive' => false,
'footer' => 'middle',
),
),
'footer_middle_direction' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_middle',
'priority' => 5,
'default' => kadence()->default( 'footer_middle_direction' ),
'label' => esc_html__( 'Column Direction', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-middle-footer-inner-wrap',
'pattern' => array(
'desktop' => 'ft-ro-dir-$',
'tablet' => 'ft-ro-t-dir-$',
'mobile' => 'ft-ro-m-dir-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'row' => array(
'tooltip' => __( 'Left to Right', 'kadence' ),
'name' => __( 'Row', 'kadence' ),
'icon' => '',
),
'column' => array(
'tooltip' => __( 'Top to Bottom', 'kadence' ),
'name' => __( 'Column', 'kadence' ),
'icon' => '',
),
),
'responsive' => true,
'footer' => 'middle',
),
),
'footer_middle_column_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_middle',
'priority' => 5,
'label' => esc_html__( 'Column Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'property' => 'grid-column-gap',
'selector' => '#colophon .site-middle-footer-inner-wrap',
'pattern' => '$',
'key' => 'size',
),
array(
'type' => 'css',
'property' => 'grid-row-gap',
'selector' => '#colophon .site-middle-footer-inner-wrap',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_middle_column_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_middle_widget_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_middle',
'priority' => 5,
'label' => esc_html__( 'Widget Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'property' => 'margin-bottom',
'selector' => '.site-middle-footer-inner-wrap .widget',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_middle_widget_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_middle_top_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_middle',
'priority' => 5,
'label' => esc_html__( 'Top Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-middle-footer-inner-wrap',
'pattern' => '$',
'property' => 'padding-top',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_middle_top_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_middle_bottom_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_middle',
'priority' => 5,
'label' => esc_html__( 'Bottom Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-middle-footer-inner-wrap',
'pattern' => '$',
'property' => 'padding-bottom',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_middle_bottom_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_middle_height' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_middle',
'priority' => 5,
'label' => esc_html__( 'Min Height', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-middle-footer-inner-wrap',
'pattern' => '$',
'property' => 'min-height',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_middle_height' ),
'input_attrs' => array(
'min' => array(
'px' => 10,
'em' => 1,
'rem' => 1,
'vh' => 2,
),
'max' => array(
'px' => 400,
'em' => 12,
'rem' => 12,
'vh' => 40,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vh' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vh' ),
),
),
'footer_middle_widget_settings' => array(
'control_type' => 'kadence_blank_control',
'section' => 'footer_middle',
'settings' => false,
'priority' => 1,
'description' => $component_description,
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
),
'footer_middle_widget_title' => array(
'control_type' => 'kadence_typography_control',
'section' => 'footer_middle',
'label' => esc_html__( 'Widget Titles', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'default' => kadence()->default( 'footer_middle_widget_title' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.site-middle-footer-wrap .site-footer-row-container-inner .widget-title',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'footer_middle_widget_title',
),
),
'footer_middle_widget_content' => array(
'control_type' => 'kadence_typography_control',
'section' => 'footer_middle',
'label' => esc_html__( 'Widget Content', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'default' => kadence()->default( 'footer_middle_widget_content' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.site-middle-footer-wrap .site-footer-row-container-inner',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'footer_middle_widget_content',
),
),
'footer_middle_link_colors' => array(
'control_type' => 'kadence_color_control',
'section' => 'footer_middle',
'label' => esc_html__( 'Link Colors', 'kadence' ),
'default' => kadence()->default( 'footer_middle_link_colors' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.site-footer .site-middle-footer-wrap a:where(:not(.button):not(.wp-block-button__link):not(.wp-element-button))',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.site-footer .site-middle-footer-wrap a:where(:not(.button):not(.wp-block-button__link):not(.wp-element-button)):hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'footer_middle_link_style' => array(
'control_type' => 'kadence_select_control',
'section' => 'footer_middle',
'default' => kadence()->default( 'footer_middle_link_style' ),
'label' => esc_html__( 'Link Style', 'kadence' ),
'input_attrs' => array(
'options' => array(
'plain' => array(
'name' => __( 'Underline on Hover', 'kadence' ),
),
'normal' => array(
'name' => __( 'Underline', 'kadence' ),
),
'noline' => array(
'name' => __( 'No Underline', 'kadence' ),
),
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-middle-footer-inner-wrap',
'pattern' => 'ft-ro-lstyle-$',
'key' => '',
),
),
),
'footer_middle_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'footer_middle',
'label' => esc_html__( 'Middle Row Background', 'kadence' ),
'default' => kadence()->default( 'footer_middle_background' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => '.site-middle-footer-wrap .site-footer-row-container-inner',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Middle Row Background', 'kadence' ),
),
),
'footer_middle_column_border' => array(
'control_type' => 'kadence_border_control',
'section' => 'footer_middle',
'label' => esc_html__( 'Column Border', 'kadence' ),
'default' => kadence()->default( 'footer_middle_column_border' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'live_method' => array(
array(
'type' => 'css_border',
'selector' => '.site-middle-footer-inner-wrap .site-footer-section:not(:last-child):after',
'pattern' => '$',
'property' => 'border-right',
'pattern' => '$',
'key' => 'border',
),
),
),
'footer_middle_border' => array(
'control_type' => 'kadence_borders_control',
'section' => 'footer_middle',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'footer_middle_border' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'settings' => array(
'border_top' => 'footer_middle_top_border',
'border_bottom' => 'footer_middle_bottom_border',
),
'live_method' => array(
'footer_middle_top_border' => array(
array(
'type' => 'css_border',
'selector' => array(
'desktop' => '.site-middle-footer-wrap .site-footer-row-container-inner',
'tablet' => '.site-middle-footer-wrap .site-footer-row-container-inner',
'mobile' => '.site-middle-footer-wrap .site-footer-row-container-inner',
),
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'border-top',
'pattern' => '$',
'key' => 'border',
),
),
'footer_middle_bottom_border' => array(
array(
'type' => 'css_border',
'selector' => array(
'desktop' => '.site-middle-footer-wrap .site-footer-row-container-inner',
'tablet' => '.site-middle-footer-wrap .site-footer-row-container-inner',
'mobile' => '.site-middle-footer-wrap .site-footer-row-container-inner',
),
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'border-bottom',
'pattern' => '$',
'key' => 'border',
),
),
),
),
// 'footer_middle_top_border' => array(
// 'control_type' => 'kadence_border_control',
// 'section' => 'footer_middle',
// 'label' => esc_html__( 'Top Border', 'kadence' ),
// 'default' => kadence()->default( 'footer_middle_top_border' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
// 'live_method' => array(
// array(
// 'type' => 'css_border',
// 'selector' => array(
// 'desktop' => '.site-middle-footer-wrap .site-footer-row-container-inner',
// 'tablet' => '.site-middle-footer-wrap .site-footer-row-container-inner',
// 'mobile' => '.site-middle-footer-wrap .site-footer-row-container-inner',
// ),
// 'pattern' => array(
// 'desktop' => '$',
// 'tablet' => '$',
// 'mobile' => '$',
// ),
// 'property' => 'border-top',
// 'pattern' => '$',
// 'key' => 'border',
// ),
// ),
// ),
// 'footer_middle_bottom_border' => array(
// 'control_type' => 'kadence_border_control',
// 'section' => 'footer_middle',
// 'label' => esc_html__( 'Bottom Border', 'kadence' ),
// 'default' => kadence()->default( 'footer_middle_bottom_border' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
// 'live_method' => array(
// array(
// 'type' => 'css_border',
// 'selector' => array(
// 'desktop' => '.site-middle-footer-wrap .site-footer-row-container-inner',
// 'tablet' => '.site-middle-footer-wrap .site-footer-row-container-inner',
// 'mobile' => '.site-middle-footer-wrap .site-footer-row-container-inner',
// ),
// 'pattern' => array(
// 'desktop' => '$',
// 'tablet' => '$',
// 'mobile' => '$',
// ),
// 'property' => 'border-bottom',
// 'pattern' => '$',
// 'key' => 'border',
// ),
// ),
// ),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,389 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
<a href="#" class="nav-tab kadence-design-tab kadence-compontent-tabs-button" data-tab="design">
<span><?php esc_html_e( 'Design', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
$settings = array(
'footer_navigation_tabs' => array(
'control_type' => 'kadence_blank_control',
'section' => 'footer_navigation',
'settings' => false,
'priority' => 1,
'description' => $compontent_tabs,
),
'footer_navigation_link' => array(
'control_type' => 'kadence_focus_button_control',
'section' => 'footer_navigation',
'settings' => false,
'priority' => 5,
'label' => esc_html__( 'Select Menu', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'input_attrs' => array(
'section' => 'menu_locations',
),
),
'footer_navigation_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_navigation',
'priority' => 5,
'label' => esc_html__( 'Items Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul > li > a',
'property' => 'padding-left',
'pattern' => 'calc($ / 2)',
'key' => 'size',
),
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul > li > a',
'property' => 'padding-right',
'pattern' => 'calc($ / 2)',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_navigation_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
'vw' => 0,
),
'max' => array(
'px' => 100,
'em' => 12,
'rem' => 12,
'vw' => 12,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vw' => 0.01,
),
'units' => array( 'px', 'em', 'rem', 'vw' ),
'responsive' => false,
),
),
'footer_navigation_stretch' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'footer_navigation',
'priority' => 5,
'default' => kadence()->default( 'footer_navigation_stretch' ),
'label' => esc_html__( 'Stretch Menu?', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-navigation-wrap',
'pattern' => 'footer-navigation-layout-stretch-$',
'key' => 'switch',
),
),
),
'footer_navigation_vertical_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_navigation',
'label' => esc_html__( 'Items Top and Bottom Padding', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul > li > a',
'property' => 'padding-top',
'pattern' => '$',
'key' => 'size',
),
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul > li > a',
'property' => 'padding-bottom',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_navigation_vertical_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
'vh' => 0,
),
'max' => array(
'px' => 100,
'em' => 12,
'rem' => 12,
'vh' => 12,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vh' => 0.01,
),
'units' => array( 'px', 'em', 'rem', 'vh' ),
'responsive' => false,
),
),
'footer_navigation_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_navigation',
'label' => esc_html__( 'Content Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_navigation_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-navigation-wrap',
'pattern' => array(
'desktop' => 'content-align-$',
'tablet' => 'content-tablet-align-$',
'mobile' => 'content-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'footer_navigation_vertical_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_navigation',
'label' => esc_html__( 'Content Vertical Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_navigation_vertical_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-navigation-wrap',
'pattern' => array(
'desktop' => 'content-valign-$',
'tablet' => 'content-tablet-valign-$',
'mobile' => 'content-mobile-valign-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'top' => array(
'tooltip' => __( 'Top Align', 'kadence' ),
'icon' => 'aligntop',
),
'middle' => array(
'tooltip' => __( 'Middle Align', 'kadence' ),
'icon' => 'alignmiddle',
),
'bottom' => array(
'tooltip' => __( 'Bottom Align', 'kadence' ),
'icon' => 'alignbottom',
),
),
'responsive' => true,
),
),
'footer_navigation_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'footer_navigation',
'label' => esc_html__( 'Navigation Colors', 'kadence' ),
'default' => kadence()->default( 'footer_navigation_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul li a',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul li a:hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul li.current-menu-item > a, #colophon .footer-navigation .footer-menu-container > ul li.current_page_item > a',
'property' => 'color',
'pattern' => '$',
'key' => 'active',
),
),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
'active' => array(
'tooltip' => __( 'Active Color', 'kadence' ),
'palette' => true,
),
),
),
),
'footer_navigation_background' => array(
'control_type' => 'kadence_color_control',
'section' => 'footer_navigation',
'label' => esc_html__( 'Navigation Background', 'kadence' ),
'default' => kadence()->default( 'footer_navigation_background' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul li a',
'property' => 'background',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul li a:hover',
'property' => 'background',
'pattern' => '$',
'key' => 'hover',
),
array(
'type' => 'css',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul li.current-menu-item > a, #colophon .footer-navigation .footer-menu-container > ul > li.current_page_item > a',
'property' => 'background',
'pattern' => '$',
'key' => 'active',
),
),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Background', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Background', 'kadence' ),
'palette' => true,
),
'active' => array(
'tooltip' => __( 'Active Background', 'kadence' ),
'palette' => true,
),
),
),
),
'footer_navigation_typography' => array(
'control_type' => 'kadence_typography_control',
'section' => 'footer_navigation',
'label' => esc_html__( 'Navigation Font', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'default' => kadence()->default( 'footer_navigation_typography' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '#colophon .footer-navigation .footer-menu-container > ul li a',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'footer_navigation_typography',
'options' => 'no-color',
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,502 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
$settings = array(
'footer_social_tabs' => array(
'control_type' => 'kadence_tab_control',
'section' => 'footer_social',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'footer_social',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'footer_social_design',
),
'active' => 'general',
),
),
'footer_social_tabs_design' => array(
'control_type' => 'kadence_tab_control',
'section' => 'footer_social_design',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'footer_social',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'footer_social_design',
),
'active' => 'design',
),
),
'footer_social_title' => array(
'control_type' => 'kadence_text_control',
'section' => 'footer_social',
'sanitize' => 'sanitize_text_field',
'priority' => 4,
'label' => esc_html__( 'Title', 'kadence' ),
'default' => kadence()->default( 'footer_social_title' ),
'partial' => array(
'selector' => '.footer-social-wrap',
'container_inclusive' => true,
'render_callback' => 'Kadence\footer_social',
),
),
'footer_social_items' => array(
'control_type' => 'kadence_social_control',
'section' => 'footer_social',
'priority' => 6,
'default' => kadence()->default( 'footer_social_items' ),
'label' => esc_html__( 'Social Items', 'kadence' ),
'partial' => array(
'selector' => '.footer-social-wrap',
'container_inclusive' => true,
'render_callback' => 'Kadence\footer_social',
),
),
'footer_social_show_label' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'footer_social',
'priority' => 8,
'default' => kadence()->default( 'footer_social_show_label' ),
'label' => esc_html__( 'Show Icon Label?', 'kadence' ),
'partial' => array(
'selector' => '.footer-social-wrap',
'container_inclusive' => true,
'render_callback' => 'Kadence\footer_social',
),
),
'footer_social_item_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_social',
'label' => esc_html__( 'Item Spacing', 'kadence' ),
'default' => kadence()->default( 'footer_social_item_spacing' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-footer-wrap .footer-social-wrap .footer-social-inner-wrap',
'property' => 'gap',
'pattern' => '$',
'key' => 'size',
),
),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 50,
'em' => 3,
'rem' => 3,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
'responsive' => false,
),
),
'footer_social_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_social',
'label' => esc_html__( 'Content Align', 'kadence' ),
'priority' => 10,
'default' => kadence()->default( 'footer_social_align' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-social',
'pattern' => array(
'desktop' => 'content-align-$',
'tablet' => 'content-tablet-align-$',
'mobile' => 'content-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'footer_social_vertical_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_social',
'label' => esc_html__( 'Content Vertical Align', 'kadence' ),
'priority' => 10,
'default' => kadence()->default( 'footer_social_vertical_align' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-social',
'pattern' => array(
'desktop' => 'content-valign-$',
'tablet' => 'content-tablet-valign-$',
'mobile' => 'content-mobile-valign-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'top' => array(
'tooltip' => __( 'Top Align', 'kadence' ),
'icon' => 'aligntop',
),
'middle' => array(
'tooltip' => __( 'Middle Align', 'kadence' ),
'icon' => 'alignmiddle',
),
'bottom' => array(
'tooltip' => __( 'Bottom Align', 'kadence' ),
'icon' => 'alignbottom',
),
),
'responsive' => true,
),
),
'footer_social_style' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_social_design',
'priority' => 10,
'default' => kadence()->default( 'footer_social_style' ),
'label' => esc_html__( 'Social Style', 'kadence' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-social-inner-wrap',
'pattern' => 'social-style-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'filled' => array(
'name' => __( 'Filled', 'kadence' ),
),
'outline' => array(
'name' => __( 'Outline', 'kadence' ),
),
),
'responsive' => false,
),
),
'footer_social_icon_size' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_social_design',
'label' => esc_html__( 'Icon Size', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.footer-social-wrap .footer-social-inner-wrap',
'property' => 'font-size',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_social_icon_size' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 100,
'em' => 12,
'rem' => 12,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
'responsive' => false,
),
),
'footer_social_brand' => array(
'control_type' => 'kadence_select_control',
'section' => 'footer_social_design',
'transport' => 'refresh',
'default' => kadence()->default( 'footer_social_brand' ),
'label' => esc_html__( 'Use Brand Colors?', 'kadence' ),
'input_attrs' => array(
'options' => array(
'' => array(
'name' => __( 'No', 'kadence' ),
),
'always' => array(
'name' => __( 'Yes', 'kadence' ),
),
'onhover' => array(
'name' => __( 'On Hover', 'kadence' ),
),
'untilhover' => array(
'name' => __( 'Until Hover', 'kadence' ),
),
),
),
),
'footer_social_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'footer_social_design',
'label' => esc_html__( 'Colors', 'kadence' ),
'default' => kadence()->default( 'footer_social_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.site-footer .site-footer-wrap .site-footer-section .footer-social-wrap .footer-social-inner-wrap .social-button',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.site-footer .site-footer-wrap .site-footer-section .footer-social-wrap .footer-social-inner-wrap .social-button:hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'footer_social_background' => array(
'control_type' => 'kadence_color_control',
'section' => 'footer_social_design',
'label' => esc_html__( 'Background Colors', 'kadence' ),
'default' => kadence()->default( 'footer_social_background' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.site-footer .site-footer-wrap .site-footer-section .footer-social-wrap .footer-social-inner-wrap .social-button',
'property' => 'background',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.site-footer .site-footer-wrap .site-footer-section .footer-social-wrap .footer-social-inner-wrap .social-button:hover',
'property' => 'background',
'pattern' => '$',
'key' => 'hover',
),
),
'context' => array(
array(
'setting' => 'footer_social_style',
'operator' => '=',
'value' => 'filled',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'footer_social_border_colors' => array(
'control_type' => 'kadence_color_control',
'section' => 'footer_social_design',
'label' => esc_html__( 'Border Colors', 'kadence' ),
'default' => kadence()->default( 'footer_social_border' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.site-footer .site-footer-wrap .site-footer-section .footer-social-wrap .footer-social-inner-wrap .social-button',
'property' => 'border-color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.site-footer .site-footer-wrap .site-footer-section .footer-social-wrap .footer-social-inner-wrap .social-button:hover',
'property' => 'border-color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'footer_social_border' => array(
'control_type' => 'kadence_border_control',
'section' => 'footer_social_design',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'footer_social_border' ),
'live_method' => array(
array(
'type' => 'css_border',
'selector' => '.site-footer .site-footer-wrap .site-footer-section .footer-social-wrap .footer-social-inner-wrap .social-button',
'property' => 'border',
'pattern' => '$',
'key' => 'border',
),
),
'input_attrs' => array(
'responsive' => false,
'color' => false,
),
),
'footer_social_border_radius' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_social_design',
'label' => esc_html__( 'Border Radius', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.site-footer .site-footer-wrap .site-footer-section .footer-social-wrap .footer-social-inner-wrap .social-button',
'property' => 'border-radius',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_social_border_radius' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
'%' => 0,
),
'max' => array(
'px' => 100,
'em' => 12,
'rem' => 12,
'%' => 100,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'%' => 1,
),
'units' => array( 'px', 'em', 'rem', '%' ),
'responsive' => false,
),
),
'footer_social_typography' => array(
'control_type' => 'kadence_typography_control',
'section' => 'footer_social_design',
'label' => esc_html__( 'Font', 'kadence' ),
'context' => array(
array(
'setting' => 'footer_social_show_label',
'operator' => '=',
'value' => true,
),
),
'default' => kadence()->default( 'footer_social_typography' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.footer-social-wrap a.social-button .social-label',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'footer_social_typography',
'options' => 'no-color',
),
),
'footer_social_margin' => array(
'control_type' => 'kadence_measure_control',
'section' => 'footer_social_design',
'priority' => 10,
'default' => kadence()->default( 'footer_social_margin' ),
'label' => esc_html__( 'Margin', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .footer-social-wrap',
'property' => 'margin',
'pattern' => '$',
'key' => 'measure',
),
),
'input_attrs' => array(
'responsive' => false,
),
),
'footer_social_link_to_social_links' => array(
'control_type' => 'kadence_focus_button_control',
'section' => 'footer_social',
'settings' => false,
'priority' => 25,
'label' => esc_html__( 'Set Social Links', 'kadence' ),
'input_attrs' => array(
'section' => 'kadence_customizer_general_social',
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,744 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
<a href="#" class="nav-tab kadence-design-tab kadence-compontent-tabs-button" data-tab="design">
<span><?php esc_html_e( 'Design', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
ob_start(); ?>
<div class="kadence-compontent-description">
<p style="margin:0"><?php echo esc_html__( 'Title and Content settings affect legacy widgets. For block editor widgets use settings in the editor.', 'kadence' ); ?></p>
</div>
<?php
$component_description = ob_get_clean();
$settings = array(
'footer_top_tabs' => array(
'control_type' => 'kadence_blank_control',
'section' => 'footer_top',
'settings' => false,
'priority' => 1,
'description' => $compontent_tabs,
),
'footer_top_contain' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_top',
'priority' => 4,
'default' => kadence()->default( 'footer_top_contain' ),
'label' => esc_html__( 'Container Width', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-top-footer-wrap',
'pattern' => array(
'desktop' => 'site-footer-row-layout-$',
'tablet' => 'site-footer-row-tablet-layout-$',
'mobile' => 'site-footer-row-mobile-layout-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'standard' => array(
'tooltip' => __( 'Background Fullwidth, Content Contained', 'kadence' ),
'name' => __( 'Standard', 'kadence' ),
'icon' => '',
),
'fullwidth' => array(
'tooltip' => __( 'Background & Content Fullwidth', 'kadence' ),
'name' => __( 'Fullwidth', 'kadence' ),
'icon' => '',
),
'contained' => array(
'tooltip' => __( 'Background & Content Contained', 'kadence' ),
'name' => __( 'Contained', 'kadence' ),
'icon' => '',
),
),
),
),
'footer_top_columns' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_top',
'label' => esc_html__( 'Columns', 'kadence' ),
'priority' => 5,
//'transport' => 'refresh',
'default' => kadence()->default( 'footer_top_columns' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'partial' => array(
'selector' => '#colophon',
'container_inclusive' => true,
'render_callback' => 'Kadence\footer_markup',
),
'input_attrs' => array(
'layout' => array(
'1' => array(
'name' => __( '1', 'kadence' ),
),
'2' => array(
'name' => __( '2', 'kadence' ),
),
'3' => array(
'name' => __( '3', 'kadence' ),
),
'4' => array(
'name' => __( '4', 'kadence' ),
),
'5' => array(
'name' => __( '5', 'kadence' ),
),
),
'responsive' => false,
'footer' => 'top',
),
),
'footer_top_layout' => array(
'control_type' => 'kadence_row_control',
'section' => 'footer_top',
'label' => esc_html__( 'Layout', 'kadence' ),
'priority' => 5,
//'transport' => 'refresh',
'default' => kadence()->default( 'footer_top_layout' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-top-footer-inner-wrap',
'pattern' => array(
'desktop' => 'site-footer-row-column-layout-$',
'tablet' => 'site-footer-row-tablet-column-layout-$',
'mobile' => 'site-footer-row-mobile-column-layout-$',
),
'key' => '',
),
),
'input_attrs' => array(
'responsive' => true,
'footer' => 'top',
),
),
'footer_top_collapse' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_top',
'priority' => 5,
'default' => kadence()->default( 'footer_top_collapse' ),
'label' => esc_html__( 'Row Collapse', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
array(
'setting' => '__device',
'operator' => 'in',
'value' => array( 'tablet', 'mobile' ),
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-top-footer-inner-wrap',
'pattern' => 'ft-ro-collapse-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'normal' => array(
'name' => __( 'Left to Right', 'kadence' ),
'icon' => '',
),
'rtl' => array(
'name' => __( 'Right to Left', 'kadence' ),
'icon' => '',
),
),
'responsive' => false,
'footer' => 'top',
),
),
'footer_top_direction' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'footer_top',
'priority' => 5,
'default' => kadence()->default( 'footer_top_direction' ),
'label' => esc_html__( 'Column Direction', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-top-footer-inner-wrap',
'pattern' => array(
'desktop' => 'ft-ro-dir-$',
'tablet' => 'ft-ro-t-dir-$',
'mobile' => 'ft-ro-m-dir-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'row' => array(
'tooltip' => __( 'Left to Right', 'kadence' ),
'name' => __( 'Row', 'kadence' ),
'icon' => '',
),
'column' => array(
'tooltip' => __( 'Top to Bottom', 'kadence' ),
'name' => __( 'Column', 'kadence' ),
'icon' => '',
),
),
'responsive' => true,
'footer' => 'top',
),
),
'footer_top_column_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_top',
'priority' => 5,
'label' => esc_html__( 'Column Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'property' => 'grid-column-gap',
'selector' => '#colophon .site-top-footer-inner-wrap',
'pattern' => '$',
'key' => 'size',
),
array(
'type' => 'css',
'property' => 'grid-row-gap',
'selector' => '#colophon .site-top-footer-inner-wrap',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_top_column_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_top_widget_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_top',
'priority' => 5,
'label' => esc_html__( 'Widget Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'property' => 'margin-bottom',
'selector' => '.site-top-footer-inner-wrap .widget',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_top_widget_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_top_top_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_top',
'priority' => 5,
'label' => esc_html__( 'Top Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-top-footer-inner-wrap',
'pattern' => '$',
'property' => 'padding-top',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_top_top_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_top_bottom_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_top',
'priority' => 5,
'label' => esc_html__( 'Bottom Spacing', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-top-footer-inner-wrap',
'pattern' => '$',
'property' => 'padding-bottom',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_top_bottom_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'footer_top_height' => array(
'control_type' => 'kadence_range_control',
'section' => 'footer_top',
'priority' => 5,
'label' => esc_html__( 'Min Height', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#colophon .site-top-footer-inner-wrap',
'pattern' => '$',
'property' => 'min-height',
'key' => 'size',
),
),
'default' => kadence()->default( 'footer_top_height' ),
'input_attrs' => array(
'min' => array(
'px' => 10,
'em' => 1,
'rem' => 1,
'vh' => 2,
),
'max' => array(
'px' => 400,
'em' => 12,
'rem' => 12,
'vh' => 40,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vh' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vh' ),
),
),
'footer_top_widget_settings' => array(
'control_type' => 'kadence_blank_control',
'section' => 'footer_top',
'settings' => false,
'priority' => 1,
'description' => $component_description,
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
),
'footer_top_widget_title' => array(
'control_type' => 'kadence_typography_control',
'section' => 'footer_top',
'label' => esc_html__( 'Widget Titles', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'default' => kadence()->default( 'footer_top_widget_title' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.site-top-footer-wrap .site-footer-row-container-inner .widget-title',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'footer_top_widget_title',
),
),
'footer_top_widget_content' => array(
'control_type' => 'kadence_typography_control',
'section' => 'footer_top',
'label' => esc_html__( 'Widget Content', 'kadence' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'default' => kadence()->default( 'footer_top_widget_content' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.site-top-footer-wrap .site-footer-row-container-inner',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'footer_top_widget_content',
),
),
'footer_top_link_colors' => array(
'control_type' => 'kadence_color_control',
'section' => 'footer_top',
'label' => esc_html__( 'Link Colors', 'kadence' ),
'default' => kadence()->default( 'footer_top_link_colors' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.site-footer .site-top-footer-wrap a:where(:not(.button):not(.wp-block-button__link):not(.wp-element-button))',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.site-footer .site-top-footer-wrap a:where(:not(.button):not(.wp-block-button__link):not(.wp-element-button)):hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'footer_top_link_style' => array(
'control_type' => 'kadence_select_control',
'section' => 'footer_top',
'default' => kadence()->default( 'footer_top_link_style' ),
'label' => esc_html__( 'Link Style', 'kadence' ),
'input_attrs' => array(
'options' => array(
'plain' => array(
'name' => __( 'Underline on Hover', 'kadence' ),
),
'normal' => array(
'name' => __( 'Underline', 'kadence' ),
),
'noline' => array(
'name' => __( 'No Underline', 'kadence' ),
),
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.site-top-footer-inner-wrap',
'pattern' => 'ft-ro-lstyle-$',
'key' => '',
),
),
),
'footer_top_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'footer_top',
'label' => esc_html__( 'Top Row Background', 'kadence' ),
'default' => kadence()->default( 'footer_top_background' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => '.site-top-footer-wrap .site-footer-row-container-inner',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Top Row Background', 'kadence' ),
),
),
'footer_top_column_border' => array(
'control_type' => 'kadence_border_control',
'section' => 'footer_top',
'label' => esc_html__( 'Column Border', 'kadence' ),
'default' => kadence()->default( 'footer_top_column_border' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'live_method' => array(
array(
'type' => 'css_border',
'selector' => '.site-top-footer-inner-wrap .site-footer-section:not(:last-child):after',
'pattern' => '$',
'property' => 'border-right',
'pattern' => '$',
'key' => 'border',
),
),
),
'footer_top_border' => array(
'control_type' => 'kadence_borders_control',
'section' => 'footer_top',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'footer_top_border' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'design',
),
),
'settings' => array(
'border_top' => 'footer_top_top_border',
'border_bottom' => 'footer_top_bottom_border',
),
'live_method' => array(
'footer_top_top_border' => array(
array(
'type' => 'css_border',
'selector' => array(
'desktop' => '.site-top-footer-wrap .site-footer-row-container-inner',
'tablet' => '.site-top-footer-wrap .site-footer-row-container-inner',
'mobile' => '.site-top-footer-wrap .site-footer-row-container-inner',
),
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'border-top',
'pattern' => '$',
'key' => 'border',
),
),
'footer_top_bottom_border' => array(
array(
'type' => 'css_border',
'selector' => array(
'desktop' => '.site-top-footer-wrap .site-footer-row-container-inner',
'tablet' => '.site-top-footer-wrap .site-footer-row-container-inner',
'mobile' => '.site-top-footer-wrap .site-footer-row-container-inner',
),
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'border-bottom',
'pattern' => '$',
'key' => 'border',
),
),
),
),
// 'footer_top_top_border' => array(
// 'control_type' => 'kadence_border_control',
// 'section' => 'footer_top',
// 'label' => esc_html__( 'Top Border', 'kadence' ),
// 'default' => kadence()->default( 'footer_top_top_border' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
// 'live_method' => array(
// array(
// 'type' => 'css_border',
// 'selector' => array(
// 'desktop' => '.site-top-footer-wrap .site-footer-row-container-inner',
// 'tablet' => '.site-top-footer-wrap .site-footer-row-container-inner',
// 'mobile' => '.site-top-footer-wrap .site-footer-row-container-inner',
// ),
// 'pattern' => array(
// 'desktop' => '$',
// 'tablet' => '$',
// 'mobile' => '$',
// ),
// 'property' => 'border-top',
// 'pattern' => '$',
// 'key' => 'border',
// ),
// ),
// ),
// 'footer_top_bottom_border' => array(
// 'control_type' => 'kadence_border_control',
// 'section' => 'footer_top',
// 'label' => esc_html__( 'Bottom Border', 'kadence' ),
// 'default' => kadence()->default( 'footer_top_bottom_border' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
// 'live_method' => array(
// array(
// 'type' => 'css_border',
// 'selector' => array(
// 'desktop' => '.site-top-footer-wrap .site-footer-row-container-inner',
// 'tablet' => '.site-top-footer-wrap .site-footer-row-container-inner',
// 'mobile' => '.site-top-footer-wrap .site-footer-row-container-inner',
// ),
// 'pattern' => array(
// 'desktop' => '$',
// 'tablet' => '$',
// 'mobile' => '$',
// ),
// 'property' => 'border-bottom',
// 'pattern' => '$',
// 'key' => 'border',
// ),
// ),
// ),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,116 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
$settings = array(
'footer_widget1_breaker' => array(
'control_type' => 'kadence_blank_control',
'section' => 'sidebar-widgets-footer1',
'settings' => false,
'priority' => 5,
'description' => $compontent_tabs,
),
'footer_widget1_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer1',
'label' => esc_html__( 'Content Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget1_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget1',
'pattern' => array(
'desktop' => 'content-align-$',
'tablet' => 'content-tablet-align-$',
'mobile' => 'content-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'footer_widget1_vertical_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer1',
'label' => esc_html__( 'Content Vertical Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget1_vertical_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget1',
'pattern' => array(
'desktop' => 'content-valign-$',
'tablet' => 'content-tablet-valign-$',
'mobile' => 'content-mobile-valign-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'top' => array(
'tooltip' => __( 'Top Align', 'kadence' ),
'icon' => 'aligntop',
),
'middle' => array(
'tooltip' => __( 'Middle Align', 'kadence' ),
'icon' => 'alignmiddle',
),
'bottom' => array(
'tooltip' => __( 'Bottom Align', 'kadence' ),
'icon' => 'alignbottom',
),
),
'responsive' => true,
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,116 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
$settings = array(
'footer_widget2_breaker' => array(
'control_type' => 'kadence_blank_control',
'section' => 'sidebar-widgets-footer2',
'settings' => false,
'priority' => 5,
'description' => $compontent_tabs,
),
'footer_widget2_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer2',
'label' => esc_html__( 'Content Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget2_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget2',
'pattern' => array(
'desktop' => 'content-align-$',
'tablet' => 'content-tablet-align-$',
'mobile' => 'content-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'footer_widget2_vertical_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer2',
'label' => esc_html__( 'Content Vertical Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget2_vertical_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget2',
'pattern' => array(
'desktop' => 'content-valign-$',
'tablet' => 'content-tablet-valign-$',
'mobile' => 'content-mobile-valign-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'top' => array(
'tooltip' => __( 'Top Align', 'kadence' ),
'icon' => 'aligntop',
),
'middle' => array(
'tooltip' => __( 'Middle Align', 'kadence' ),
'icon' => 'alignmiddle',
),
'bottom' => array(
'tooltip' => __( 'Bottom Align', 'kadence' ),
'icon' => 'alignbottom',
),
),
'responsive' => true,
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,116 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
$settings = array(
'footer_widget3_breaker' => array(
'control_type' => 'kadence_blank_control',
'section' => 'sidebar-widgets-footer3',
'settings' => false,
'priority' => 5,
'description' => $compontent_tabs,
),
'footer_widget3_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer3',
'label' => esc_html__( 'Content Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget3_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget3',
'pattern' => array(
'desktop' => 'content-align-$',
'tablet' => 'content-tablet-align-$',
'mobile' => 'content-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'footer_widget3_vertical_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer3',
'label' => esc_html__( 'Content Vertical Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget3_vertical_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget3',
'pattern' => array(
'desktop' => 'content-valign-$',
'tablet' => 'content-tablet-valign-$',
'mobile' => 'content-mobile-valign-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'top' => array(
'tooltip' => __( 'Top Align', 'kadence' ),
'icon' => 'aligntop',
),
'middle' => array(
'tooltip' => __( 'Middle Align', 'kadence' ),
'icon' => 'alignmiddle',
),
'bottom' => array(
'tooltip' => __( 'Bottom Align', 'kadence' ),
'icon' => 'alignbottom',
),
),
'responsive' => true,
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,116 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
$settings = array(
'footer_widget4_breaker' => array(
'control_type' => 'kadence_blank_control',
'section' => 'sidebar-widgets-footer4',
'settings' => false,
'priority' => 5,
'description' => $compontent_tabs,
),
'footer_widget4_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer4',
'label' => esc_html__( 'Content Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget4_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget4',
'pattern' => array(
'desktop' => 'content-align-$',
'tablet' => 'content-tablet-align-$',
'mobile' => 'content-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'footer_widget4_vertical_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer4',
'label' => esc_html__( 'Content Vertical Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget4_vertical_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget4',
'pattern' => array(
'desktop' => 'content-valign-$',
'tablet' => 'content-tablet-valign-$',
'mobile' => 'content-mobile-valign-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'top' => array(
'tooltip' => __( 'Top Align', 'kadence' ),
'icon' => 'aligntop',
),
'middle' => array(
'tooltip' => __( 'Middle Align', 'kadence' ),
'icon' => 'alignmiddle',
),
'bottom' => array(
'tooltip' => __( 'Bottom Align', 'kadence' ),
'icon' => 'alignbottom',
),
),
'responsive' => true,
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,116 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
$settings = array(
'footer_widget5_breaker' => array(
'control_type' => 'kadence_blank_control',
'section' => 'sidebar-widgets-footer5',
'settings' => false,
'priority' => 5,
'description' => $compontent_tabs,
),
'footer_widget5_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer5',
'label' => esc_html__( 'Content Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget5_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget5',
'pattern' => array(
'desktop' => 'content-align-$',
'tablet' => 'content-tablet-align-$',
'mobile' => 'content-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'footer_widget5_vertical_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer5',
'label' => esc_html__( 'Content Vertical Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget5_vertical_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget5',
'pattern' => array(
'desktop' => 'content-valign-$',
'tablet' => 'content-tablet-valign-$',
'mobile' => 'content-mobile-valign-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'top' => array(
'tooltip' => __( 'Top Align', 'kadence' ),
'icon' => 'aligntop',
),
'middle' => array(
'tooltip' => __( 'Middle Align', 'kadence' ),
'icon' => 'alignmiddle',
),
'bottom' => array(
'tooltip' => __( 'Bottom Align', 'kadence' ),
'icon' => 'alignbottom',
),
),
'responsive' => true,
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,116 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-tabs nav-tab-wrapper wp-clearfix">
<a href="#" class="nav-tab kadence-general-tab kadence-compontent-tabs-button nav-tab-active" data-tab="general">
<span><?php esc_html_e( 'General', 'kadence' ); ?></span>
</a>
</div>
<?php
$compontent_tabs = ob_get_clean();
$settings = array(
'footer_widget6_breaker' => array(
'control_type' => 'kadence_blank_control',
'section' => 'sidebar-widgets-footer6',
'settings' => false,
'priority' => 5,
'description' => $compontent_tabs,
),
'footer_widget6_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer6',
'label' => esc_html__( 'Content Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget6_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget6',
'pattern' => array(
'desktop' => 'content-align-$',
'tablet' => 'content-tablet-align-$',
'mobile' => 'content-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'footer_widget6_vertical_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'sidebar-widgets-footer6',
'label' => esc_html__( 'Content Vertical Align', 'kadence' ),
'priority' => 5,
'default' => kadence()->default( 'footer_widget6_vertical_align' ),
'context' => array(
array(
'setting' => '__current_tab',
'value' => 'general',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.footer-widget6',
'pattern' => array(
'desktop' => 'content-valign-$',
'tablet' => 'content-tablet-valign-$',
'mobile' => 'content-mobile-valign-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'top' => array(
'tooltip' => __( 'Top Align', 'kadence' ),
'icon' => 'aligntop',
),
'middle' => array(
'tooltip' => __( 'Middle Align', 'kadence' ),
'icon' => 'alignmiddle',
),
'bottom' => array(
'tooltip' => __( 'Bottom Align', 'kadence' ),
'icon' => 'alignbottom',
),
),
'responsive' => true,
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,769 @@
<?php
/**
* Header Main Row Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
Theme_Customizer::add_settings(
array(
'forum_archive_tabs' => array(
'control_type' => 'kadence_tab_control',
'section' => 'forum_archive',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'forum_archive',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'forum_archive_design',
),
'active' => 'general',
),
),
'forum_archive_tabs_design' => array(
'control_type' => 'kadence_tab_control',
'section' => 'forum_archive_design',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'forum_archive',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'forum_archive_design',
),
'active' => 'design',
),
),
'info_forum_archive_title' => array(
'control_type' => 'kadence_title_control',
'section' => 'forum_archive',
'priority' => 2,
'label' => esc_html__( 'Archive Title', 'kadence' ),
'settings' => false,
),
'info_forum_archive_title_design' => array(
'control_type' => 'kadence_title_control',
'section' => 'forum_archive_design',
'priority' => 2,
'label' => esc_html__( 'Archive Title', 'kadence' ),
'settings' => false,
),
'forum_archive_title' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'forum_archive',
'priority' => 3,
'default' => kadence()->default( 'forum_archive_title' ),
'label' => esc_html__( 'Show Archive Title?', 'kadence' ),
'transport' => 'refresh',
),
'forum_archive_title_layout' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_archive',
'label' => esc_html__( 'Archive Title Layout', 'kadence' ),
'transport' => 'refresh',
'priority' => 4,
'default' => kadence()->default( 'forum_archive_title_layout' ),
'context' => array(
array(
'setting' => 'forum_archive_title',
'operator' => '=',
'value' => true,
),
),
'input_attrs' => array(
'layout' => array(
'normal' => array(
'tooltip' => __( 'In Content', 'kadence' ),
'icon' => 'incontent',
),
'above' => array(
'tooltip' => __( 'Above Content', 'kadence' ),
'icon' => 'abovecontent',
),
),
'responsive' => false,
'class' => 'kadence-two-col',
),
),
'forum_archive_title_inner_layout' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_archive',
'priority' => 4,
'default' => kadence()->default( 'forum_archive_title_inner_layout' ),
'label' => esc_html__( 'Container Width', 'kadence' ),
'context' => array(
array(
'setting' => 'forum_archive_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_archive_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.forum-archive-hero-section',
'pattern' => 'entry-hero-layout-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'standard' => array(
'tooltip' => __( 'Background Fullwidth, Content Contained', 'kadence' ),
'name' => __( 'Standard', 'kadence' ),
'icon' => '',
),
'fullwidth' => array(
'tooltip' => __( 'Background & Content Fullwidth', 'kadence' ),
'name' => __( 'Fullwidth', 'kadence' ),
'icon' => '',
),
'contained' => array(
'tooltip' => __( 'Background & Content Contained', 'kadence' ),
'name' => __( 'Contained', 'kadence' ),
'icon' => '',
),
),
'responsive' => false,
),
),
'forum_archive_title_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_archive',
'label' => esc_html__( 'Course Title Align', 'kadence' ),
'priority' => 4,
'default' => kadence()->default( 'forum_archive_title_align' ),
'context' => array(
array(
'setting' => 'forum_archive_title',
'operator' => '=',
'value' => true,
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.forum-archive-title',
'pattern' => array(
'desktop' => 'title-align-$',
'tablet' => 'title-tablet-align-$',
'mobile' => 'title-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align Title', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align Title', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align Title', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'forum_archive_title_height' => array(
'control_type' => 'kadence_range_control',
'section' => 'forum_archive',
'priority' => 5,
'label' => esc_html__( 'Container Min Height', 'kadence' ),
'context' => array(
array(
'setting' => 'forum_archive_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_archive_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#inner-wrap .forum-archive-hero-section .entry-header',
'property' => 'min-height',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'forum_archive_title_height' ),
'input_attrs' => array(
'min' => array(
'px' => 10,
'em' => 1,
'rem' => 1,
'vh' => 2,
),
'max' => array(
'px' => 800,
'em' => 12,
'rem' => 12,
'vh' => 100,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vh' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vh' ),
),
),
'forum_archive_title_elements' => array(
'control_type' => 'kadence_sorter_control',
'section' => 'forum_archive',
'priority' => 6,
'default' => kadence()->default( 'forum_archive_title_elements' ),
'label' => esc_html__( 'Title Elements', 'kadence' ),
'transport' => 'refresh',
'settings' => array(
'elements' => 'forum_archive_title_elements',
'title' => 'forum_archive_title_element_title',
'breadcrumb' => 'forum_archive_title_element_breadcrumb',
'search' => 'forum_archive_title_element_search',
),
),
'forum_archive_title_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Title Color', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-archive-title h1',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_archive_title_search_width' => array(
'control_type' => 'kadence_range_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Search Bar Width', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-archive-title .bbp-search-form',
'property' => 'width',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'forum_archive_title_search_width' ),
'input_attrs' => array(
'min' => array(
'px' => 100,
'em' => 4,
'rem' => 4,
),
'max' => array(
'px' => 600,
'em' => 12,
'rem' => 12,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
'responsive' => false,
),
),
'forum_archive_title_search_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Input Text Colors', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_search_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-archive-title .bbp-search-form input.search-field, .forum-archive-title .bbp-search-form .kadence-search-icon-wrap',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.forum-archive-title .bbp-search-form input.search-field:focus, .forum-archive-title .bbp-search-form input.search-submit:hover ~ .kadence-search-icon-wrap',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Focus Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_archive_title_search_background' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Input Background', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_search_background' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-archive-title .bbp-search-form input.search-field',
'property' => 'background',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.forum-archive-title .bbp-search-form input.search-field:focus',
'property' => 'background',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Focus Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_archive_title_search_border' => array(
'control_type' => 'kadence_border_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_search_border' ),
'live_method' => array(
array(
'type' => 'css_border',
'selector' => '.forum-archive-title .bbp-search-form input.search-field',
'pattern' => '$',
'property' => 'border',
'pattern' => '$',
'key' => 'border',
),
),
'input_attrs' => array(
'responsive' => false,
'color' => false,
),
),
'forum_archive_title_search_border_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Input Border Color', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_search_border_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-archive-title .bbp-search-form input.search-field',
'property' => 'border-color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.forum-archive-title .bbp-search-form input.search-field:focus',
'property' => 'border-color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Focus Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_archive_title_search_typography' => array(
'control_type' => 'kadence_typography_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Font', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_search_typography' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.forum-archive-title .bbp-search-form input.search-field',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'forum_archive_title_search_typography',
'options' => 'no-color',
),
),
'forum_archive_title_search_margin' => array(
'control_type' => 'kadence_measure_control',
'section' => 'forum_archive_design',
'default' => kadence()->default( 'forum_archive_title_search_margin' ),
'label' => esc_html__( 'Margin', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-archive-title .bbp-search-form form',
'property' => 'margin',
'pattern' => '$',
'key' => 'measure',
),
),
'input_attrs' => array(
'responsive' => false,
),
),
'forum_archive_title_breadcrumb_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Breadcrumb Colors', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_breadcrumb_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-archive-title .kadence-breadcrumbs',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.forum-archive-title .kadence-breadcrumbs a:hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Link Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_archive_title_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Archive Title Background', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_background' ),
'context' => array(
array(
'setting' => 'forum_archive_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_archive_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => '#inner-wrap .forum-archive-hero-section .entry-hero-container-inner',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Course Archive Title Background', 'kadence' ),
),
),
'forum_archive_title_overlay_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Background Overlay Color', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_overlay_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-archive-hero-section .hero-section-overlay',
'property' => 'background',
'pattern' => '$',
'key' => 'color',
),
),
'context' => array(
array(
'setting' => 'forum_archive_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_archive_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Overlay Color', 'kadence' ),
'palette' => true,
),
),
'allowGradient' => true,
),
),
'forum_archive_title_border' => array(
'control_type' => 'kadence_borders_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'forum_archive_title_border' ),
'context' => array(
array(
'setting' => 'forum_archive_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_archive_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'settings' => array(
'border_top' => 'forum_archive_title_top_border',
'border_bottom' => 'forum_archive_title_bottom_border',
),
'live_method' => array(
'forum_archive_title_top_border' => array(
array(
'type' => 'css_border',
'selector' => '.forum-archive-hero-section .entry-hero-container-inner',
'pattern' => '$',
'property' => 'border-top',
'key' => 'border',
),
),
'forum_archive_title_bottom_border' => array(
array(
'type' => 'css_border',
'selector' => '.forum-archive-hero-section .entry-hero-container-inner',
'property' => 'border-bottom',
'pattern' => '$',
'key' => 'border',
),
),
),
),
'info_forum_archive_layout' => array(
'control_type' => 'kadence_title_control',
'section' => 'forum_archive',
'priority' => 10,
'label' => esc_html__( 'Forum Archive Layout', 'kadence' ),
'settings' => false,
),
'info_forum_archive_layout_design' => array(
'control_type' => 'kadence_title_control',
'section' => 'forum_archive_design',
'priority' => 10,
'label' => esc_html__( 'Forum Archive Layout', 'kadence' ),
'settings' => false,
),
'forum_archive_layout' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_archive',
'label' => esc_html__( 'Archive Layout', 'kadence' ),
'transport' => 'refresh',
'priority' => 10,
'default' => kadence()->default( 'forum_archive_layout' ),
'input_attrs' => array(
'layout' => array(
'normal' => array(
'tooltip' => __( 'Normal', 'kadence' ),
'icon' => 'normal',
),
'narrow' => array(
'tooltip' => __( 'Narrow', 'kadence' ),
'icon' => 'narrow',
),
'fullwidth' => array(
'tooltip' => __( 'Fullwidth', 'kadence' ),
'icon' => 'fullwidth',
),
'left' => array(
'tooltip' => __( 'Left Sidebar', 'kadence' ),
'icon' => 'leftsidebar',
),
'right' => array(
'tooltip' => __( 'Right Sidebar', 'kadence' ),
'icon' => 'rightsidebar',
),
),
'class' => 'kadence-three-col',
'responsive' => false,
),
),
'forum_archive_content_style' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_archive',
'label' => esc_html__( 'Content Style', 'kadence' ),
'priority' => 10,
'default' => kadence()->default( 'forum_archive_content_style' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => 'body.post-type-archive-forum',
'pattern' => 'content-style-$',
'key' => '',
),
array(
'type' => 'class',
'selector' => 'body.forum-archive',
'pattern' => 'content-style-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'boxed' => array(
'tooltip' => __( 'Boxed', 'kadence' ),
'icon' => 'boxed',
),
'unboxed' => array(
'tooltip' => __( 'Unboxed', 'kadence' ),
'icon' => 'narrow',
),
),
'responsive' => false,
'class' => 'kadence-two-col',
),
),
'forum_archive_vertical_padding' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_archive',
'label' => esc_html__( 'Content Vertical Padding', 'kadence' ),
'priority' => 10,
'default' => kadence()->default( 'forum_archive_vertical_padding' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => 'body.post-type-archive-forum, body.forum-archive',
'pattern' => 'content-vertical-padding-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'show' => array(
'name' => __( 'Enable', 'kadence' ),
),
'hide' => array(
'name' => __( 'Disable', 'kadence' ),
),
'top' => array(
'name' => __( 'Top Only', 'kadence' ),
),
'bottom' => array(
'name' => __( 'Bottom Only', 'kadence' ),
),
),
'responsive' => false,
'class' => 'kadence-two-grid',
),
),
'forum_archive_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Site Background', 'kadence' ),
'default' => kadence()->default( 'forum_archive_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => 'body.post-type-archive-forum, body.forum-archive',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Course Archive Background', 'kadence' ),
),
),
'forum_archive_content_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'forum_archive_design',
'label' => esc_html__( 'Content Background', 'kadence' ),
'default' => kadence()->default( 'forum_archive_content_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => 'body.post-type-archive-forum .content-bg, body.forum-archive .content-bg, body.forum-archive.content-style-unboxed .site, body.post-type-archive-forum.content-style-unboxed .site',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Archive Content Background', 'kadence' ),
),
),
)
);

View File

@@ -0,0 +1,880 @@
<?php
/**
* Product Layout Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
Theme_Customizer::add_settings(
array(
'forum_layout_tabs' => array(
'control_type' => 'kadence_tab_control',
'section' => 'forum_layout',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'forum_layout',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'forum_layout_design',
),
'active' => 'general',
),
),
'forum_layout_tabs_design' => array(
'control_type' => 'kadence_tab_control',
'section' => 'forum_layout_design',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'forum_layout',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'forum_layout_design',
),
'active' => 'design',
),
),
'info_forum_title' => array(
'control_type' => 'kadence_title_control',
'section' => 'forum_layout',
'priority' => 2,
'label' => esc_html__( 'Forum Title', 'kadence' ),
'settings' => false,
),
'info_forum_title_design' => array(
'control_type' => 'kadence_title_control',
'section' => 'forum_layout_design',
'priority' => 2,
'label' => esc_html__( 'Forum Title', 'kadence' ),
'settings' => false,
),
'forum_title' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'forum_layout',
'priority' => 3,
'default' => kadence()->default( 'forum_title' ),
'label' => esc_html__( 'Show Forum Title?', 'kadence' ),
'transport' => 'refresh',
),
'forum_title_layout' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_layout',
'label' => esc_html__( 'Forum Title Layout', 'kadence' ),
'transport' => 'refresh',
'priority' => 4,
'default' => kadence()->default( 'forum_title_layout' ),
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
),
'input_attrs' => array(
'layout' => array(
'normal' => array(
'tooltip' => __( 'In Content', 'kadence' ),
'icon' => 'incontent',
),
'above' => array(
'tooltip' => __( 'Above Content', 'kadence' ),
'icon' => 'abovecontent',
),
),
'responsive' => false,
'class' => 'kadence-two-col',
),
),
'forum_title_inner_layout' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_layout',
'priority' => 4,
'default' => kadence()->default( 'forum_title_inner_layout' ),
'label' => esc_html__( 'Title Container Width', 'kadence' ),
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.forum-hero-section',
'pattern' => 'entry-hero-layout-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'standard' => array(
'tooltip' => __( 'Background Fullwidth, Content Contained', 'kadence' ),
'name' => __( 'Standard', 'kadence' ),
'icon' => '',
),
'fullwidth' => array(
'tooltip' => __( 'Background & Content Fullwidth', 'kadence' ),
'name' => __( 'Fullwidth', 'kadence' ),
'icon' => '',
),
'contained' => array(
'tooltip' => __( 'Background & Content Contained', 'kadence' ),
'name' => __( 'Contained', 'kadence' ),
'icon' => '',
),
),
'responsive' => false,
),
),
'forum_title_align' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_layout',
'label' => esc_html__( 'Forum Title Align', 'kadence' ),
'priority' => 4,
'default' => kadence()->default( 'forum_title_align' ),
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.forum-title',
'pattern' => array(
'desktop' => 'title-align-$',
'tablet' => 'title-tablet-align-$',
'mobile' => 'title-mobile-align-$',
),
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'tooltip' => __( 'Left Align Title', 'kadence' ),
'dashicon' => 'editor-alignleft',
),
'center' => array(
'tooltip' => __( 'Center Align Title', 'kadence' ),
'dashicon' => 'editor-aligncenter',
),
'right' => array(
'tooltip' => __( 'Right Align Title', 'kadence' ),
'dashicon' => 'editor-alignright',
),
),
'responsive' => true,
),
),
'forum_title_height' => array(
'control_type' => 'kadence_range_control',
'section' => 'forum_layout',
'priority' => 5,
'label' => esc_html__( 'Title Container Min Height', 'kadence' ),
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#inner-wrap .forum-hero-section .entry-header',
'property' => 'min-height',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'forum_title_height' ),
'input_attrs' => array(
'min' => array(
'px' => 10,
'em' => 1,
'rem' => 1,
'vh' => 2,
),
'max' => array(
'px' => 800,
'em' => 12,
'rem' => 12,
'vh' => 100,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vh' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vh' ),
),
),
'forum_title_elements' => array(
'control_type' => 'kadence_sorter_control',
'section' => 'forum_layout',
'priority' => 6,
'default' => kadence()->default( 'forum_title_elements' ),
'label' => esc_html__( 'Title Elements', 'kadence' ),
'transport' => 'refresh',
'settings' => array(
'elements' => 'forum_title_elements',
'title' => 'forum_title_element_title',
'breadcrumb' => 'forum_title_element_breadcrumb',
'search' => 'forum_title_element_search',
'description' => 'forum_title_element_description',
),
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
),
'input_attrs' => array(
'group' => 'forum_title_element',
),
),
'forum_title_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Forum Title Font', 'kadence' ),
'default' => kadence()->default( 'forum_title_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.forum-title h1',
'property' => 'font',
'key' => 'typography',
),
),
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
),
'input_attrs' => array(
'id' => 'forum_title_font',
'headingInherit' => true,
),
),
'forum_title_search_width' => array(
'control_type' => 'kadence_range_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Search Bar Width', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-title .bbp-search-form',
'property' => 'width',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'forum_title_search_width' ),
'input_attrs' => array(
'min' => array(
'px' => 100,
'em' => 4,
'rem' => 4,
),
'max' => array(
'px' => 600,
'em' => 12,
'rem' => 12,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
'responsive' => false,
),
),
'forum_title_search_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Input Text Colors', 'kadence' ),
'default' => kadence()->default( 'forum_title_search_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-title .bbp-search-form input.search-field, .forum-title .bbp-search-form .kadence-search-icon-wrap',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.forum-title .bbp-search-form input.search-field:focus, .forum-title .bbp-search-form input.search-submit:hover ~ .kadence-search-icon-wrap',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Focus Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_title_search_background' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Input Background', 'kadence' ),
'default' => kadence()->default( 'forum_title_search_background' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-title .bbp-search-form input.search-field',
'property' => 'background',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.forum-title .bbp-search-form input.search-field:focus',
'property' => 'background',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Focus Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_title_search_border' => array(
'control_type' => 'kadence_border_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'forum_title_search_border' ),
'live_method' => array(
array(
'type' => 'css_border',
'selector' => '.forum-title .bbp-search-form input.search-field',
'pattern' => '$',
'property' => 'border',
'pattern' => '$',
'key' => 'border',
),
),
'input_attrs' => array(
'responsive' => false,
'color' => false,
),
),
'forum_title_search_border_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Input Border Color', 'kadence' ),
'default' => kadence()->default( 'forum_title_search_border_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-title .bbp-search-form input.search-field',
'property' => 'border-color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.forum-title .bbp-search-form input.search-field:focus',
'property' => 'border-color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Focus Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_title_search_typography' => array(
'control_type' => 'kadence_typography_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Font', 'kadence' ),
'default' => kadence()->default( 'forum_title_search_typography' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.forum-title .bbp-search-form input.search-field',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'forum_title_search_typography',
'options' => 'no-color',
),
),
'forum_title_search_margin' => array(
'control_type' => 'kadence_measure_control',
'section' => 'forum_layout_design',
'default' => kadence()->default( 'forum_title_search_margin' ),
'label' => esc_html__( 'Margin', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-title .bbp-search-form form',
'property' => 'margin',
'pattern' => '$',
'key' => 'measure',
),
),
'input_attrs' => array(
'responsive' => false,
),
),
'forum_title_breadcrumb_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Breadcrumb Colors', 'kadence' ),
'default' => kadence()->default( 'forum_title_breadcrumb_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-title .kadence-breadcrumbs',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.forum-title .kadence-breadcrumbs a:hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Link Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_title_breadcrumb_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Breadcrumb Font', 'kadence' ),
'default' => kadence()->default( 'forum_title_breadcrumb_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.forum-title .kadence-breadcrumbs',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'forum_title_breadcrumb_font',
'options' => 'no-color',
),
),
'forum_title_description_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Description Colors', 'kadence' ),
'default' => kadence()->default( 'forum_title_description_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-title .title-entry-description',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.forum-title .title-entry-description a:hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Link Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'forum_title_description_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Description Font', 'kadence' ),
'default' => kadence()->default( 'forum_title_description_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.forum-title .title-entry-description',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'forum_title_description_font',
'options' => 'no-color',
),
),
'forum_title_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Forum Above Area Background', 'kadence' ),
'default' => kadence()->default( 'forum_title_background' ),
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => '#inner-wrap .forum-hero-section .entry-hero-container-inner',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Forum Title Background', 'kadence' ),
),
),
'forum_title_featured_image' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'forum_layout_design',
'default' => kadence()->default( 'forum_title_featured_image' ),
'label' => esc_html__( 'Use Featured Image for Background?', 'kadence' ),
'transport' => 'refresh',
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_title_layout',
'operator' => '=',
'value' => 'above',
),
),
),
'forum_title_overlay_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Background Overlay Color', 'kadence' ),
'default' => kadence()->default( 'forum_title_overlay_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.forum-hero-section .hero-section-overlay',
'property' => 'background',
'pattern' => '$',
'key' => 'color',
),
),
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Overlay Color', 'kadence' ),
'palette' => true,
),
),
'allowGradient' => true,
),
),
'forum_title_border' => array(
'control_type' => 'kadence_borders_control',
'section' => 'forum_layout_design',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'forum_title_border' ),
'context' => array(
array(
'setting' => 'forum_title',
'operator' => '=',
'value' => true,
),
array(
'setting' => 'forum_title_layout',
'operator' => '=',
'value' => 'above',
),
),
'settings' => array(
'border_top' => 'forum_title_top_border',
'border_bottom' => 'forum_title_bottom_border',
),
'live_method' => array(
'forum_title_top_border' => array(
array(
'type' => 'css_border',
'selector' => '.forum-hero-section .entry-hero-container-inner',
'pattern' => '$',
'property' => 'border-top',
'key' => 'border',
),
),
'forum_title_bottom_border' => array(
array(
'type' => 'css_border',
'selector' => '.forum-hero-section .entry-hero-container-inner',
'property' => 'border-bottom',
'pattern' => '$',
'key' => 'border',
),
),
),
),
'info_forum_layout' => array(
'control_type' => 'kadence_title_control',
'section' => 'forum_layout',
'priority' => 10,
'label' => esc_html__( 'Forum Layout', 'kadence' ),
'settings' => false,
),
'info_forum_layout_design' => array(
'control_type' => 'kadence_title_control',
'section' => 'forum_layout_design',
'priority' => 10,
'label' => esc_html__( 'Forum Layout', 'kadence' ),
'settings' => false,
),
'forum_layout' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_layout',
'label' => esc_html__( 'Forum Layout', 'kadence' ),
'transport' => 'refresh',
'priority' => 10,
'default' => kadence()->default( 'forum_layout' ),
'input_attrs' => array(
'layout' => array(
'normal' => array(
'tooltip' => __( 'Normal', 'kadence' ),
'icon' => 'normal',
),
'narrow' => array(
'tooltip' => __( 'Narrow', 'kadence' ),
'icon' => 'narrow',
),
'fullwidth' => array(
'tooltip' => __( 'Fullwidth', 'kadence' ),
'icon' => 'fullwidth',
),
'left' => array(
'tooltip' => __( 'Left Sidebar', 'kadence' ),
'icon' => 'leftsidebar',
),
'right' => array(
'tooltip' => __( 'Right Sidebar', 'kadence' ),
'icon' => 'rightsidebar',
),
),
'responsive' => false,
'class' => 'kadence-three-col',
),
),
'forum_sidebar_id' => array(
'control_type' => 'kadence_select_control',
'section' => 'forum_layout',
'label' => esc_html__( 'Forum Default Sidebar', 'kadence' ),
'transport' => 'refresh',
'priority' => 10,
'default' => kadence()->default( 'forum_sidebar_id' ),
'input_attrs' => array(
'options' => kadence()->sidebar_options(),
),
),
'forum_content_style' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_layout',
'label' => esc_html__( 'Content Style', 'kadence' ),
'priority' => 10,
'default' => kadence()->default( 'forum_content_style' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => 'body.single-forum',
'pattern' => 'content-style-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'boxed' => array(
'tooltip' => __( 'Boxed', 'kadence' ),
'icon' => 'boxed',
),
'unboxed' => array(
'tooltip' => __( 'Unboxed', 'kadence' ),
'icon' => 'narrow',
),
),
'responsive' => false,
'class' => 'kadence-two-col',
),
),
'forum_vertical_padding' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'forum_layout',
'label' => esc_html__( 'Content Vertical Padding', 'kadence' ),
'priority' => 10,
'default' => kadence()->default( 'forum_vertical_padding' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => 'body.single-forum',
'pattern' => 'content-vertical-padding-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'show' => array(
'name' => __( 'Enable', 'kadence' ),
),
'hide' => array(
'name' => __( 'Disable', 'kadence' ),
),
'top' => array(
'name' => __( 'Top Only', 'kadence' ),
),
'bottom' => array(
'name' => __( 'Bottom Only', 'kadence' ),
),
),
'responsive' => false,
'class' => 'kadence-two-grid',
),
),
'forum_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'forum_layout_design',
'priority' => 20,
'label' => esc_html__( 'Site Background', 'kadence' ),
'default' => kadence()->default( 'forum_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => 'body.single-forum',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Forum Background', 'kadence' ),
),
),
'forum_content_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'forum_layout_design',
'priority' => 20,
'label' => esc_html__( 'Content Background', 'kadence' ),
'default' => kadence()->default( 'forum_content_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => 'body.single-forum .content-bg, body.single-forum.content-style-unboxed .site',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Forum Content Background', 'kadence' ),
),
),
)
);

View File

@@ -0,0 +1,54 @@
<?php
/**
* Breadcrumb Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
Theme_Customizer::add_settings(
array(
'breadcrumb_engine' => array(
'control_type' => 'kadence_select_control',
'section' => 'breadcrumbs',
'transport' => 'refresh',
'default' => kadence()->default( 'breadcrumb_engine' ),
'label' => esc_html__( 'Breadcrumb Engine', 'kadence' ),
'input_attrs' => array(
'options' => array(
'' => array(
'name' => __( 'Default', 'kadence' ),
),
'rankmath' => array(
'name' => __( 'RankMath (must have activated in plugin)', 'kadence' ),
),
'yoast' => array(
'name' => __( 'Yoast (must have activated in plugin)', 'kadence' ),
),
'seopress' => array(
'name' => __( 'SEOPress (must have activated in plugin)', 'kadence' ),
),
),
),
),
'breadcrumb_home_icon' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'breadcrumbs',
'default' => kadence()->default( 'breadcrumb_home_icon' ),
'label' => esc_html__( 'Use icon for home?', 'kadence' ),
'transport' => 'refresh',
'context' => array(
array(
'setting' => 'breadcrumb_engine',
'operator' => '=',
'value' => '',
),
),
),
)
);

View File

@@ -0,0 +1,249 @@
<?php
/**
* Primary Button Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
Theme_Customizer::add_settings(
array(
'buttons_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'general_buttons',
'label' => esc_html__( 'Text Colors', 'kadence' ),
'default' => kadence()->default( 'buttons_color' ),
'live_method' => array(
array(
'type' => 'global',
'selector' => '--global-palette-btn',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'global',
'selector' => '--global-palette-btn-hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'buttons_background' => array(
'control_type' => 'kadence_color_control',
'section' => 'general_buttons',
'label' => esc_html__( 'Background Colors', 'kadence' ),
'default' => kadence()->default( 'buttons_background' ),
'live_method' => array(
array(
'type' => 'global',
'selector' => '--global-palette-btn-bg',
'property' => 'background',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'global',
'selector' => '--global-palette-btn-bg-hover',
'property' => 'background',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
'allowGradient' => true,
),
),
'buttons_border_colors' => array(
'control_type' => 'kadence_color_control',
'section' => 'general_buttons',
'label' => esc_html__( 'Border Colors', 'kadence' ),
'default' => kadence()->default( 'buttons_border' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => 'button, .button, .wp-block-button__link, input[type="button"], input[type="reset"], input[type="submit"]',
'property' => 'border-color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => 'button:hover, .button:hover, .wp-block-button__link:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover',
'property' => 'border-color',
'pattern' => '$',
'key' => 'hover',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'buttons_border' => array(
'control_type' => 'kadence_border_control',
'section' => 'general_buttons',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'buttons_border' ),
'live_method' => array(
array(
'type' => 'css_border',
'selector' => 'button, .button, .wp-block-button__link, input[type="button"], input[type="reset"], input[type="submit"]',
'property' => 'border',
'pattern' => '$',
'key' => 'border',
),
),
'input_attrs' => array(
'responsive' => true,
'color' => false,
),
),
'buttons_border_radius' => array(
'control_type' => 'kadence_range_control',
'section' => 'general_buttons',
'label' => esc_html__( 'Border Radius', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => 'button, .button, .wp-block-button__link, input[type="button"], input[type="reset"], input[type="submit"]',
'property' => 'border-radius',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'buttons_border_radius' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
'%' => 0,
),
'max' => array(
'px' => 100,
'em' => 12,
'rem' => 12,
'%' => 100,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'%' => 1,
),
'units' => array( 'px', 'em', 'rem', '%' ),
'responsive' => true,
),
),
'buttons_typography' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_buttons',
'label' => esc_html__( 'Font', 'kadence' ),
'default' => kadence()->default( 'buttons_typography' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => 'button, .button, .wp-block-button__link, input[type="button"], input[type="reset"], input[type="submit"]',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'buttons_typography',
'options' => 'no-color',
),
),
'buttons_padding' => array(
'control_type' => 'kadence_measure_control',
'section' => 'general_buttons',
'priority' => 10,
'default' => kadence()->default( 'buttons_padding' ),
'label' => esc_html__( 'Padding', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => 'button, .button, .wp-block-button__link, input[type="button"], input[type="reset"], input[type="submit"]',
'property' => 'padding',
'pattern' => '$',
'key' => 'measure',
),
),
'input_attrs' => array(
'responsive' => true,
),
),
'buttons_shadow' => array(
'control_type' => 'kadence_shadow_control',
'section' => 'general_buttons',
'priority' => 20,
'label' => esc_html__( 'Button Shadow', 'kadence' ),
'live_method' => array(
array(
'type' => 'css_boxshadow',
'selector' => 'button, .button, .wp-block-button__link, input[type="button"], input[type="reset"], input[type="submit"]',
'property' => 'box-shadow',
'pattern' => '$',
'key' => '',
),
),
'default' => kadence()->default( 'buttons_shadow' ),
),
'buttons_shadow_hover' => array(
'control_type' => 'kadence_shadow_control',
'section' => 'general_buttons',
'priority' => 20,
'label' => esc_html__( 'Button Hover State Shadow', 'kadence' ),
'live_method' => array(
array(
'type' => 'css_boxshadow',
'selector' => 'button:hover, .button:hover, .wp-block-button__link:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover',
'property' => 'box-shadow',
'pattern' => '$',
'key' => '',
),
),
'default' => kadence()->default( 'buttons_shadow_hover' ),
),
)
);

View File

@@ -0,0 +1,123 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
Theme_Customizer::add_settings(
array(
'info_background' => array(
'control_type' => 'kadence_title_control',
'section' => 'general_colors',
'label' => esc_html__( 'Backgrounds', 'kadence' ),
'settings' => false,
),
'site_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'general_colors',
'label' => esc_html__( 'Site Background', 'kadence' ),
'default' => kadence()->default( 'site_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => 'body',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Site Background', 'kadence' ),
),
),
'content_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'general_colors',
'label' => esc_html__( 'Content Background', 'kadence' ),
'default' => kadence()->default( 'content_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => '.content-bg, body.content-style-unboxed .site',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Content Background', 'kadence' ),
),
),
'above_title_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'general_colors',
'label' => esc_html__( 'Title Above Content Background', 'kadence' ),
'default' => kadence()->default( 'above_title_background' ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => '.wp-site-blocks .entry-hero-container-inner',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Title Above Content Background', 'kadence' ),
),
),
'above_title_overlay_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'general_colors',
'label' => esc_html__( 'Title Above Content Overlay Color', 'kadence' ),
'default' => kadence()->default( 'above_title_overlay_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.entry-hero-container-inner .hero-section-overlay',
'property' => 'background',
'pattern' => '$',
'key' => 'color',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Overlay Color', 'kadence' ),
'palette' => true,
),
),
'allowGradient' => true,
),
),
'info_links' => array(
'control_type' => 'kadence_title_control',
'section' => 'general_colors',
'label' => esc_html__( 'Content Links', 'kadence' ),
'settings' => false,
),
'link_color' => array(
'control_type' => 'kadence_color_link_control',
'section' => 'general_colors',
'transport' => 'refresh',
'label' => esc_html__( 'Links Color', 'kadence' ),
'default' => kadence()->default( 'link_color' ),
'live_method' => array(
array(
'type' => 'css_link',
'selector' => 'a',
'property' => 'color',
'pattern' => 'link-style-$',
'key' => 'base',
),
),
),
)
);

View File

@@ -0,0 +1,32 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
Theme_Customizer::add_settings(
array(
'comment_form_before_list' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_comments',
'default' => kadence()->default( 'comment_form_before_list' ),
'label' => esc_html__( 'Move Comments input above comment list.', 'kadence' ),
'transport' => 'refresh',
),
'comment_form_remove_web' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_comments',
'default' => kadence()->default( 'comment_form_remove_web' ),
'label' => esc_html__( 'Remove Comments Website field.', 'kadence' ),
'transport' => 'refresh',
),
)
);

View File

@@ -0,0 +1,54 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
Theme_Customizer::add_settings(
array(
'image_border_radius' => array(
'control_type' => 'kadence_range_control',
'section' => 'general_image',
'label' => esc_html__( 'Border Radius', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.entry-content :where(.wp-block-image) img, .entry-content :where(.wp-block-kadence-image) img',
'property' => 'border-radius',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'image_border_radius' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
'%' => 0,
),
'max' => array(
'px' => 100,
'em' => 12,
'rem' => 12,
'%' => 100,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'%' => 1,
),
'units' => array( 'px', 'em', 'rem', '%' ),
'responsive' => true,
),
),
)
);

View File

@@ -0,0 +1,341 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
$settings = array(
'content_width' => array(
'control_type' => 'kadence_range_control',
'section' => 'general_layout',
'priority' => 20,
'label' => esc_html__( 'Content Max Width', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.site-container, .site-header-row-layout-contained',
'property' => 'max-width',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'content_width' ),
'input_attrs' => array(
'min' => array(
'px' => 400,
'em' => 30,
'rem' => 30,
),
'max' => array(
'px' => 2000,
'em' => 140,
'rem' => 140,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
'responsive' => false,
),
),
'content_edge_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'general_layout',
'priority' => 20,
'label' => esc_html__( 'Content Left/Right Edge Spacing', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.site-container, .site-header-row-layout-contained, .site-footer-row-layout-contained, .entry-hero-layout-contained, .alignfull>.wp-block-cover__inner-container, .alignwide>.wp-block-cover__inner-container',
'property' => 'padding-left',
'pattern' => '$',
'key' => 'size',
),
array(
'type' => 'css',
'selector' => '.site-container, .site-header-row-layout-contained, .site-footer-row-layout-contained, .entry-hero-layout-contained, .alignfull>.wp-block-cover__inner-container, .alignwide>.wp-block-cover__inner-container',
'property' => 'padding-right',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'content_edge_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
'vw' => 0,
),
'max' => array(
'px' => 200,
'em' => 12,
'rem' => 12,
'vw' => 40,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vw' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vh' ),
'responsive' => true,
),
),
'content_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'general_layout',
'priority' => 20,
'label' => esc_html__( 'Content Top and Bottom Spacing', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.content-area',
'property' => 'margin-top',
'pattern' => '$',
'key' => 'size',
),
array(
'type' => 'css',
'selector' => '.content-area',
'property' => 'margin-bottom',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'content_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
'vw' => 0,
),
'max' => array(
'px' => 200,
'em' => 12,
'rem' => 12,
'vw' => 40,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vw' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vh' ),
'responsive' => true,
),
),
'content_narrow_width' => array(
'control_type' => 'kadence_range_control',
'section' => 'general_layout',
'priority' => 20,
'label' => esc_html__( 'Narrow Layout Content Max Width', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.content-width-narrow .content-container.site-container',
'property' => 'max-width',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'content_narrow_width' ),
'input_attrs' => array(
'min' => array(
'px' => 300,
'em' => 20,
'rem' => 20,
'vw' => 20,
),
'max' => array(
'px' => 2000,
'em' => 140,
'rem' => 140,
'vw' => 100,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vw' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vw' ),
'responsive' => false,
),
),
'info_general_single_boxed' => array(
'control_type' => 'kadence_title_control',
'section' => 'general_layout',
'priority' => 21,
'label' => esc_html__( 'Single Post Boxed', 'kadence' ),
'settings' => false,
),
'boxed_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'general_layout',
'priority' => 22,
'label' => esc_html__( 'Single Post Boxed Spacing', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.entry-content-wrap',
'property' => 'padding',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'boxed_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 12,
'rem' => 12,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
'responsive' => true,
),
),
'boxed_shadow' => array(
'control_type' => 'kadence_shadow_control',
'section' => 'general_layout',
'priority' => 22,
'label' => esc_html__( 'Single Post Boxed Shadow', 'kadence' ),
'live_method' => array(
array(
'type' => 'css_boxshadow',
'selector' => '.entry.single-entry',
'property' => 'box-shadow',
'pattern' => '$',
'key' => '',
),
),
'default' => kadence()->default( 'boxed_shadow' ),
),
'boxed_border_radius' => array(
'control_type' => 'kadence_measure_control',
'section' => 'general_layout',
'priority' => 22,
'label' => esc_html__( 'Single Post Boxed Border Radius', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.entry.single-entry',
'property' => 'border-radius',
'pattern' => '$',
'key' => 'measure',
),
),
'default' => kadence()->default( 'boxed_border_radius' ),
'input_attrs' => array(
'responsive' => false,
),
),
'info_general_archive_boxed' => array(
'control_type' => 'kadence_title_control',
'section' => 'general_layout',
'priority' => 22,
'label' => esc_html__( 'Archive Grid Boxed', 'kadence' ),
'settings' => false,
),
'boxed_grid_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'general_layout',
'priority' => 22,
'label' => esc_html__( 'Archive Grid Boxed Spacing', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.loop-entry .entry-content-wrap',
'property' => 'padding',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'boxed_grid_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 12,
'rem' => 12,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
'responsive' => true,
),
),
'boxed_grid_shadow' => array(
'control_type' => 'kadence_shadow_control',
'section' => 'general_layout',
'priority' => 22,
'label' => esc_html__( 'Archive Grid Boxed Shadow', 'kadence' ),
'live_method' => array(
array(
'type' => 'css_boxshadow',
'selector' => '.entry.loop-entry',
'property' => 'box-shadow',
'pattern' => '$',
'key' => '',
),
),
'default' => kadence()->default( 'boxed_grid_shadow' ),
),
'boxed_grid_border_radius' => array(
'control_type' => 'kadence_measure_control',
'section' => 'general_layout',
'priority' => 22,
'label' => esc_html__( 'Archive Grid Boxed Border Radius', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.entry.loop-entry',
'property' => 'border-radius',
'pattern' => '$',
'key' => 'measure',
),
array(
'type' => 'css',
'selector' => '.entry.loop-entry:after',
'property' => 'border-radius',
'pattern' => '$',
'key' => 'measure',
),
),
'default' => kadence()->default( 'boxed_grid_border_radius' ),
'input_attrs' => array(
'responsive' => false,
),
),
);
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,105 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-custom fonts-flush-button wp-clearfix">
<span class="customize-control-title">
<?php esc_html_e( 'Flush Local Fonts Cache', 'kadence' ); ?>
</span>
<span class="description customize-control-description">
<?php esc_html_e( 'Click the button to reset the local fonts cache', 'kadence' ); ?>
</span>
<input type="button" class="button kadence-flush-local-fonts-button" name="kadence-flush-local-fonts-button" value="<?php esc_attr_e( 'Flush Local Font Files', 'kadence' ); ?>" />
</div>
<?php
$kadence_flush_button = ob_get_clean();
Theme_Customizer::add_settings(
array(
'microdata' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_performance',
'default' => kadence()->default( 'microdata' ),
'label' => esc_html__( 'Enable Microdata Schema', 'kadence' ),
),
'theme_json_mode' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_performance',
'default' => kadence()->default( 'theme_json_mode' ),
'label' => esc_html__( 'Enable Optimized Group Block', 'kadence' ),
),
'enable_scroll_to_id' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_performance',
'default' => kadence()->default( 'enable_scroll_to_id' ),
'label' => esc_html__( 'Enable Scroll To ID', 'kadence' ),
),
'lightbox' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_performance',
'default' => kadence()->default( 'lightbox' ),
'label' => esc_html__( 'Enable Lightbox', 'kadence' ),
),
'load_fonts_local' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_performance',
'default' => kadence()->default( 'load_fonts_local' ),
'label' => esc_html__( 'Load Google Fonts Locally', 'kadence' ),
),
'preload_fonts_local' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_performance',
'default' => kadence()->default( 'preload_fonts_local' ),
'label' => esc_html__( 'Preload Local Fonts', 'kadence' ),
'context' => array(
array(
'setting' => 'load_fonts_local',
'operator' => '==',
'value' => true,
),
),
),
'load_fonts_local_flush' => array(
'control_type' => 'kadence_blank_control',
'section' => 'general_performance',
'settings' => false,
'description' => $kadence_flush_button,
'context' => array(
array(
'setting' => 'load_fonts_local',
'operator' => '==',
'value' => true,
),
),
),
'enable_preload' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_performance',
'default' => kadence()->default( 'enable_preload' ),
'label' => esc_html__( 'Enable CSS Preload', 'kadence' ),
),
'disable_sitemap' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_performance',
'default' => kadence()->default( 'disable_sitemap' ),
'label' => esc_html__( 'Disable Default Sitemap', 'kadence' ),
),
)
);

View File

@@ -0,0 +1,532 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
Theme_Customizer::add_settings(
array(
'scroll_up_tabs' => array(
'control_type' => 'kadence_tab_control',
'section' => 'scroll_up',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'scroll_up',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'scroll_up_design',
),
'active' => 'general',
),
),
'scroll_up_tabs_design' => array(
'control_type' => 'kadence_tab_control',
'section' => 'scroll_up_design',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'scroll_up',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'scroll_up_design',
),
'active' => 'design',
),
),
'scroll_up' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'scroll_up',
'default' => kadence()->default( 'scroll_up' ),
'label' => esc_html__( 'Enable Scroll To Top', 'kadence' ),
'transport' => 'refresh',
),
'scroll_up_icon' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'scroll_up',
'priority' => 10,
'default' => kadence()->default( 'scroll_up_icon' ),
'label' => esc_html__( 'Scroll Up Icon', 'kadence' ),
'partial' => array(
'selector' => '.scroll-up-wrap',
'container_inclusive' => true,
'render_callback' => 'Kadence\scroll_up',
),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'input_attrs' => array(
'layout' => array(
'arrow-up' => array(
'icon' => 'arrowUp',
),
'arrow-up2' => array(
'icon' => 'arrowUp2',
),
'chevron-up' => array(
'icon' => 'chevronUp',
),
'chevron-up2' => array(
'icon' => 'chevronUp2',
),
),
'responsive' => false,
),
),
'scroll_up_icon_size' => array(
'control_type' => 'kadence_range_control',
'section' => 'scroll_up',
'label' => esc_html__( 'Icon Size', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader, #kt-scroll-up',
'property' => 'font-size',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'scroll_up_icon_size' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 100,
'em' => 12,
'rem' => 12,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
'responsive' => true,
),
),
'scroll_up_side' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'scroll_up',
'default' => kadence()->default( 'scroll_up_side' ),
'label' => esc_html__( 'Align', 'kadence' ),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.scroll-up-wrap',
'pattern' => 'scroll-up-side-$',
'key' => '',
),
),
'input_attrs' => array(
'layout' => array(
'left' => array(
'name' => __( 'Left', 'kadence' ),
'icon' => '',
),
'right' => array(
'name' => __( 'Right', 'kadence' ),
'icon' => '',
),
),
'responsive' => false,
),
),
'scroll_up_side_offset' => array(
'control_type' => 'kadence_range_control',
'section' => 'scroll_up',
'label' => esc_html__( 'Side Offset', 'kadence' ),
'default' => kadence()->default( 'scroll_up_side_offset' ),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader.scroll-up-side-right, #kt-scroll-up.scroll-up-side-right',
'pattern' => '$',
'property' => 'right',
'key' => 'size',
),
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader.scroll-up-side-left, #kt-scroll-up.scroll-up-side-left',
'pattern' => '$',
'property' => 'left',
'key' => 'size',
),
),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
'vw' => 0,
),
'max' => array(
'px' => 600,
'em' => 20,
'rem' => 20,
'vw' => 100,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vw' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vw' ),
'responsive' => true,
),
),
'scroll_up_bottom_offset' => array(
'control_type' => 'kadence_range_control',
'section' => 'scroll_up',
'label' => esc_html__( 'Bottom Offset', 'kadence' ),
'default' => kadence()->default( 'scroll_up_bottom_offset' ),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader, #kt-scroll-up',
'pattern' => '$',
'property' => 'bottom',
'key' => 'size',
),
),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
'vh' => 0,
),
'max' => array(
'px' => 600,
'em' => 20,
'rem' => 20,
'vh' => 100,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'vh' => 1,
),
'units' => array( 'px', 'em', 'rem', 'vh' ),
'responsive' => true,
),
),
'scroll_up_visiblity' => array(
'control_type' => 'kadence_check_icon_control',
'section' => 'scroll_up',
'default' => kadence()->default( 'scroll_up_visiblity' ),
'label' => esc_html__( 'Visibility', 'kadence' ),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'partial' => array(
'selector' => '.scroll-up-wrap',
'container_inclusive' => true,
'render_callback' => 'Kadence\scroll_up',
),
'input_attrs' => array(
'options' => array(
'desktop' => array(
'name' => __( 'Desktop', 'kadence' ),
'icon' => 'desktop',
),
'tablet' => array(
'name' => __( 'Tablet', 'kadence' ),
'icon' => 'tablet',
),
'mobile' => array(
'name' => __( 'Mobile', 'kadence' ),
'icon' => 'smartphone',
),
),
),
),
'scroll_up_style' => array(
'control_type' => 'kadence_radio_icon_control',
'section' => 'scroll_up_design',
'default' => kadence()->default( 'scroll_up_style' ),
'label' => esc_html__( 'Scroll Button Style', 'kadence' ),
'live_method' => array(
array(
'type' => 'class',
'selector' => '#kt-scroll-up-reader, #kt-scroll-up',
'pattern' => 'scroll-up-style-$',
'key' => '',
),
),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'input_attrs' => array(
'layout' => array(
'filled' => array(
'name' => __( 'Filled', 'kadence' ),
),
'outline' => array(
'name' => __( 'Outline', 'kadence' ),
),
'secondary' => array(
'name' => __( 'Secondary', 'kadence' ),
),
),
'responsive' => false,
),
),
'scroll_up_color' => array(
'control_type' => 'kadence_color_control',
'section' => 'scroll_up_design',
'label' => esc_html__( 'Colors', 'kadence' ),
'default' => kadence()->default( 'scroll_up_color' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader, #kt-scroll-up',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader:hover, #kt-scroll-up:hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'scroll_up_background' => array(
'control_type' => 'kadence_color_control',
'section' => 'scroll_up_design',
'label' => esc_html__( 'Background Colors', 'kadence' ),
'default' => kadence()->default( 'scroll_up_background' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader, #kt-scroll-up',
'property' => 'background',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader:hover, #kt-scroll-up:hover',
'property' => 'background',
'pattern' => '$',
'key' => 'hover',
),
),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
array(
'setting' => 'scroll_up_style',
'operator' => '=',
'value' => 'filled',
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'scroll_up_border_colors' => array(
'control_type' => 'kadence_color_control',
'section' => 'scroll_up_design',
'label' => esc_html__( 'Border Colors', 'kadence' ),
'default' => kadence()->default( 'scroll_up_border' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader, #kt-scroll-up',
'property' => 'border-color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader:hover, #kt-scroll-up:hover',
'property' => 'border-color',
'pattern' => '$',
'key' => 'hover',
),
),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'scroll_up_border' => array(
'control_type' => 'kadence_border_control',
'section' => 'scroll_up_design',
'label' => esc_html__( 'Border', 'kadence' ),
'default' => kadence()->default( 'scroll_up_border' ),
'live_method' => array(
array(
'type' => 'css_border',
'selector' => '#kt-scroll-up-reader, #kt-scroll-up',
'property' => 'border',
'pattern' => '$',
'key' => 'border',
),
),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'input_attrs' => array(
'responsive' => false,
'color' => false,
),
),
'scroll_up_radius' => array(
'control_type' => 'kadence_measure_control',
'section' => 'scroll_up_design',
'priority' => 10,
'default' => kadence()->default( 'scroll_up_radius' ),
'label' => esc_html__( 'Border Radius', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader, #kt-scroll-up',
'property' => 'border-radius',
'pattern' => '$',
'key' => 'measure',
),
),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'input_attrs' => array(
'responsive' => false,
),
),
'scroll_up_padding' => array(
'control_type' => 'kadence_measure_control',
'section' => 'scroll_up_design',
'priority' => 10,
'default' => kadence()->default( 'scroll_up_padding' ),
'label' => esc_html__( 'Scroll Button Padding', 'kadence' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '#kt-scroll-up-reader, #kt-scroll-up',
'property' => 'padding',
'pattern' => '$',
'key' => 'measure',
),
),
'context' => array(
array(
'setting' => 'scroll_up',
'operator' => '==',
'value' => true,
),
),
'input_attrs' => array(
'responsive' => true,
),
),
)
);

View File

@@ -0,0 +1,379 @@
<?php
/**
* Sidebar Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-description">
<p style="margin:0"><?php echo esc_html__( 'Title and Content settings affect legacy widgets. For block editor widgets use settings in the editor.', 'kadence' ); ?></p>
</div>
<?php
$component_description = ob_get_clean();
Theme_Customizer::add_settings(
array(
'sidebar_tabs' => array(
'control_type' => 'kadence_tab_control',
'section' => 'sidebar',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'sidebar',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'sidebar_design',
),
'active' => 'general',
),
),
'sidebar_tabs_design' => array(
'control_type' => 'kadence_tab_control',
'section' => 'sidebar_design',
'settings' => false,
'priority' => 1,
'input_attrs' => array(
'general' => array(
'label' => __( 'General', 'kadence' ),
'target' => 'sidebar',
),
'design' => array(
'label' => __( 'Design', 'kadence' ),
'target' => 'sidebar_design',
),
'active' => 'design',
),
),
'sidebar_width' => array(
'control_type' => 'kadence_range_control',
'section' => 'sidebar',
'priority' => 10,
'label' => esc_html__( 'Sidebar Width', 'kadence' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'general',
// ),
// ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.has-sidebar:not(.has-left-sidebar) .content-container',
'property' => 'grid-template-columns',
'pattern' => '1fr $',
'key' => 'size',
),
array(
'type' => 'css',
'selector' => '.has-sidebar.has-left-sidebar .content-container',
'property' => 'grid-template-columns',
'pattern' => '$ 1fr',
'key' => 'size',
),
),
'default' => kadence()->default( 'sidebar_width' ),
'input_attrs' => array(
'min' => array(
'px' => 100,
'em' => 8,
'rem' => 8,
'%' => 5,
),
'max' => array(
'px' => 600,
'em' => 30,
'rem' => 30,
'%' => 60,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
'%' => 1,
),
'units' => array( 'px', 'em', 'rem', '%' ),
'responsive' => false,
),
),
'sidebar_widget_spacing' => array(
'control_type' => 'kadence_range_control',
'section' => 'sidebar',
'priority' => 10,
'label' => esc_html__( 'Widget Spacing', 'kadence' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'general',
// ),
// ),
'live_method' => array(
array(
'type' => 'css',
'property' => 'margin-bottom',
'selector' => '.primary-sidebar.widget-area .widget',
'pattern' => '$',
'key' => 'size',
),
),
'default' => kadence()->default( 'sidebar_widget_spacing' ),
'input_attrs' => array(
'min' => array(
'px' => 0,
'em' => 0,
'rem' => 0,
),
'max' => array(
'px' => 200,
'em' => 8,
'rem' => 8,
),
'step' => array(
'px' => 1,
'em' => 0.01,
'rem' => 0.01,
),
'units' => array( 'px', 'em', 'rem' ),
),
),
'sidebar_widget_settings' => array(
'control_type' => 'kadence_blank_control',
'section' => 'sidebar_design',
'settings' => false,
'priority' => 1,
'description' => $component_description,
),
'sidebar_widget_title' => array(
'control_type' => 'kadence_typography_control',
'section' => 'sidebar_design',
'label' => esc_html__( 'Widget Titles', 'kadence' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
'default' => kadence()->default( 'sidebar_widget_title' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.primary-sidebar.widget-area .widget-title',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'sidebar_widget_title',
),
),
'sidebar_widget_content' => array(
'control_type' => 'kadence_typography_control',
'section' => 'sidebar_design',
'label' => esc_html__( 'Widget Content', 'kadence' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
'default' => kadence()->default( 'sidebar_widget_content' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.primary-sidebar.widget-area .widget',
'pattern' => array(
'desktop' => '$',
'tablet' => '$',
'mobile' => '$',
),
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'sidebar_widget_content',
),
),
'sidebar_link_style' => array(
'control_type' => 'kadence_select_control',
'section' => 'sidebar_design',
'default' => kadence()->default( 'sidebar_link_style' ),
'label' => esc_html__( 'Link Style', 'kadence' ),
'input_attrs' => array(
'options' => array(
'normal' => array(
'name' => __( 'Underline on Hover', 'kadence' ),
),
'underline' => array(
'name' => __( 'Underline', 'kadence' ),
),
'plain' => array(
'name' => __( 'No Underline', 'kadence' ),
),
),
),
'live_method' => array(
array(
'type' => 'class',
'selector' => '.primary-sidebar',
'pattern' => 'sidebar-link-style-$',
'key' => '',
),
),
),
'sidebar_link_colors' => array(
'control_type' => 'kadence_color_control',
'section' => 'sidebar_design',
'label' => esc_html__( 'Link Colors', 'kadence' ),
'default' => kadence()->default( 'sidebar_link_colors' ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.primary-sidebar.widget-area .sidebar-inner-wrap a',
'property' => 'color',
'pattern' => '$',
'key' => 'color',
),
array(
'type' => 'css',
'selector' => '.primary-sidebar.widget-area .sidebar-inner-wrap a:hover',
'property' => 'color',
'pattern' => '$',
'key' => 'hover',
),
),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
'input_attrs' => array(
'colors' => array(
'color' => array(
'tooltip' => __( 'Initial Color', 'kadence' ),
'palette' => true,
),
'hover' => array(
'tooltip' => __( 'Hover Color', 'kadence' ),
'palette' => true,
),
),
),
),
'sidebar_background' => array(
'control_type' => 'kadence_background_control',
'section' => 'sidebar_design',
'label' => esc_html__( 'Sidebar Background', 'kadence' ),
'default' => kadence()->default( 'sidebar_background' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
'live_method' => array(
array(
'type' => 'css_background',
'selector' => '.primary-sidebar.widget-area',
'property' => 'background',
'pattern' => '$',
'key' => 'base',
),
),
'input_attrs' => array(
'tooltip' => __( 'Sidebar Background', 'kadence' ),
),
),
'sidebar_divider_border' => array(
'control_type' => 'kadence_border_control',
'section' => 'sidebar_design',
'label' => esc_html__( 'Sidebar Divider Border', 'kadence' ),
'default' => kadence()->default( 'sidebar_divider_border' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
'live_method' => array(
array(
'type' => 'css_border',
'selector' => '.has-sidebar.has-left-sidebar .primary-sidebar.widget-area',
'pattern' => '$',
'property' => 'border-right',
'pattern' => '$',
'key' => 'border',
),
array(
'type' => 'css_border',
'selector' => '.has-sidebar:not(.has-left-sidebar) .primary-sidebar.widget-area',
'pattern' => '$',
'property' => 'border-left',
'pattern' => '$',
'key' => 'border',
),
),
),
'sidebar_padding' => array(
'control_type' => 'kadence_measure_control',
'section' => 'sidebar_design',
'priority' => 10,
'default' => kadence()->default( 'sidebar_padding' ),
'label' => esc_html__( 'Sidebar Padding', 'kadence' ),
// 'context' => array(
// array(
// 'setting' => '__current_tab',
// 'value' => 'design',
// ),
// ),
'live_method' => array(
array(
'type' => 'css',
'selector' => '.primary-sidebar.widget-area',
'property' => 'padding',
'pattern' => '$',
'key' => 'measure',
),
),
'input_attrs' => array(
'responsive' => true,
),
),
'sidebar_sticky' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'sidebar',
'default' => kadence()->default( 'sidebar_sticky' ),
'label' => esc_html__( 'Enable Sticky Sidebar', 'kadence' ),
'transport' => 'refresh',
),
'sidebar_sticky_last_widget' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'sidebar',
'default' => kadence()->default( 'sidebar_sticky_last_widget' ),
'label' => esc_html__( 'Only Stick Last Widget', 'kadence' ),
'transport' => 'refresh',
'context' => array(
array(
'setting' => 'sidebar_sticky',
'value' => true,
),
),
),
)
);

View File

@@ -0,0 +1,448 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
ob_start(); ?>
<div class="kadence-compontent-description">
<h2><?php echo esc_html__( 'Social Network Links', 'kadence' ); ?></h2>
</div>
<?php
$compontent_description = ob_get_clean();
$settings = [
'social_settings' => [
'control_type' => 'kadence_blank_control',
'section' => 'general_social',
'settings' => false,
'priority' => 1,
'description' => $compontent_description,
],
'social_links_open_new_tab' => [
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_social',
'default' => kadence()->default( 'social_links_open_new_tab' ),
'label' => esc_html__( 'Open Social Links in New Tab', 'kadence' ),
],
'facebook_link' => [
'control_type' => 'kadence_text_control',
'sanitize' => 'esc_url_raw',
'section' => 'general_social',
'default' => kadence()->default( 'facebook_link' ),
'label' => esc_html__( 'Facebook', 'kadence' ),
],
'twitter_link' => [
'control_type' => 'kadence_text_control',
'sanitize' => 'esc_url_raw',
'section' => 'general_social',
'default' => kadence()->default( 'twitter_link' ),
'label' => esc_html__( 'X formerly Twitter', 'kadence' ),
],
'youtube_link' => [
'control_type' => 'kadence_text_control',
'sanitize' => 'esc_url_raw',
'section' => 'general_social',
'default' => kadence()->default( 'youtube_link' ),
'label' => esc_html__( 'YouTube', 'kadence' ),
],
'instagram_link' => [
'control_type' => 'kadence_text_control',
'sanitize' => 'esc_url_raw',
'section' => 'general_social',
'default' => kadence()->default( 'instagram_link' ),
'label' => esc_html__( 'Instagram', 'kadence' ),
],
'pinterest_link' => [
'control_type' => 'kadence_text_control',
'sanitize' => 'esc_url_raw',
'section' => 'general_social',
'default' => kadence()->default( 'pinterest_link' ),
'label' => esc_html__( 'Pinterest', 'kadence' ),
],
'500px_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( '500px_link' ),
'label' => esc_html__( '500PX', 'kadence' ),
],
'amazon_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'amazon_link' ),
'label' => esc_html__( 'Amazon', 'kadence' ),
],
'anchor_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'anchor_link' ),
'label' => esc_html__( 'Anchor', 'kadence' ),
],
'apple_podcasts_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'apple_podcasts_link' ),
'label' => esc_html__( 'Apple Podcast', 'kadence' ),
],
'bandcamp_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'bandcamp_link' ),
'label' => esc_html__( 'Bandcamp', 'kadence' ),
],
'behance_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'behance_link' ),
'label' => esc_html__( 'Behance', 'kadence' ),
],
'bluesky_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'bluesky_link' ),
'label' => esc_html__( 'Bluesky', 'kadence' ),
],
'bookbub_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'bookbub_link' ),
'label' => esc_html__( 'Bookbub', 'kadence' ),
],
'discord_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'discord_link' ),
'label' => esc_html__( 'Discord', 'kadence' ),
],
'dribbble_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'dribbble_link' ),
'label' => esc_html__( 'Dribbble', 'kadence' ),
],
'email_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'sanitize_text_field',
'default' => kadence()->default( 'email_link' ),
'label' => esc_html__( 'Email', 'kadence' ),
],
'facebook_group_link' => [
'control_type' => 'kadence_text_control',
'sanitize' => 'esc_url_raw',
'section' => 'general_social',
'default' => kadence()->default( 'facebook_group_link' ),
'label' => esc_html__( 'Facebook Group', 'kadence' ),
],
'flickr_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'flickr_link' ),
'label' => esc_html__( 'Flickr', 'kadence' ),
],
'flipboard_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'flipboard_link' ),
'label' => esc_html__( 'Flipboard', 'kadence' ),
],
'fstoppers_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'fstoppers_link' ),
'label' => esc_html__( 'Fstoppers', 'kadence' ),
],
'github_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'github_link' ),
'label' => esc_html__( 'GitHub', 'kadence' ),
],
'goodreads_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'goodreads_link' ),
'label' => esc_html__( 'Goodreads', 'kadence' ),
],
'google_reviews_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'google_reviews_link' ),
'label' => esc_html__( 'Google Reviews', 'kadence' ),
],
'imdb_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'imdb_link' ),
'label' => esc_html__( 'IMDB', 'kadence' ),
],
'imgur_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'imgur_link' ),
'label' => esc_html__( 'Imgur', 'kadence' ),
],
'line_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'line_link' ),
'label' => esc_html__( 'Line', 'kadence' ),
],
'linkedin_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'linkedin_link' ),
'label' => esc_html__( 'Linkedin', 'kadence' ),
],
'mastodon_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'mastodon_link' ),
'label' => esc_html__( 'Mastodon', 'kadence' ),
],
'medium_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'medium_link' ),
'label' => esc_html__( 'medium', 'kadence' ),
],
'mewe_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'mewe_link' ),
'label' => esc_html__( 'MeWe', 'kadence' ),
],
'parler_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'parler_link' ),
'label' => esc_html__( 'Parler', 'kadence' ),
],
'patreon_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'patreon_link' ),
'label' => esc_html__( 'Patreon', 'kadence' ),
],
'phone_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'sanitize_text_field',
'default' => kadence()->default( 'phone_link' ),
'label' => esc_html__( 'Phone', 'kadence' ),
],
'quora_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'quora_link' ),
'label' => esc_html__( 'Quora', 'kadence' ),
],
'ravelry_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'ravelry_link' ),
'label' => esc_html__( 'Ravelry', 'kadence' ),
],
'reddit_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'reddit_link' ),
'label' => esc_html__( 'Reddit', 'kadence' ),
],
'rss_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'rss_link' ),
'label' => esc_html__( 'RSS', 'kadence' ),
],
'rumble_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'rumble_link' ),
'label' => esc_html__( 'Rumble', 'kadence' ),
],
'snapchat_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'snapchat_link' ),
'label' => esc_html__( 'Snapchat', 'kadence' ),
],
'soundcloud_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'soundcloud_link' ),
'label' => esc_html__( 'SoundCloud', 'kadence' ),
],
'spotify_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'spotify_link' ),
'label' => esc_html__( 'Spotify', 'kadence' ),
],
'steam_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'steam_link' ),
'label' => esc_html__( 'Steam', 'kadence' ),
],
'strava_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'strava_link' ),
'label' => esc_html__( 'Strava', 'kadence' ),
],
'telegram_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'telegram_link' ),
'label' => esc_html__( 'Telegram', 'kadence' ),
],
'threads_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'threads_link' ),
'label' => esc_html__( 'Threads', 'kadence' ),
],
'tiktok_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'tiktok_link' ),
'label' => esc_html__( 'Tiktok', 'kadence' ),
],
'trip_advisor_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'trip_advisor_link' ),
'label' => esc_html__( 'Trip Advisor', 'kadence' ),
],
'tumblr_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'tumblr_link' ),
'label' => esc_html__( 'Tumblr', 'kadence' ),
],
'twitch_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'twitch_link' ),
'label' => esc_html__( 'Twitch', 'kadence' ),
],
'vero_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'vero_link' ),
'label' => esc_html__( 'Vero', 'kadence' ),
],
'vimeo_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'vimeo_link' ),
'label' => esc_html__( 'Vimeo', 'kadence' ),
],
'vk_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'vk_link' ),
'label' => esc_html__( 'VK', 'kadence' ),
],
'whatsapp_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'whatsapp_link' ),
'label' => esc_html__( 'WhatsApp', 'kadence' ),
],
'wordpress_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'wordpress_link' ),
'label' => esc_html__( 'WordPress', 'kadence' ),
],
'xing_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'xing_link' ),
'label' => esc_html__( 'Xing', 'kadence' ),
],
'yelp_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'yelp_link' ),
'label' => esc_html__( 'Yelp', 'kadence' ),
],
'custom1_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'custom1_link' ),
'label' => esc_html__( 'Custom 1', 'kadence' ),
],
'custom2_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'custom2_link' ),
'label' => esc_html__( 'Custom 2', 'kadence' ),
],
'custom3_link' => [
'control_type' => 'kadence_text_control',
'section' => 'general_social',
'sanitize' => 'esc_url_raw',
'default' => kadence()->default( 'custom3_link' ),
'label' => esc_html__( 'Custom 3', 'kadence' ),
],
];
Theme_Customizer::add_settings( $settings );

View File

@@ -0,0 +1,313 @@
<?php
/**
* Header Builder Options
*
* @package Kadence
*/
namespace Kadence;
use Kadence\Theme_Customizer;
use function Kadence\kadence;
Theme_Customizer::add_settings(
array(
// 'load_font_pairing' => array(
// 'control_type' => 'kadence_font_pairing',
// 'section' => 'general_typography',
// 'label' => esc_html__( 'Font Pairings', 'kadence' ),
// 'settings' => false,
// ),
'base_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'Base Font', 'kadence' ),
'default' => kadence()->default( 'base_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => 'body',
'property' => 'font',
'key' => 'typography',
),
array(
'id' => 'base_font_family',
'type' => 'css',
'property' => '--global-body-font-family',
'selector' => 'body',
'pattern' => '$',
'key' => 'family',
),
),
'input_attrs' => array(
'id' => 'base_font',
'canInherit' => false,
),
),
'load_base_italic' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_typography',
'default' => kadence()->default( 'load_base_italic' ),
'label' => esc_html__( 'Load Italics Font Styles', 'kadence' ),
'context' => array(
array(
'setting' => 'base_font',
'operator' => 'load_italic',
'value' => 'true',
),
),
),
'info_heading' => array(
'control_type' => 'kadence_title_control',
'section' => 'general_typography',
'label' => esc_html__( 'Headings', 'kadence' ),
'settings' => false,
),
'heading_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'Heading Font Family', 'kadence' ),
'default' => kadence()->default( 'heading_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => 'h1,h2,h3,h4,h5,h6',
'property' => 'font',
'key' => 'family',
),
array(
'type' => 'css',
'property' => '--global-heading-font-family',
'selector' => 'body',
'pattern' => '$',
'key' => 'family',
),
),
'input_attrs' => array(
'id' => 'heading_font',
'options' => 'family',
),
),
'h1_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'H1 Font', 'kadence' ),
'default' => kadence()->default( 'h1_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => 'h1',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'h1_font',
'headingInherit' => true,
),
),
'h2_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'H2 Font', 'kadence' ),
'default' => kadence()->default( 'h2_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => 'h2',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'h2_font',
'headingInherit' => true,
),
),
'h3_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'H3 Font', 'kadence' ),
'default' => kadence()->default( 'h3_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => 'h3',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'h3_font',
'headingInherit' => true,
),
),
'h4_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'H4 Font', 'kadence' ),
'default' => kadence()->default( 'h4_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => 'h4',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'h4_font',
'headingInherit' => true,
),
),
'h5_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'H5 Font', 'kadence' ),
'default' => kadence()->default( 'h5_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => 'h5',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'h5_font',
'headingInherit' => true,
),
),
'h6_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'H6 Font', 'kadence' ),
'default' => kadence()->default( 'h6_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => 'h6',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'h6_font',
'headingInherit' => true,
),
),
'info_above_title_heading' => array(
'control_type' => 'kadence_title_control',
'section' => 'general_typography',
'label' => esc_html__( 'Title Above Content', 'kadence' ),
'settings' => false,
),
'title_above_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'H1 Title', 'kadence' ),
'default' => kadence()->default( 'title_above_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.entry-hero h1',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'title_above_font',
'headingInherit' => true,
),
),
'title_above_breadcrumb_font' => array(
'control_type' => 'kadence_typography_control',
'section' => 'general_typography',
'label' => esc_html__( 'Breadcrumbs', 'kadence' ),
'default' => kadence()->default( 'title_above_breadcrumb_font' ),
'live_method' => array(
array(
'type' => 'css_typography',
'selector' => '.entry-hero .kadence-breadcrumbs',
'property' => 'font',
'key' => 'typography',
),
),
'input_attrs' => array(
'id' => 'title_above_breadcrumb_font',
),
),
'font_rendering' => array(
'control_type' => 'kadence_switch_control',
'sanitize' => 'kadence_sanitize_toggle',
'section' => 'general_typography',
'transport' => 'refresh',
'default' => kadence()->default( 'font_rendering' ),
'label' => esc_html__( 'Enable Font Smoothing', 'kadence' ),
),
'google_subsets' => array(
'control_type' => 'kadence_check_icon_control',
'section' => 'general_typography',
'sanitize' => 'kadence_sanitize_google_subsets',
'priority' => 20,
'default' => array(),
'label' => esc_html__( 'Google Font Subsets', 'kadence' ),
'input_attrs' => array(
'options' => array(
'latin-ext' => array(
'name' => __( 'Latin Extended', 'kadence' ),
),
'cyrillic' => array(
'name' => __( 'Cyrillic', 'kadence' ),
),
'cyrillic-ext' => array(
'name' => __( 'Cyrillic Extended', 'kadence' ),
),
'greek' => array(
'name' => __( 'Greek', 'kadence' ),
),
'greek-ext' => array(
'name' => __( 'Greek Extended', 'kadence' ),
),
'vietnamese' => array(
'name' => __( 'Vietnamese', 'kadence' ),
),
'arabic' => array(
'name' => __( 'Arabic', 'kadence' ),
),
'khmer' => array(
'name' => __( 'Khmer', 'kadence' ),
),
'chinese' => array(
'name' => __( 'Chinese', 'kadence' ),
),
'chinese-simplified' => array(
'name' => __( 'Chinese Simplified', 'kadence' ),
),
'tamil' => array(
'name' => __( 'Tamil', 'kadence' ),
),
'bengali' => array(
'name' => __( 'Bengali', 'kadence' ),
),
'devanagari' => array(
'name' => __( 'Devanagari', 'kadence' ),
),
'hebrew' => array(
'name' => __( 'Hebrew', 'kadence' ),
),
'korean' => array(
'name' => __( 'Korean', 'kadence' ),
),
'thai' => array(
'name' => __( 'Thai', 'kadence' ),
),
'telugu' => array(
'name' => __( 'Telugu', 'kadence' ),
),
),
),
),
)
);

Some files were not shown because too many files have changed in this diff Show More