1st commit

This commit is contained in:
2024-04-06 11:45:36 +02:00
commit 62a52850bc
228 changed files with 37418 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
/*-----------------------------------------------------------------------------------*/
/* BUILD AN ARRAY WITH OPTIONS FOR JQUERY
/*-----------------------------------------------------------------------------------*/
defined( 'ABSPATH' ) || exit;
if ( !class_exists( 'KkGetOptions' ) ) {
class KkGetOptions {
private static $data_ = array();
public static function TplConditions() {
return self::$data_;
}
public static function init() {
// NO RIGHT CLICK
self::$data_['kk_right_click'] = array(
'kk_click_check' => get_option('toppic_theme_content_protection')
);
// ANIMATION BETWEEN PAGES
self::$data_['kk_page_anim'] = get_option('toppic_theme_kk_page_anim');
// MENU STYLE
self::$data_['kk_menu_type'] = get_option( 'toppic_theme_menu_style' );
// CONTENT STYLE
self::$data_['kk_content_type'] = get_option( 'toppic_theme_content_style' );
// Ajax Url
self::$data_['ajax_url'] = esc_url( admin_url( 'admin-ajax.php' ) );
// Proofing nonce
if ( rwmb_meta( 'kk_proof' ) === 'proofing' ) {
self::$data_['proofing_nonce'] = wp_create_nonce( 'proof-nonce' );
}
// 404 page error
$error_bg = get_option('toppic_theme_404_image');
if ( !empty($error_bg) ) {
self::$data_['errorImg'] = esc_url( $error_bg );
}
return self::$data_;
}
}
}

File diff suppressed because it is too large Load Diff

59
includes/img-filters.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
/*-----------------------------------------------------------------------------------*/
/* IMAGES SIZES AND MARKUPS
/*-----------------------------------------------------------------------------------*/
add_filter( 'image_resize_dimensions', 'kktfwp_image_resize_upscale', 10, 6 );
if ( ! function_exists( 'kktfwp_image_resize_upscale' ) ) {
function kktfwp_image_resize_upscale( $default, $orig_w, $orig_h, $new_w, $new_h, $crop ) {
if ( !$crop ) return null;
$aspect_ratio = $orig_w / $orig_h;
$size_ratio = max( $new_w / $orig_w, $new_h / $orig_h );
$crop_w = round( $new_w / $size_ratio );
$crop_h = round( $new_h / $size_ratio );
$s_x = floor( ( $orig_w - $crop_w ) / 2 );
$s_y = floor( ( $orig_h - $crop_h ) / 2 );
return array( 0, 0, (int)$s_x, (int)$s_y, (int)$new_w, (int)$new_h, (int)$crop_w, (int)$crop_h );
}
}
// Filter for portfolio and attachments
add_filter( 'wp_get_attachment_image_attributes', 'kktfwp_portfolio_img_attr', 10, 2 );
if ( ! function_exists( 'kktfwp_portfolio_img_attr' ) ) {
function kktfwp_portfolio_img_attr( $attr, $attachment ) {
$action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action'];
if ( is_admin() && !doing_action('wp_ajax_nopriv_kktfwp_more_projects_ajax') && !doing_action('wp_ajax_kktfwp_more_projects_ajax') )return $attr;
if ( ( isset( $attr['data-lazy-load'] ) && (int)$attr['data-lazy-load'] === 1 ) ) {
if ( isset( $attr['srcset'] ) ) {
$attr['data-srcset'] = $attr['srcset'];
$attr['srcset'] = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== 1w';
if ( get_post_meta( get_the_ID(), '_grid_type_value', true ) !== 'Portrait' ) {
$attr['data-sizes'] = 'auto';
}
} else {
$attr['srcset'] = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== 1w';
$attr['data-srcset'] = $attr['src'];
if ( get_post_meta( get_the_ID(), '_grid_type_value', true ) !== 'Portrait' ) {
$attr['data-sizes'] = 'auto';
}
}
}
if ( $full_size = wp_get_attachment_metadata( $attachment->ID ) ) {
$attr['data-full-size'] = $full_size['width'].'x'.$full_size['height'];
}
return $attr;
}
}

