??????????????
PK Ú³–[
ØG+ + class-sinatra-db-updater.phpnu „[µü¤
* @since 1.1.0
*/
/**
* Do not allow direct script access.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Sinatra_DB_Updater' ) ) :
/**
* Sinatra_DB_Updater Class.
*/
class Sinatra_DB_Updater {
/**
* DB updates and callbacks that need to be run per version.
*
* @var array
*/
private static $db_updates = array(
'1.1.0' => array(
'v_1_1_0',
),
);
/**
* Primary class constructor.
*
* @since 1.0.0
*/
public function __construct() {
if ( is_admin() ) {
add_action( 'admin_init', array( $this, 'updates' ) );
} else {
add_action( 'wp', array( $this, 'updates' ) );
}
}
/**
* Implement theme update logic.
*
* @since 1.0.0
*/
public function updates() {
$updates = $this->get_db_update_callbacks();
$current_version = get_option( 'sinatra-theme-updater', null );
if ( empty( $updates ) ) {
return;
}
if ( ! is_null( $current_version ) && -1 < version_compare( $current_version, max( array_keys( $updates ) ) ) ) {
return;
}
foreach ( $updates as $version => $callbacks ) {
if ( version_compare( $current_version, $version, '<' ) ) {
foreach ( $callbacks as $callback ) {
call_user_func( array( 'Sinatra_DB_Updater', $callback ) );
}
}
}
// Update dynamic stylesheet on theme update.
sinatra_dynamic_styles()->update_dynamic_file();
$this->update_db_version();
}
/**
* Update DB version to current.
*
* @param string|null $version New Astra theme version or null.
*/
public static function update_db_version( $version = null ) {
update_option( 'sinatra-theme-updater', SINATRA_THEME_VERSION );
}
/**
* Get list of DB update callbacks.
*
* @since 1.1.0
* @return array
*/
public function get_db_update_callbacks() {
return self::$db_updates;
}
/**
* DB Update v1.1.0
*
* @since 1.1.0
* @return void
*/
public static function v_1_1_0() {
sinatra()->options->set(
'sinatra_single_post_elements',
array(
'thumb' => sinatra()->options->get( 'sinatra_single_post_thumb' ),
'category' => sinatra()->options->get( 'sinatra_single_post_categories' ),
'tags' => sinatra()->options->get( 'sinatra_single_post_tags' ),
'last-updated' => sinatra()->options->get( 'sinatra_single_last_updated' ),
'about-author' => sinatra()->options->get( 'sinatra_single_about_author' ),
'prev-next-post' => sinatra()->options->get( 'sinatra_single_post_next_prev' ),
)
);
// Single Post Layout to Single Title Position.
switch ( sinatra()->options->get( 'sinatra_single_post_layout' ) ) {
case 'layout-1':
sinatra()->options->set( 'sinatra_single_title_position', 'in-content' );
break;
case 'layout-2':
sinatra()->options->set( 'sinatra_single_title_position', 'in-page-header' );
break;
}
}
}
endif;
new Sinatra_DB_Updater();
PK Ú³–[Þœ¦ ¦ ! class-sinatra-enqueue-scripts.phpnu „[µü¤
* @since 1.0.0
*/
/**
* Enqueue and register scripts and styles.
*
* @since 1.0.0
*/
function sinatra_enqueues() {
// Script debug.
$sinatra_dir = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'dev/' : '';
$sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
// Enqueue theme stylesheet.
wp_enqueue_style(
'sinatra-styles',
SINATRA_THEME_URI . '/assets/css/style' . $sinatra_suffix . '.css',
false,
SINATRA_THEME_VERSION,
'all'
);
// Enqueue IE specific styles.
wp_enqueue_style(
'sinatra-ie',
SINATRA_THEME_URI . '/assets/css/compatibility/ie' . $sinatra_suffix . '.css',
false,
SINATRA_THEME_VERSION,
'all'
);
wp_style_add_data( 'sinatra-ie', 'conditional', 'IE' );
// Enqueue HTML5 shiv.
wp_register_script(
'html5shiv',
SINATRA_THEME_URI . '/assets/js/' . $sinatra_dir . 'vendors/html5' . $sinatra_suffix . '.js',
array(),
'3.7.3',
true
);
// Load only on < IE9.
wp_script_add_data(
'html5shiv',
'conditional',
'lt IE 9'
);
// Flexibility.js for crossbrowser flex support.
wp_enqueue_script(
'sinatra-flexibility',
SINATRA_THEME_URI . '/assets/js/' . $sinatra_dir . 'vendors/flexibility' . $sinatra_suffix . '.js',
array(),
SINATRA_THEME_VERSION,
false
);
wp_add_inline_script(
'sinatra-flexibility',
'flexibility(document.documentElement);'
);
wp_script_add_data(
'sinatra-flexibility',
'conditional',
'IE'
);
// Register ImagesLoaded library.
wp_register_script(
'imagesloaded',
SINATRA_THEME_URI . '/assets/js/' . $sinatra_dir . 'vendors/imagesloaded' . $sinatra_suffix . '.js',
array(),
'4.1.4',
true
);
// Register Sinatra slider.
wp_register_script(
'sinatra-slider',
SINATRA_THEME_URI . '/assets/js/sinatra-slider' . $sinatra_suffix . '.js',
array( 'imagesloaded' ),
SINATRA_THEME_VERSION,
true
);
// Load comment reply script if comments are open.
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
// Enqueue main theme script.
wp_enqueue_script(
'sinatra-js',
SINATRA_THEME_URI . '/assets/js/sinatra' . $sinatra_suffix . '.js',
array(),
SINATRA_THEME_VERSION,
true
);
// Comment count used in localized strings.
$comment_count = get_comments_number();
// Localized variables so they can be used for translatable strings.
$localized = array(
'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
'nonce' => wp_create_nonce( 'sinatra-nonce' ),
'responsive-breakpoint' => intval( sinatra_option( 'main_nav_mobile_breakpoint' ) ),
'sticky-header' => sinatra_option( 'sticky_header' ),
'strings' => array(
/* translators: %s Comment count */
'comments_toggle_show' => $comment_count > 0 ? esc_html( sprintf( _n( 'Show %s Comment', 'Show %s Comments', $comment_count, 'sinatra' ), $comment_count ) ) : esc_html__( 'Leave a Comment', 'sinatra' ),
'comments_toggle_hide' => esc_html__( 'Hide Comments', 'sinatra' ),
),
);
wp_localize_script(
'sinatra-js',
'sinatra_vars',
apply_filters( 'sinatra_localized', $localized )
);
// Enqueue google fonts.
sinatra()->fonts->enqueue_google_fonts();
// Add additional theme styles.
do_action( 'sinatra_enqueue_scripts' );
}
add_action( 'wp_enqueue_scripts', 'sinatra_enqueues' );
/**
* Skip link focus fix for IE11.
*
* @since 1.0.0
*
* @return void
*/
function sinatra_skip_link_focus_fix() {
?>
fonts->enqueue_google_fonts();
// Add dynamic CSS as inline style.
wp_add_inline_style(
'sinatra-block-editor-styles',
apply_filters( 'sinatra_block_editor_dynamic_css', sinatra_dynamic_styles()->get_block_editor_css() )
);
}
add_action( 'enqueue_block_editor_assets', 'sinatra_block_editor_assets' );
PK Ú³–[[ôñÂ- Â- class-sinatra-fonts.phpnu „[µü¤
* @since 1.0.0
*/
/**
* Do not allow direct script access.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Sinatra_Fonts' ) ) :
/**
* Sinatra helper class to handle fonts.
*
* @since 1.0.0
*/
class Sinatra_Fonts {
/**
* System Fonts
*
* @since 1.0.0
* @var array
*/
public $system_fonts = array();
/**
* Google Fonts
*
* @since 1.0.0
* @var array
*/
public $google_fonts = array();
/**
* Primary class constructor.
*
* @since 1.0.0
*/
public function __construct() {
}
/**
* Get System Fonts.
*
* @since 1.0.0
*
* @return Array All the system fonts in Sinatra
*/
public function get_system_fonts() {
if ( empty( $this->system_fonts ) ) {
$this->system_fonts = array(
'Helvetica' => array(
'fallback' => 'Verdana, Arial, sans-serif',
'variants' => array(
'300',
'400',
'700',
),
),
'Verdana' => array(
'fallback' => 'Helvetica, Arial, sans-serif',
'variants' => array(
'300',
'400',
'700',
),
),
'Arial' => array(
'fallback' => 'Helvetica, Verdana, sans-serif',
'variants' => array(
'300',
'400',
'700',
),
),
'Times' => array(
'fallback' => 'Georgia, serif',
'variants' => array(
'300',
'400',
'700',
),
),
'Georgia' => array(
'fallback' => 'Times, serif',
'variants' => array(
'300',
'400',
'700',
),
),
'Courier' => array(
'fallback' => 'monospace',
'variants' => array(
'300',
'400',
'700',
),
),
);
}
return apply_filters( 'sinatra_system_fonts', $this->system_fonts );
}
/**
* Return an array of standard websafe fonts.
*
* @return array Standard websafe fonts.
*/
public function get_standard_fonts() {
$standard_fonts = array(
'Serif' => array(
'fallback' => 'Georgia, Times, "Times New Roman", serif',
'variants' => array(
'300',
'400',
'700',
),
),
'Sans Serif' => array(
'fallback' => 'Helvetica, Arial, sans-serif',
'variants' => array(
'300',
'400',
'700',
),
),
'Monospace' => array(
'fallback' => 'Monaco, "Lucida Sans Typewriter", "Lucida Typewriter", "Courier New", Courier, monospace',
'variants' => array(
'300',
'400',
'700',
),
),
);
return apply_filters( 'sinatra_standard_fonts', $standard_fonts );
}
/**
* Default system font.
*
* @since 1.0.0
*
* @return string Default system font.
*/
public function get_default_system_font() {
$font = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;';
return apply_filters( 'sinatra_default_system_font', $font );
}
/**
* Google Fonts.
* Array is generated from the google-fonts.json file.
*
* @since 1.0.0
*
* @return Array Array of Google Fonts.
*/
public function get_google_fonts() {
if ( empty( $this->google_fonts ) ) {
$google_fonts_file = apply_filters( 'sinatra_google_fonts_json_file', SINATRA_THEME_PATH . '/assets/fonts/google-fonts.json' );
if ( ! file_exists( $google_fonts_file ) ) {
return array();
}
global $wp_filesystem;
if ( empty( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php'; // phpcs:ignore
WP_Filesystem();
}
$file_contants = $wp_filesystem->get_contents( $google_fonts_file );
$google_fonts_json = json_decode( $file_contants, 1 );
foreach ( $google_fonts_json as $key => $font ) {
$name = key( $font );
foreach ( $font[ $name ] as $font_key => $single_font ) {
if ( 'variants' === $font_key ) {
foreach ( $single_font as $variant_key => $variant ) {
if ( 'regular' === $variant ) {
$font[ $name ][ $font_key ][ $variant_key ] = '400';
}
if ( 'italic' === $variant ) {
$font[ $name ][ $font_key ][ $variant_key ] = '400italic';
}
if ( strpos( $font[ $name ][ $font_key ][ $variant_key ], 'italic' ) ) {
unset( $font[ $name ][ $font_key ][ $variant_key ] );
}
}
}
$this->google_fonts[ $name ] = $font[ $name ];
}
}
}
return apply_filters( 'sinatra_google_fonts', $this->google_fonts );
}
/**
* Google Font subsets.
*
* @since 1.0.0
*
* @return Array Array of Google Fonts.
*/
public function get_google_font_subsets() {
$subsets = array(
'arabic' => esc_html__( 'Arabic', 'sinatra' ),
'bengali' => esc_html__( 'Bengali', 'sinatra' ),
'chinese-hongkong' => esc_html__( 'Chinese (Hong Kong)', 'sinatra' ),
'chinese-simplified' => esc_html__( 'Chinese (Simplified)', 'sinatra' ),
'chinese-traditional' => esc_html__( 'Chinese (Traditional)', 'sinatra' ),
'cyrillic' => esc_html__( 'Cyrillic', 'sinatra' ),
'cyrillic-ext' => esc_html__( 'Cyrillic Extended', 'sinatra' ),
'devanagari' => esc_html__( 'Devanagari', 'sinatra' ),
'greek' => esc_html__( 'Greek', 'sinatra' ),
'greek-ext' => esc_html__( 'Greek Extended', 'sinatra' ),
'gujarati' => esc_html__( 'Gujarati', 'sinatra' ),
'gurmukhi' => esc_html__( 'Gurmukhi', 'sinatra' ),
'hebrew' => esc_html__( 'Hebrew', 'sinatra' ),
'japanese' => esc_html__( 'Japanese', 'sinatra' ),
'kannada' => esc_html__( 'Kannada', 'sinatra' ),
'khmer' => esc_html__( 'Khmer', 'sinatra' ),
'korean' => esc_html__( 'Korean', 'sinatra' ),
'latin' => esc_html__( 'Latin', 'sinatra' ),
'latin-ext' => esc_html__( 'Latin Extended', 'sinatra' ),
'malayalam' => esc_html__( 'Malayalam', 'sinatra' ),
'myanmar' => esc_html__( 'Myanmar', 'sinatra' ),
'oriya' => esc_html__( 'Oriya', 'sinatra' ),
'sinhala' => esc_html__( 'Sinhala', 'sinatra' ),
'tamil' => esc_html__( 'Tamil', 'sinatra' ),
'telugu' => esc_html__( 'Telugu', 'sinatra' ),
'thai' => esc_html__( 'Thai', 'sinatra' ),
'vietnamese' => esc_html__( 'Vietnamese', 'sinatra' ),
);
return apply_filters( 'sinatra_google_font_subsets', $subsets );
}
/**
* Return an array of backup fonts based on the font-category.
*
* @return array
*/
public function get_backup_fonts() {
$backup_fonts = array(
'sans-serif' => 'Helvetica, Arial, sans-serif',
'serif' => 'Georgia, serif',
'display' => '"Comic Sans MS", cursive, sans-serif',
'handwriting' => '"Comic Sans MS", cursive, sans-serif',
'monospace' => '"Lucida Console", Monaco, monospace',
);
return apply_filters( 'sinatra_backup_fonts', $backup_fonts );
}
/**
* Enqueue Google fonts.
*
* @since 1.0.0
*/
public function enqueue_google_fonts() {
$fonts = get_transient( 'sinatra_google_fonts_enqueue' );
if ( false === $fonts || empty( $fonts ) ) {
return;
}
$url = '//fonts.googleapis.com/css';
$family = array();
$subsets = array();
foreach ( $fonts as $font_family => $font ) {
if ( ! empty( $font['weight'] ) ) {
$family[] = $font_family . ':' . implode( ',', $font['weight'] );
} else {
$family[] = $font_family;
}
$subsets = array_unique( array_merge( $subsets, $font['subsets'] ) );
}
$family = implode( '|', $family );
$subsets = implode( ',', $subsets );
$url = add_query_arg(
array(
'family' => $family,
'display' => 'swap',
'subsets' => $subsets,
),
$url
);
// Enqueue.
wp_enqueue_style(
'sinatra-google-fonts',
$url,
false,
SINATRA_THEME_VERSION,
false
);
}
/**
* Check if font familu is a Google font.
*
* @since 1.0.0
* @param string $font_family Font Family.
* @return boolean
*/
public function is_google_font( $font_family ) {
$google_fonts = $this->get_google_fonts();
return isset( $google_fonts[ $font_family ] );
}
/**
* Store list of Google fonts to enqueue.
*
* @since 1.0.0
* @param string $family Font Family.
* @param array $args Array of font details.
* @return void
*/
public function enqueue_google_font( $family, $args = array() ) {
$fonts = get_transient( 'sinatra_google_fonts_enqueue' );
$fonts = $fonts ? $fonts : array();
// Default args.
$args = wp_parse_args(
$args,
array(
'weight' => array( '400' ),
'style' => array( 'normal' ),
'subsets' => array( 'latin' ),
)
);
// Convert all args to arrays.
foreach ( $args as $key => $value ) {
if ( ! is_array( $args[ $key ] ) ) {
$args[ $key ] = array( $value );
}
}
if ( in_array( 'italic', $args['style'], true ) ) {
foreach ( $args['weight'] as $weight ) {
$args['weight'][] = $weight . 'i';
}
}
// Remove uneccesary info.
unset( $args['style'] );
// Sanitize key.
$family = str_replace( ' ', '+', $family );
// Check if we previously enqueued this font.
if ( ! isset( $fonts[ $family ] ) ) {
$fonts[ $family ] = $args;
} else {
foreach ( $args as $key => $value ) {
$fonts[ $family ][ $key ] = array_unique(
array_merge(
$fonts[ $family ][ $key ],
$value
)
);
}
}
set_transient( 'sinatra_google_fonts_enqueue', $fonts );
}
/**
* Get All Fonts.
*
* @since 1.0.0
*
* @return Array All the system fonts in Sinatra
*/
public function get_fonts() {
$fonts = array();
$fonts['standard_fonts'] = array(
'name' => esc_html__( 'Standard', 'sinatra' ),
'fonts' => self::get_standard_fonts(),
);
$fonts['system_fonts'] = array(
'name' => esc_html__( 'System Fonts', 'sinatra' ),
'fonts' => self::get_system_fonts(),
);
$fonts['google_fonts'] = array(
'name' => esc_html__( 'Google Fonts', 'sinatra' ),
'fonts' => self::get_google_fonts(),
);
return apply_filters( 'sinatra_get_fonts', $fonts );
}
/**
* Get complete font family stack.
*
* @since 1.0.0
*
* @param string $font Font family.
* @return string Font family including backup families.
*/
public function get_font_family( $font ) {
if ( 'default' === $font ) {
$font = $this->get_default_system_font();
} else {
$fonts = $this->get_fonts();
$backup = '';
if ( isset( $fonts['system_fonts']['fonts'][ $font ] ) ) {
$backup = $fonts['system_fonts']['fonts'][ $font ]['fallback'];
} elseif ( isset( $fonts['google_fonts']['fonts'][ $font ] ) ) {
$backups = $this->get_backup_fonts();
$category = $fonts['google_fonts']['fonts'][ $font ]['category'];
$backup = isset( $backups[ $category ] ) ? $backups[ $category ] : '';
} elseif ( isset( $fonts['standard_fonts']['fonts'][ $font ] ) ) {
$backup = $fonts['standard_fonts']['fonts'][ $font ]['fallback'];
$font = '';
}
if ( false !== strpos( $font, ' ' ) ) {
$font = '"' . $font . '"';
}
$font = $font . ', ' . $backup;
$font = trim( $font, ', ' );
}
return apply_filters( 'sinatra_font_family', $font );
}
}
endif;
PK Ú³–[,Þ*Ÿf Ÿf class-sinatra-options.phpnu „[µü¤
* @since 1.0.0
*/
/**
* Do not allow direct script access.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Sinatra_Options' ) ) :
/**
* Sinatra Options Class.
*/
class Sinatra_Options {
/**
* Singleton instance of the class.
*
* @since 1.0.0
* @var object
*/
private static $instance;
/**
* Options variable.
*
* @since 1.0.0
* @var mixed $options
*/
private static $options;
/**
* Main Sinatra_Options Instance.
*
* @since 1.0.0
* @return Sinatra_Options
*/
public static function instance() {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Options ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Primary class constructor.
*
* @since 1.0.0
*/
public function __construct() {
// Refresh options.
add_action( 'after_setup_theme', array( $this, 'refresh' ) );
}
/**
* Set default option values.
*
* @since 1.0.0
* @return array Default values.
*/
public function get_defaults() {
$defaults = array(
/**
* General Settings.
*/
// Layout.
'sinatra_site_layout' => 'fw-contained',
'sinatra_container_width' => 1200,
// Base Colors.
'sinatra_accent_color' => '#3857F1',
'sinatra_content_text_color' => '#30373e',
'sinatra_headings_color' => '#23282d',
'sinatra_content_link_hover_color' => '#23282d',
'sinatra_body_background_heading' => true,
'sinatra_content_background_heading' => true,
'sinatra_boxed_content_background_color' => '#FFFFFF',
'sinatra_scroll_top_visibility' => 'all',
// Base Typography.
'sinatra_html_base_font_size' => array(
'desktop' => 16,
),
'sinatra_font_smoothing' => true,
'sinatra_typography_body_heading' => false,
'sinatra_typography_headings_heading' => false,
'sinatra_body_font' => sinatra_typography_defaults(
array(
'font-family' => 'default',
'font-weight' => 400,
'font-size-desktop' => '0.9375',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.733',
)
),
'sinatra_headings_font' => sinatra_typography_defaults(
array(
'font-weight' => 500,
'font-style' => 'normal',
'text-transform' => 'none',
'text-decoration' => 'none',
)
),
'sinatra_h1_font' => sinatra_typography_defaults(
array(
'font-weight' => 600,
'font-size-desktop' => '2.375',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.1',
)
),
'sinatra_h2_font' => sinatra_typography_defaults(
array(
'font-weight' => 'inherit',
'font-size-desktop' => '1.875',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.25',
)
),
'sinatra_h3_font' => sinatra_typography_defaults(
array(
'font-weight' => 'inherit',
'font-size-desktop' => '1.625',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.25',
)
),
'sinatra_h4_font' => sinatra_typography_defaults(
array(
'font-weight' => 'inherit',
'font-size-desktop' => '1.25',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.5',
)
),
'sinatra_h5_font' => sinatra_typography_defaults(
array(
'font-weight' => 'inherit',
'font-size-desktop' => '1',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.5',
)
),
'sinatra_h6_font' => sinatra_typography_defaults(
array(
'font-weight' => 'inherit',
'font-size-desktop' => '0.6875',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.72',
'text-transform' => 'uppercase',
'letter-spacing' => '2',
)
),
'sinatra_heading_em_font' => sinatra_typography_defaults(
array(
'font-weight' => 'inherit',
'font-style' => 'italic',
)
),
'sinatra_footer_widget_title_font_size' => array(
'desktop' => 1.125,
'unit' => 'em',
),
// Primary Button.
'sinatra_primary_button_heading' => false,
'sinatra_primary_button_bg_color' => '',
'sinatra_primary_button_hover_bg_color' => '',
'sinatra_primary_button_text_color' => '#FFFFFF',
'sinatra_primary_button_hover_text_color' => '#FFFFFF',
'sinatra_primary_button_border_radius' => array(
'top-left' => 2,
'top-right' => 2,
'bottom-right' => 2,
'bottom-left' => 2,
'unit' => 'px',
),
'sinatra_primary_button_border_width' => 1,
'sinatra_primary_button_border_color' => 'rgba(0, 0, 0, 0.12)',
'sinatra_primary_button_hover_border_color' => 'rgba(0, 0, 0, 0.12)',
'sinatra_primary_button_typography' => sinatra_typography_defaults(
array(
'font-family' => 'inherit',
'font-weight' => 500,
'font-size-desktop' => '0.9375',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.4',
)
),
// Secondary Button.
'sinatra_secondary_button_heading' => false,
'sinatra_secondary_button_bg_color' => '#23282d',
'sinatra_secondary_button_hover_bg_color' => '#3e4750',
'sinatra_secondary_button_text_color' => '#FFFFFF',
'sinatra_secondary_button_hover_text_color' => '#FFFFFF',
'sinatra_secondary_button_border_radius' => array(
'top-left' => 2,
'top-right' => 2,
'bottom-right' => 2,
'bottom-left' => 2,
'unit' => 'px',
),
'sinatra_secondary_button_border_width' => 1,
'sinatra_secondary_button_border_color' => 'rgba(0, 0, 0, 0.12)',
'sinatra_secondary_button_hover_border_color' => 'rgba(0, 0, 0, 0.12)',
'sinatra_secondary_button_typography' => sinatra_typography_defaults(
array(
'font-family' => 'inherit',
'font-weight' => 500,
'font-size-desktop' => '0.9375',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.4',
)
),
// Text button.
'sinatra_text_button_heading' => false,
'sinatra_text_button_text_color' => '#23282d',
'sinatra_text_button_hover_text_color' => '',
'sinatra_text_button_typography' => sinatra_typography_defaults(
array(
'font-family' => 'inherit',
'font-weight' => 500,
'font-size-desktop' => '0.9375',
'font-size-unit' => 'rem',
'line-height-desktop' => '1.4',
)
),
// Misc Settings.
'sinatra_enable_schema' => true,
'sinatra_custom_input_style' => true,
'sinatra_preloader_heading' => false,
'sinatra_preloader' => false,
'sinatra_preloader_style' => '1',
'sinatra_preloader_visibility' => 'all',
'sinatra_scroll_top_heading' => false,
'sinatra_enable_scroll_top' => true,
/**
* Logos & Site Title.
*/
'sinatra_logo_default_retina' => '',
'sinatra_logo_max_height' => array(
'desktop' => 30,
),
'sinatra_logo_margin' => array(
'desktop' => array(
'top' => 25,
'right' => 0,
'bottom' => 25,
'left' => 0,
),
'tablet' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'mobile' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'unit' => 'px',
),
'sinatra_display_tagline' => false,
'sinatra_logo_heading_site_identity' => true,
'sinatra_typography_logo_heading' => false,
'sinatra_logo_text_font_size' => array(
'desktop' => 1.875,
'unit' => 'rem',
),
/**
* Header.
*/
// Top Bar.
'sinatra_top_bar_enable' => false,
'sinatra_top_bar_container_width' => 'content-width',
'sinatra_top_bar_visibility' => 'hide-mobile-tablet',
'sinatra_top_bar_heading_widgets' => true,
'sinatra_top_bar_widgets' => array(
array(
'classname' => 'sinatra_customizer_widget_text',
'type' => 'text',
'values' => array(
'content' => esc_html__( 'This is a placeholder text widget in Top Bar section.', 'sinatra' ),
'location' => 'left',
'visibility' => 'all',
),
),
),
'sinatra_top_bar_widgets_separator' => 'regular',
'sinatra_top_bar_heading_design_options' => false,
'sinatra_top_bar_background' => sinatra_design_options_defaults(
array(
'background' => array(
'color' => array(
'background-color' => '#FFFFFF',
),
'gradient' => array(),
),
)
),
'sinatra_top_bar_text_color' => sinatra_design_options_defaults(
array(
'color' => array(),
)
),
'sinatra_top_bar_border' => sinatra_design_options_defaults(
array(
'border' => array(
'border-bottom-width' => '1',
'border-style' => 'solid',
'border-color' => 'rgba(0,0,0, .085)',
'separator-color' => '#cccccc',
),
)
),
// Main Header.
'sinatra_header_layout' => 'layout-1',
'sinatra_header_container_width' => 'content-width',
'sinatra_header_heading_widgets' => true,
'sinatra_header_widgets' => array(
array(
'classname' => 'sinatra_customizer_widget_search',
'type' => 'search',
'values' => array(
'location' => 'left',
'visibility' => 'hide-mobile-tablet',
),
),
),
'sinatra_header_widgets_separator' => 'none',
'sinatra_header_heading_design_options' => false,
'sinatra_header_background' => sinatra_design_options_defaults(
array(
'background' => array(
'color' => array(
'background-color' => '#FFFFFF',
),
'gradient' => array(),
'image' => array(),
),
)
),
'sinatra_header_border' => sinatra_design_options_defaults(
array(
'border' => array(
'border-bottom-width' => 1,
'border-color' => 'rgba(0,0,0, .085)',
'separator-color' => '#cccccc',
),
)
),
'sinatra_header_text_color' => sinatra_design_options_defaults(
array(
'color' => array(
'text-color' => '#66717f',
'link-color' => '#23282d',
),
)
),
// Transparent Header.
'sinatra_tsp_header' => false,
'sinatra_tsp_header_disable_on' => array(
'404',
'posts_page',
'archive',
'search',
),
'sinatra_tsp_logo_heading' => false,
'sinatra_tsp_logo' => '',
'sinatra_tsp_logo_retina' => '',
'sinatra_tsp_logo_max_height' => array(
'desktop' => 30,
),
'sinatra_tsp_logo_margin' => array(
'desktop' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'tablet' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'mobile' => array(
'top' => '',
'right' => '',
'bottom' => '',
'left' => '',
),
'unit' => 'px',
),
'sinatra_tsp_colors_heading' => false,
'sinatra_tsp_header_background' => sinatra_design_options_defaults(
array(
'background' => array(
'color' => array(),
),
)
),
'sinatra_tsp_header_font_color' => sinatra_design_options_defaults(
array(
'color' => array(),
)
),
'sinatra_tsp_header_border' => sinatra_design_options_defaults(
array(
'border' => array(),
)
),
// Sticky Header.
'sinatra_sticky_header' => false,
// Main Navigation.
'sinatra_main_nav_heading_animation' => false,
'sinatra_main_nav_hover_animation' => 'underline',
'sinatra_main_nav_heading_sub_menus' => false,
'sinatra_main_nav_sub_indicators' => true,
'sinatra_main_nav_heading_mobile_menu' => false,
'sinatra_main_nav_mobile_breakpoint' => 960,
'sinatra_main_nav_mobile_label' => '',
'sinatra_nav_design_options' => false,
'sinatra_main_nav_background' => sinatra_design_options_defaults(
array(
'background' => array(
'color' => array(
'background-color' => '#FFFFFF',
),
'gradient' => array(),
),
)
),
'sinatra_main_nav_border' => sinatra_design_options_defaults(
array(
'border' => array(
'border-top-width' => 1,
'border-bottom-width' => 1,
'border-style' => 'solid',
'border-color' => 'rgba(0,0,0, .085)',
),
)
),
'sinatra_main_nav_font_color' => sinatra_design_options_defaults(
array(
'color' => array(),
)
),
'sinatra_typography_main_nav_heading' => false,
'sinatra_main_nav_font_size' => array(
'value' => 0.9375,
'unit' => 'rem',
),
// Page Header.
'sinatra_page_header_enable' => true,
'sinatra_page_header_alignment' => 'left',
'sinatra_page_header_spacing' => array(
'desktop' => array(
'top' => 30,
'bottom' => 30,
),
'tablet' => array(
'top' => '',
'bottom' => '',
),
'mobile' => array(
'top' => '',
'bottom' => '',
),
'unit' => 'px',
),
'sinatra_page_header_background' => sinatra_design_options_defaults(
array(
'background' => array(
'color' => array( 'background-color' => 'rgba(0,0,0,.025)' ),
'gradient' => array(),
'image' => array(),
),
)
),
'sinatra_page_header_text_color' => sinatra_design_options_defaults(
array(
'color' => array(),
)
),
'sinatra_page_header_border' => sinatra_design_options_defaults(
array(
'border' => array(
'border-bottom-width' => 1,
'border-style' => 'solid',
'border-color' => 'rgba(0,0,0,.062)',
),
)
),
'sinatra_typography_page_header' => false,
'sinatra_page_header_font_size' => array(
'desktop' => 1.625,
'unit' => 'rem',
),
// Breadcrumbs.
'sinatra_breadcrumbs_enable' => true,
'sinatra_breadcrumbs_hide_on' => array( 'home' ),
'sinatra_breadcrumbs_position' => 'in-page-header',
'sinatra_breadcrumbs_alignment' => 'left',
'sinatra_breadcrumbs_spacing' => array(
'desktop' => array(
'top' => 15,
'bottom' => 15,
),
'tablet' => array(
'top' => '',
'bottom' => '',
),
'mobile' => array(
'top' => '',
'bottom' => '',
),
'unit' => 'px',
),
'sinatra_breadcrumbs_heading_design' => false,
'sinatra_breadcrumbs_background' => sinatra_design_options_defaults(
array(
'background' => array(
'color' => array(),
'gradient' => array(),
'image' => array(),
),
)
),
'sinatra_breadcrumbs_text_color' => sinatra_design_options_defaults(
array(
'color' => array(),
)
),
'sinatra_breadcrumbs_border' => sinatra_design_options_defaults(
array(
'border' => array(
'border-top-width' => 0,
'border-bottom-width' => 0,
'border-color' => '',
'border-style' => 'solid',
),
)
),
/**
* Hero.
*/
'sinatra_enable_hero' => false,
'sinatra_hero_type' => 'hover-slider',
'sinatra_hero_visibility' => 'all',
'sinatra_hero_enable_on' => array( 'home' ),
'sinatra_hero_hover_slider' => false,
'sinatra_hero_hover_slider_container' => 'content-width',
'sinatra_hero_hover_slider_height' => 500,
'sinatra_hero_hover_slider_overlay' => '1',
'sinatra_hero_hover_slider_elements' => array(
'category' => true,
'meta' => true,
'read_more' => true,
),
'sinatra_hero_hover_slider_posts' => false,
'sinatra_hero_hover_slider_post_number' => 3,
'sinatra_hero_hover_slider_category' => array(),
/**
* Blog.
*/
// Blog Page / Archive.
'sinatra_blog_entry_elements' => array(
'thumbnail' => true,
'header' => true,
'meta' => true,
'summary' => true,
'summary-footer' => true,
),
'sinatra_blog_entry_meta_elements' => array(
'author' => true,
'date' => true,
'category' => true,
'tag' => false,
'comments' => true,
),
'sinatra_entry_meta_icons' => false,
'sinatra_excerpt_length' => 30,
'sinatra_excerpt_more' => '…',
'sinatra_blog_layout' => 'blog-layout-1',
'sinatra_blog_image_position' => 'left',
'sinatra_blog_image_size' => 'large',
'sinatra_blog_horizontal_post_categories' => true,
'sinatra_blog_horizontal_read_more' => false,
// Single Post.
'sinatra_single_post_layout_heading' => false,
'sinatra_single_title_position' => 'in-content',
'sinatra_single_title_alignment' => 'left',
'sinatra_single_title_spacing' => array(
'desktop' => array(
'top' => 152,
'bottom' => 100,
),
'tablet' => array(
'top' => 90,
'bottom' => 55,
),
'mobile' => array(
'top' => '',
'bottom' => '',
),
'unit' => 'px',
),
'sinatra_single_content_width' => 'narrow',
'sinatra_single_narrow_container_width' => 700,
'sinatra_single_post_elements_heading' => false,
'sinatra_single_post_meta_elements' => array(
'author' => true,
'date' => true,
'comments' => true,
'category' => false,
),
'sinatra_single_post_thumb' => true,
'sinatra_single_post_categories' => true,
'sinatra_single_post_tags' => true,
'sinatra_single_last_updated' => true,
'sinatra_single_about_author' => true,
'sinatra_single_post_next_prev' => true,
'sinatra_single_post_elements' => array(
'thumb' => true,
'category' => true,
'tags' => true,
'last-updated' => true,
'about-author' => true,
'prev-next-post' => true,
),
'sinatra_single_toggle_comments' => false,
'sinatra_single_entry_meta_icons' => false,
'sinatra_typography_single_post_heading' => false,
'sinatra_single_content_font_size' => array(
'desktop' => '1',
'unit' => 'rem',
),
/**
* Sidebar.
*/
'sinatra_sidebar_position' => 'right-sidebar',
'sinatra_single_post_sidebar_position' => 'no-sidebar',
'sinatra_single_page_sidebar_position' => 'default',
'sinatra_archive_sidebar_position' => 'default',
'sinatra_sidebar_options_heading' => false,
'sinatra_sidebar_style' => '1',
'sinatra_sidebar_width' => 25,
'sinatra_sidebar_sticky' => '',
'sinatra_sidebar_responsive_position' => 'after-content',
'sinatra_typography_sidebar_heading' => false,
'sinatra_sidebar_widget_title_font_size' => array(
'desktop' => 1,
'unit' => 'rem',
),
/**
* Footer.
*/
// Pre Footer.
'sinatra_pre_footer_cta' => true,
'sinatra_enable_pre_footer_cta' => false,
'sinatra_pre_footer_cta_visibility' => 'all',
'sinatra_pre_footer_cta_hide_on' => array(),
'sinatra_pre_footer_cta_style' => '1',
'sinatra_pre_footer_cta_text' => wp_kses_post( __( 'This is an example of Pre Footer section in Sinatra.', 'sinatra' ) ),
'sinatra_pre_footer_cta_btn_text' => wp_kses_post( __( 'Example Button', 'sinatra' ) ),
'sinatra_pre_footer_cta_btn_url' => '#',
'sinatra_pre_footer_cta_btn_new_tab' => false,
'sinatra_pre_footer_cta_design_options' => false,
'sinatra_pre_footer_cta_background' => sinatra_design_options_defaults(
array(
'background' => array(
'color' => array(),
'gradient' => array(),
'image' => array(),
),
)
),
'sinatra_pre_footer_cta_border' => sinatra_design_options_defaults(
array(
'border' => array(),
)
),
'sinatra_pre_footer_cta_text_color' => sinatra_design_options_defaults(
array(
'color' => array(
'text-color' => '#FFFFFF',
),
)
),
'sinatra_pre_footer_cta_typography' => false,
'sinatra_pre_footer_cta_font_size' => array(
'desktop' => 1.75,
'unit' => 'rem',
),
// Copyright.
'sinatra_enable_copyright' => true,
'sinatra_copyright_layout' => 'layout-1',
'sinatra_copyright_separator' => 'contained-separator',
'sinatra_copyright_visibility' => 'all',
'sinatra_copyright_heading_widgets' => true,
'sinatra_copyright_widgets' => array(
array(
'classname' => 'sinatra_customizer_widget_text',
'type' => 'text',
'values' => array(
'content' => esc_html__( 'Copyright {{the_year}} — {{site_title}}. All rights reserved. {{theme_link}}', 'sinatra' ),
'location' => 'start',
'visibility' => 'all',
),
),
),
'sinatra_copyright_heading_design_options' => false,
'sinatra_copyright_background' => sinatra_design_options_defaults(
array(
'background' => array(
'color' => array(),
'gradient' => array(),
),
)
),
'sinatra_copyright_text_color' => sinatra_design_options_defaults(
array(
'color' => array(
'text-color' => '',
'link-color' => '',
'link-hover-color' => '#FFFFFF',
),
)
),
// Main Footer.
'sinatra_enable_footer' => true,
'sinatra_footer_layout' => 'layout-1',
'sinatra_footer_widgets_align_center' => false,
'sinatra_footer_visibility' => 'all',
'sinatra_footer_heading_design_options' => false,
'sinatra_footer_background' => sinatra_design_options_defaults(
array(
'background' => array(
'color' => array(
'background-color' => '#23282d',
),
'gradient' => array(),
'image' => array(),
),
)
),
'sinatra_footer_text_color' => sinatra_design_options_defaults(
array(
'color' => array(
'text-color' => '#9BA1A7',
'link-color' => '',
'link-hover-color' => '#FFFFFF',
'widget-title-color' => '#FFFFFF',
),
)
),
'sinatra_footer_border' => sinatra_design_options_defaults(
array(
'border' => array(),
)
),
'sinatra_typography_main_footer_heading' => false,
);
$defaults = apply_filters( 'sinatra_default_option_values', $defaults );
return $defaults;
}
/**
* Get the options from static array()
*
* @since 1.0.0
* @return array Return array of theme options.
*/
public function get_options() {
return self::$options;
}
/**
* Get the options from static array()
*
* @since 1.0.0
* @return array Return array of theme options.
*/
public function get( $id ) {
$value = isset( self::$options[ $id ] ) ? self::$options[ $id ] : self::get_default( $id );
$value = apply_filters( "theme_mod_{$id}", $value ); // phpcs:ignore
return $value;
}
/**
* Set option.
*
* @since 1.0.0
*/
public function set( $id, $value ) {
set_theme_mod( $id, $value );
self::$options[ $id ] = $value;
}
/**
* Refresh options.
*
* @since 1.0.0
* @return void
*/
public function refresh() {
self::$options = wp_parse_args(
get_theme_mods(),
self::get_defaults()
);
}
/**
* Returns the default value for option.
*
* @since 1.0.0
* @param string $id Option ID.
* @return mixed Default option value.
*/
public function get_default( $id ) {
$defaults = self::get_defaults();
return isset( $defaults[ $id ] ) ? $defaults[ $id ] : false;
}
}
endif;
PK Ú³–[þ‘<
M M class-sinatra-theme-setup.phpnu „[µü¤
* @since 1.0.0
*/
/**
* Do not allow direct script access.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Sinatra_Theme_Setup' ) ) :
/**
* Sinatra Options Class.
*/
class Sinatra_Theme_Setup {
/**
* Singleton instance of the class.
*
* @since 1.0.0
* @var object
*/
private static $instance;
/**
* Main Sinatra_Theme_Setup Instance.
*
* @since 1.0.0
* @return Sinatra_Theme_Setup
*/
public static function instance() {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Theme_Setup ) ) {
self::$instance = new Sinatra_Theme_Setup();
}
return self::$instance;
}
/**
* Primary class constructor.
*
* @since 1.0.0
*/
public function __construct() {
// Add theme supports.
add_action( 'after_setup_theme', array( $this, 'setup' ), 10 );
// Content width.
add_action( 'wp', array( $this, 'content_width' ) );
}
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*
* @since 1.0.0
*/
public function setup() {
// Make the theme available for translation.
load_theme_textdomain( 'sinatra', SINATRA_THEME_PATH . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Add theme support for Post Thumbnails and image sizes.
add_theme_support( 'post-thumbnails' );
// Add theme support for various Post Formats.
add_theme_support(
'post-formats',
array(
'gallery',
'image',
'link',
'quote',
'video',
'audio',
'status',
'aside',
)
);
// Add title output.
add_theme_support( 'title-tag' );
// Add wide image support.
add_theme_support( 'align-wide' );
// Responsive embeds support.
add_theme_support( 'responsive-embeds' );
// Add support for core block visual styles.
add_theme_support( 'wp-block-styles' );
// Selective Refresh for Customizer.
add_theme_support( 'customize-selective-refresh-widgets' );
// Excerpt support for pages.
add_post_type_support( 'page', 'excerpt' );
// Register Navigation menu.
register_nav_menus(
array(
'sinatra-primary' => esc_html__( 'Primary Navigation', 'sinatra' ),
)
);
// Add theme support for Custom Logo.
add_theme_support(
'custom-logo',
apply_filters(
'sinatra_custom_logo_args',
array(
'width' => 200,
'height' => 40,
'flex-height' => true,
'flex-width' => true,
)
)
);
// Add theme support for Custom Background.
add_theme_support(
'custom-background',
apply_filters(
'sinatra_custom_background_args',
array(
'default-color' => '#FFFFFF',
'default-size' => 'fit',
)
)
);
// Enable HTML5 markup.
add_theme_support(
'html5',
array(
'search-form',
'gallery',
'caption',
'script',
'style',
)
);
// Add editor style.
$sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
add_editor_style( 'assets/css/editor-style' . $sinatra_suffix . '.css' );
do_action( 'sinatra_after_setup_theme' );
}
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* @global int $content_width
* @since 1.0.0
*/
public function content_width() {
global $content_width;
if ( ! isset( $content_width ) ) {
$content_width = apply_filters( 'sinatra_content_width', intval( sinatra_option( 'container_width' ) ) - 100 ); // phpcs:ignore
}
}
}
endif;
/**
* The function which returns the one Sinatra_Options instance.
*
* @since 1.0.0
* @return object
*/
function sinatra_theme_setup() {
return Sinatra_Theme_Setup::instance();
}
sinatra_theme_setup();
PK Ú³–[
ØG+ + class-sinatra-db-updater.phpnu „[µü¤ PK Ú³–[Þœ¦ ¦ ! w class-sinatra-enqueue-scripts.phpnu „[µü¤ PK Ú³–[[ôñÂ- Â- n class-sinatra-fonts.phpnu „[µü¤ PK Ú³–[,Þ*Ÿf Ÿf wN class-sinatra-options.phpnu „[µü¤ PK Ú³–[þ‘<
M M _µ class-sinatra-theme-setup.phpnu „[µü¤ PK Ê ùÅ