View File

@@ -0,0 +1,218 @@
<?php
add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' );
add_filter( 'pt-ocdi/regenerate_thumbnails_in_content_import', '__return_false' );
if ( ! function_exists( 'kktfwp_import_files' ) ) :
function kktfwp_import_files() {
return array(
array(
'import_file_name' => 'Pioniq Demo',
'import_file_url' => 'http://easysite.by/temp/toppic/Pioniq.xml',
'import_widget_file_url' => 'http://easysite.by/temp/toppic/toppic-demo-widgets.wie',
'import_preview_image_url' => 'http://themes.easysite.by/toppic-overview/img/demo6.jpg',
'import_notice' => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'toppic' ),
),
array(
'import_file_name' => 'Cremona Demo',
'import_file_url' => 'http://easysite.by/temp/toppic/Cremona.xml',
'import_widget_file_url' => 'http://easysite.by/temp/toppic/toppic-demo-widgets.wie',
'import_preview_image_url' => 'http://themes.easysite.by/toppic-overview/img/demo4.jpg',
'import_notice' => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'toppic' ),
),
array(
'import_file_name' => 'Florrie Demo',
'import_file_url' => 'http://easysite.by/temp/toppic/Florrie.xml',
'import_widget_file_url' => 'http://easysite.by/temp/toppic/toppic-demo-widgets.wie',
'import_preview_image_url' => 'http://themes.easysite.by/toppic-overview/img/demo1.jpg',
'import_notice' => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'toppic' ),
),
array(
'import_file_name' => 'Swory Demo',
'import_file_url' => 'http://easysite.by/temp/toppic/Swory.xml',
'import_widget_file_url' => 'http://easysite.by/temp/toppic/toppic-demo-widgets.wie',
'import_preview_image_url' => 'http://themes.easysite.by/toppic-overview/img/demo2.jpg',
'import_notice' => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'toppic' ),
),
array(
'import_file_name' => 'Frezo Demo',
'import_file_url' => 'http://easysite.by/temp/toppic/Frezo.xml',
'import_widget_file_url' => 'http://easysite.by/temp/toppic/toppic-demo-widgets.wie',
'import_preview_image_url' => 'http://themes.easysite.by/toppic-overview/img/demo3.jpg',
'import_notice' => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'toppic' ),
),
array(
'import_file_name' => 'Aminio Demo',
'import_file_url' => 'http://easysite.by/temp/toppic/Aminio.xml',
'import_widget_file_url' => 'http://easysite.by/temp/toppic/toppic-demo-widgets.wie',
'import_preview_image_url' => 'http://themes.easysite.by/toppic-overview/img/demo5.jpg',
'import_notice' => __( 'Please waiting for a few minutes, do not close the window or refresh the page until the data is imported.', 'toppic' ),
),
);
}
add_filter( 'pt-ocdi/import_files', 'kktfwp_import_files' );
endif;
if ( ! function_exists( 'kktfwp_after_import' ) ) :
function kktfwp_after_import( $selected_import ) {
$demo = $selected_import['import_file_name'];
switch ($demo) {
case 'Frezo Demo':
//Set Menu
$top_menu = get_term_by( 'name', 'Main menu', 'nav_menu' );
set_theme_mod( 'nav_menu_locations' , array(
'main-menu' => $top_menu->term_id
)
);
// Assign front page and posts page (blog page).
$front_page_id = get_page_by_title( 'Home' );
$blog_page_id = get_page_by_title( 'Blog' );
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
update_option( 'page_for_posts', $blog_page_id->ID );
// Set theme settings
update_option( 'toppic_theme_menu_style', 'kk-menu-left-boxed' );
update_option( 'toppic_theme_menu_opacity', '0.85' );
update_option( 'toppic_theme_fullscreen_stream', 'ken_b' );
update_option( 'toppic_theme_custom_css', '.content.kk-is-homecaption .content-inner-wrapper {vertical-align: bottom;}' );
break;
case 'Pioniq Demo':
//Set Menu
$top_menu = get_term_by( 'name', 'Main menu', 'nav_menu' );
$footer_menu = get_term_by( 'name', 'Footer menu', 'nav_menu' );
set_theme_mod( 'nav_menu_locations' , array(
'main-menu' => $top_menu->term_id,
'footer-menu' => $footer_menu->term_id
)
);
// Assign front page and posts page (blog page).
$front_page_id = get_page_by_title( 'Home' );
$blog_page_id = get_page_by_title( 'Blog' );
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
update_option( 'page_for_posts', $blog_page_id->ID );
// Set theme settings
update_option( 'toppic_theme_menu_style', 'kk-menu-classic' );
update_option( 'toppic_theme_content_style', 'kk-full' );
update_option( 'toppic_theme_kk_page_anim', 'true' );
update_option( 'toppic_theme_smooth_scroll', 'false' );
update_option( 'toppic_theme_search_button', 'false' );
update_option( 'toppic_theme_fullscreen_stream', 'kk_royal' );
break;
case 'Cremona Demo':
//Set Menu
$top_menu = get_term_by( 'name', 'Main menu', 'nav_menu' );
$footer_menu = get_term_by( 'name', 'Footer menu', 'nav_menu' );
set_theme_mod( 'nav_menu_locations' , array(
'main-menu' => $top_menu->term_id,
'footer-menu' => $footer_menu->term_id
)
);
// Assign front page and posts page (blog page).
$front_page_id = get_page_by_title( 'Home' );
$blog_page_id = get_page_by_title( 'Blog' );
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
update_option( 'page_for_posts', $blog_page_id->ID );
// Set theme settings
update_option( 'toppic_theme_menu_style', 'kk-menu-slide-right' );
update_option( 'toppic_theme_content_style', 'kk-full' );
update_option( 'toppic_theme_kk_page_anim', 'false' );
update_option( 'toppic_theme_fullscreen_stream', 'kk_royal' );
update_option( 'toppic_theme_custom_css', '.kk_menu_slide_right.kk-content-fullwidth .content.kk-is-homecaption {text-align: center;}' );
break;
case 'Florrie Demo':
//Set Menu
$top_menu = get_term_by( 'name', 'Main menu', 'nav_menu' );
$footer_menu = get_term_by( 'name', 'Footer menu', 'nav_menu' );
set_theme_mod( 'nav_menu_locations' , array(
'main-menu' => $top_menu->term_id,
'footer-menu' => $footer_menu->term_id
)
);
// Assign front page and posts page (blog page).
$front_page_id = get_page_by_title( 'Home' );
$blog_page_id = get_page_by_title( 'Blog' );
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
update_option( 'page_for_posts', $blog_page_id->ID );
// Set theme settings
update_option( 'toppic_theme_content_style', 'kk-full' );
update_option( 'toppic_theme_fullscreen_stream', 'kk_royal' );
break;
case 'Swory Demo':
//Set Menu
$top_menu = get_term_by( 'name', 'Main menu', 'nav_menu' );
$footer_menu = get_term_by( 'name', 'Footer menu', 'nav_menu' );
set_theme_mod( 'nav_menu_locations' , array(
'main-menu' => $top_menu->term_id,
'footer-menu' => $footer_menu->term_id
)
);
// Assign front page and posts page (blog page).
$front_page_id = get_page_by_title( 'Home' );
$blog_page_id = get_page_by_title( 'Blog' );
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
update_option( 'page_for_posts', $blog_page_id->ID );
// Set theme settings
update_option( 'toppic_theme_menu_style', 'kk-menu-default-hidden' );
update_option( 'toppic_theme_content_style', 'kk-full' );
break;
case 'Aminio Demo':
//Set Menu
$top_menu = get_term_by( 'name', 'Main menu', 'nav_menu' );
set_theme_mod( 'nav_menu_locations' , array(
'main-menu' => $top_menu->term_id,
)
);
// Assign front page and posts page (blog page).
$front_page_id = get_page_by_title( 'Home' );
$blog_page_id = get_page_by_title( 'Blog' );
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
update_option( 'page_for_posts', $blog_page_id->ID );
// Set theme settings
update_option( 'toppic_theme_menu_style', 'kk-menu-fullscreen' );
update_option( 'toppic_theme_content_style', 'kk-boxed' );
break;
}
}
add_action( 'pt-ocdi/after_import', 'kktfwp_after_import' );
endif;

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden. And we agree :)

Binary file not shown.

BIN
includes/plugins/kk-cpt.zip Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

110
includes/vc-func.php Normal file
View File

@@ -0,0 +1,110 @@
<?php
/*-----------------------------------------------------------------------------------*/
/* List of post types for which Visual Composer should be available by default
/*-----------------------------------------------------------------------------------*/
$list = array(
'page',
'gallery',
'portfolio'
);
//vc_editor_set_post_types( $list );
/* --- Removing shortcodes --- */
vc_remove_element("vc_widget_sidebar");
vc_remove_element("vc_wp_search");
vc_remove_element("vc_wp_meta");
vc_remove_element("vc_wp_recentcomments");
vc_remove_element("vc_wp_calendar");
vc_remove_element("vc_wp_pages");
vc_remove_element("vc_wp_tagcloud");
vc_remove_element("vc_wp_custommenu");
vc_remove_element("vc_wp_text");
vc_remove_element("vc_wp_posts");
vc_remove_element("vc_wp_links");
vc_remove_element("vc_wp_categories");
vc_remove_element("vc_wp_archives");
vc_remove_element("vc_wp_rss");
//vc_remove_element("vc_btn");
vc_remove_element("vc_masonry_grid");
vc_remove_element("vc_basic_grid");
vc_remove_element("vc_posts_slider");
vc_remove_element("woocommerce_cart");
$attributes_vc_gallery = array(
'type' => 'dropdown',
'heading' => __( 'On click', 'toppic' ),
'param_name' => 'onclick',
'value' => array(
__( 'Open lightbox', 'toppic' ) => 'link_image',
__( 'Do nothing', 'toppic' ) => 'link_no',
__( 'Open custom link', 'toppic' ) => 'custom_link'
),
'description' => __( 'Define action for onclick event if needed.', 'toppic' )
);
vc_add_param( 'vc_gallery', $attributes_vc_gallery, 1 );
$attributes_vc_images_carousel = array(
'type' => 'dropdown',
'heading' => __( 'On click', 'toppic' ),
'param_name' => 'onclick',
'value' => array(
__( 'Open lightbox', 'toppic' ) => 'link_image',
__( 'Do nothing', 'toppic' ) => 'link_no',
__( 'Open custom link', 'toppic' ) => 'custom_link'
),
'description' => __( 'What to do when slide is clicked?', 'toppic' )
);
vc_add_param( 'vc_images_carousel', $attributes_vc_images_carousel, 1 );
/* --- Button shortcode--- */
vc_map( array(
'name' => __( 'Button', 'toppic' ),
'base' => 'kk_button',
'icon' => 'icon-wpb-ui-button',
'category' => __( 'Content', 'toppic' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => __( 'Text', 'toppic' ),
'save_always' => true,
'param_name' => 'title',
'value' => __( 'Text on the button', 'toppic' ),
),
array(
'type' => 'vc_link',
'heading' => __( 'URL (Link)', 'toppic' ),
'param_name' => 'link',
'description' => __( 'Add link to button.', 'toppic' ),
// compatible with btn2 and converted from href{btn1}
),
array(
'type' => 'dropdown',
'heading' => __( 'Size', 'toppic' ),
'param_name' => 'size',
'description' => __( 'Select button display size.', 'toppic' ),
// compatible with btn2, default md, but need to be converted from btn1 to btn2
'std' => 'kk-me',
'value' => array(
__( 'Large', 'toppic' ) => 'kk-lg',
__( 'Medium', 'toppic' ) => 'kk-me',
__( 'Small', 'toppic' ) => 'kk-sm',
),
),
),
));
?>