<?php
/**
- Plugin Name: Dodatkowe Ustawienia FullFrame
- Description: Rozbudowa panelu Dostosuj o sekcje podstawowe i zaawansowane slidera. Wymusza poprawne centrowanie, pozycję kropek oraz układ mobile.
- Version: 12.6
- Author: www.foto-chwile.pl, MK & AI
*/
if (!defined(’ABSPATH’)) exit;
/* ==========================================================================
- INTEGRACJA Z CUSTOMIZEREM (WYGLĄD -> DOSTOSUJ)
========================================================================== */
add_action(’customize_register’, 'ff_mk_kombajn_v12_6_customizer’);
function ff_mk_kombajn_v12_6_customizer($wp_customize) { // ———————————————————————-
// SEKCJA 1: USTAWIENIA PODSTAWOWE
// ———————————————————————-
$wp_customize->add_section(’ff_mk_podstawowe_section’, array(
’title’ => '* 1. Ustawienia podstawowe FF’,
’priority’ => 25,
)); function ff_reg_slider_percent_v12_6($wp_customize, $id, $label, $default, $min = 30, $max = 100, $section = 'ff_mk_podstawowe_section’) {
$wp_customize->add_setting($id, array(’default’ => $default, 'sanitize_callback’ => 'absint’, 'transport’ => 'refresh’));
$wp_customize->add_control($id, array(
’label’ => $label,
’section’ => $section,
’type’ => 'range’,
’input_attrs’ => array(’min’ => $min, 'max’ => $max, 'step’ => 1),
’description’ => 'Aktualna wartość: ’ . get_theme_mod($id, $default) . '%’
));
} // Naglowek Desktop
$wp_customize->add_setting(’ff_mk_h1′, array(’sanitize_callback’ => 'sanitize_text_field’));
$wp_customize->add_control(’ff_mk_h1_ctrl’, array(
’label’ => '=== OPCJE DLA DESKTOP / PC ===’,
’section’ => 'ff_mk_podstawowe_section’,
’settings’ => 'ff_mk_h1′,
’type’ => 'hidden’,
’description’ => 'USTAWIENIA EKRANÓW KOMPUTEROWYCH (POZIOMYCH)’
));
ff_reg_slider_percent_v12_6($wp_customize, 'ff_width_h’, 'Szerokość strony (Poziome)’, 85); $wp_customize->add_setting(’ff_bg_color_h’, array(’default’ => '#ffffff’, 'sanitize_callback’ => 'sanitize_hex_color’));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'ff_bg_color_h_ctrl’, array(’label’ => 'Kolor tła (Desktop)’, 'section’ => 'ff_mk_podstawowe_section’, 'settings’=> 'ff_bg_color_h’)));
$wp_customize->add_setting(’ff_font_color_h’, array(’default’ => '#333333′, 'sanitize_callback’ => 'sanitize_hex_color’));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'ff_font_color_h_ctrl’, array(’label’ => 'Kolor czcionki (Desktop)’, 'section’ => 'ff_mk_podstawowe_section’, 'settings’=> 'ff_font_color_h’))); // Naglowek Mobile
$wp_customize->add_setting(’ff_mk_h2′, array(’sanitize_callback’ => 'sanitize_text_field’));
$wp_customize->add_control(’ff_mk_h2_ctrl’, array(
’label’ => '=== OPCJE DLA MOBILE / TELEFON ===’,
’section’ => 'ff_mk_podstawowe_section’,
’settings’ => 'ff_mk_h2′,
’type’ => 'hidden’,
’description’ => 'USTAWIENIA EKRANÓW TELEFONÓW (PIONOWYCH)’
));
ff_reg_slider_percent_v12_6($wp_customize, 'ff_width_v’, 'Szerokość strony (Pionowe)’, 100); $wp_customize->add_setting(’ff_bg_color_v’, array(’default’ => '#ffffff’, 'sanitize_callback’ => 'sanitize_hex_color’));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'ff_bg_color_v_ctrl’, array(’label’ => 'Kolor tła (Mobile)’, 'section’ => 'ff_mk_podstawowe_section’, 'settings’=> 'ff_bg_color_v’)));
$wp_customize->add_setting(’ff_font_color_v’, array(’default’ => '#333333′, 'sanitize_callback’ => 'sanitize_hex_color’));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'ff_font_color_v_ctrl’, array(’label’ => 'Kolor czcionki (Mobile)’, 'section’ => 'ff_mk_podstawowe_section’, 'settings’=> 'ff_font_color_v’))); // Naglowek Nawigacja
$wp_customize->add_setting(’ff_mk_h3′, array(’sanitize_callback’ => 'sanitize_text_field’));
$wp_customize->add_control(’ff_mk_h3_ctrl’, array(
’label’ => '=== NAWIGACJA I LOGO ===’,
’section’ => 'ff_mk_podstawowe_section’,
’settings’ => 'ff_mk_h3′,
’type’ => 'hidden’,
’description’ => 'NAGŁÓWEK GŁÓWNY STRONY’
));
$wp_customize->add_setting(’ff_bar_color’, array(’default’ => '#ffffff’, 'sanitize_callback’ => 'sanitize_hex_color’));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'ff_bar_color_ctrl’, array(’label’ => 'Kolor paska logo/menu’, 'section’ => 'ff_mk_podstawowe_section’, 'settings’=> 'ff_bar_color’)));
ff_reg_slider_percent_v12_6($wp_customize, 'ff_bar_opacity’, 'Transparentność paska logo’, 100); // ———————————————————————-
// SEKCJA 2: ZAAWANSOWANE USTAWIENIA SLIDERA
// ———————————————————————-
$wp_customize->add_section(’ff_mk_slider_section’, array(
’title’ => '* 2. Ustawienia slidera FF’,
’priority’ => 26,
)); function ff_reg_slider_px_v12_6($wp_customize, $id, $label, $default, $min = 0, $max = 200, $section = 'ff_mk_slider_section’) {
$wp_customize->add_setting($id, array(’default’ => $default, 'sanitize_callback’ => 'absint’, 'transport’ => 'refresh’));
$wp_customize->add_control($id, array(
’label’ => $label,
’section’ => $section,
’type’ => 'range’,
’input_attrs’ => array(’min’ => $min, 'max’ => $max, 'step’ => 1),
’description’ => 'Aktualna wartość: ’ . get_theme_mod($id, $default) . 'px’
));
} // Geometria Desktop
$wp_customize->add_setting(’ff_slider_sep_geo_h’, array(’sanitize_callback’ => 'sanitize_text_field’));
$wp_customize->add_control(’ff_slider_sep_geo_h_ctrl’, array(
’label’ => '=== GEOMETRIA SLIDERA – DESKTOP ===’,
’section’ => 'ff_mk_slider_section’,
’settings’ => 'ff_slider_sep_geo_h’,
’type’ => 'hidden’,
’description’ => 'WYMIARY NA KOMPUTERY’
));
ff_reg_slider_percent_v12_6($wp_customize, 'ff_slider_width_h’, 'SZEROKOŚĆ Slidera (Desktop)’, 100, 30, 130, 'ff_mk_slider_section’);
ff_reg_slider_px_v12_6($wp_customize, 'ff_slider_height_h’, 'MAX WYSOKOŚĆ Slidera (Desktop)’, 452, 100, 1200, 'ff_mk_slider_section’);
ff_reg_slider_px_v12_6($wp_customize, 'ff_slider_margin_h’, 'Odstęp slidera od góry (Desktop)’, 45, 0, 200, 'ff_mk_slider_section’); // Geometria Mobile
$wp_customize->add_setting(’ff_slider_sep_geo_v’, array(’sanitize_callback’ => 'sanitize_text_field’));
$wp_customize->add_control(’ff_slider_sep_geo_v_ctrl’, array(
’label’ => '=== GEOMETRIA SLIDERA – MOBILE ===’,
’section’ => 'ff_mk_slider_section’,
’settings’ => 'ff_slider_sep_geo_v’,
’type’ => 'hidden’,
’description’ => 'WYMIARY NA TELEFONY’
));
ff_reg_slider_percent_v12_6($wp_customize, 'ff_slider_width_v’, 'SZEROKOŚĆ Slidera (Mobile)’, 100, 30, 100, 'ff_mk_slider_section’);
ff_reg_slider_px_v12_6($wp_customize, 'ff_slider_height_v’, 'MAX WYSOKOŚĆ Slidera (Mobile)’, 232, 100, 1000, 'ff_mk_slider_section’);
ff_reg_slider_px_v12_6($wp_customize, 'ff_slider_margin_v’, 'Odstęp slidera od góry (Mobile)’, 34, 0, 200, 'ff_mk_slider_section’); // Sterowanie i dodatki
$wp_customize->add_setting(’ff_sep_1′, array(’sanitize_callback’ => 'sanitize_text_field’));
$wp_customize->add_control(’ff_sep_1_ctrl’, array(
’label’ => '=== STRZAŁKI I KROPKI NAWIGACJI ===’,
’section’ => 'ff_mk_slider_section’,
’settings’ => 'ff_sep_1′,
’type’ => 'hidden’,
’description’ => ”
)); $wp_customize->add_setting(’ff_slider_nav_show’, array(’default’ => 'on’, 'sanitize_callback’ => 'sanitize_text_field’, 'transport’ => 'refresh’));
$wp_customize->add_control(’ff_slider_nav_show_ctrl’, array(
’label’ => 'Boczne strzałki nawigacji’,
’section’ => 'ff_mk_slider_section’,
’settings’ => 'ff_slider_nav_show’,
’type’ => 'radio’,
’choices’ => array(’on’ => 'Włączone’, 'off’ => 'Ukryte’)
)); $wp_customize->add_setting(’ff_slider_arrow_style’, array(’default’ => 'style1′, 'sanitize_callback’ => 'sanitize_text_field’, 'transport’ => 'refresh’));
$wp_customize->add_control(’ff_slider_arrow_style_ctrl’, array(
’label’ => 'Styl strzałek bocznych’,
’section’ => 'ff_mk_slider_section’,
’settings’ => 'ff_slider_arrow_style’,
’type’ => 'select’,
’choices’ => array(
’style1′ => 'Standardowe (Fabryczne)’,
’style2′ => 'Minimalistyczne i cienkie (Eleganckie)’,
’style3′ => 'Nowoczesne okrągłe z tłem’,
’style5′ => 'Białe czyste trójkąty’,
’style6′ => 'Malutkie podwójne << oraz >>’
)
)); $wp_customize->add_setting(’ff_slider_pager_show’, array(’default’ => 'on’, 'sanitize_callback’ => 'sanitize_text_field’, 'transport’ => 'refresh’));
$wp_customize->add_control(’ff_slider_pager_show_ctrl’, array(
’label’ => 'Dolne kropki (Status zdjęć)’,
’section’ => 'ff_mk_slider_section’,
’settings’ => 'ff_slider_pager_show’,
’type’ => 'radio’,
’choices’ => array(’on’ => 'Włączone (Pokazuj)’, 'off’ => 'Ukryte’)
)); $wp_customize->add_setting(’ff_slider_pager_style’, array(’default’ => 'p_style1′, 'sanitize_callback’ => 'sanitize_text_field’, 'transport’ => 'refresh’));
$wp_customize->add_control(’ff_slider_pager_style_ctrl’, array(
’label’ => 'Styl dolnych kropek’,
’section’ => 'ff_mk_slider_section’,
’settings’ => 'ff_slider_pager_style’,
’type’ => 'select’,
’choices’ => array(
’p_style1′ => 'Klasyczne duże kropki (Szary/Biel)’,
’p_style2′ => 'Nowoczesne mini-okręgi z obwódką’,
’p_style3′ => 'Eleganckie cienkie poziome kreseczki’,
’p_style4′ => 'Wyraziste punkty (Czerń / Pomarańcz)’,
’p_style5′ => 'Minimalistyczne malutkie kropeczki’
)
)); $wp_customize->add_setting(’ff_slider_title_show’, array(’default’ => 'on’, 'sanitize_callback’ => 'sanitize_text_field’, 'transport’ => 'refresh’));
$wp_customize->add_control(’ff_slider_title_show_ctrl’, array(
’label’ => 'Tytuły i opisy na sliderze’,
’section’ => 'ff_mk_slider_section’,
’settings’ => 'ff_slider_title_show’,
’type’ => 'radio’,
’choices’ => array(’on’ => 'Pokazuj teksty’, 'off’ => 'Ukryj teksty’)
)); $wp_customize->add_setting(’ff_slider_text_shadow’, array(’default’ => 'off’, 'sanitize_callback’ => 'sanitize_text_field’, 'transport’ => 'refresh’));
$wp_customize->add_control(’ff_slider_text_shadow_ctrl’, array(’label’ => 'Kinowy cień pod tekstem slidera’, 'section’ => 'ff_mk_slider_section’, 'settings’ => 'ff_slider_text_shadow’, 'type’ => 'checkbox’)); $wp_customize->add_setting(’ff_slider_ken_burns’, array(’default’ => 'off’, 'sanitize_callback’ => 'sanitize_text_field’, 'transport’ => 'refresh’));
$wp_customize->add_control(’ff_slider_ken_burns_ctrl’, array(’label’ => 'Efekt premium: Powolny Zoom zdjęć’, 'section’ => 'ff_mk_slider_section’, 'settings’ => 'ff_slider_ken_burns’, 'type’ => 'checkbox’));
}
/* ==========================================================================
- LIVE JAVASCRIPT DLA PANELU KOKPITU ========================================================================== */ add_action(’customize_controls_print_footer_scripts’, 'ff_mk_kombajn_v12_6_script’); function ff_mk_kombajn_v12_6_script() { ?><?php }
function ff_v12_6_hex2rgba($hex, $opacityProcent) {
$hex = str_replace(„#”, „”, $hex);
if(strlen($hex) == 3) {
$r = hexdec(substr($hex,0,1).substr($hex,0,1));
$g = hexdec(substr($hex,1,1).substr($hex,1,1));
$b = hexdec(substr($hex,2,1).substr($hex,2,1));
} else {
$r = hexdec(substr($hex,0,2));
$g = hexdec(substr($hex,2,2));
$b = hexdec(substr($hex,4,2));
}
return „rgba({$r}, {$g}, {$b}, ” . ($opacityProcent / 100) . „)”;
}
/* ==========================================================================
GENEROWANIE CSS NA FRONT-ENDZIE
========================================================================== */
add_action(’wp_head’, 'ff_mk_kombajn_v12_6_render_css’, 999);
function ff_mk_kombajn_v12_6_render_css() {
$width_h = get_theme_mod(’ff_width_h’, 85);
$bg_color_h = get_theme_mod(’ff_bg_color_h’, '#ffffff’);
$font_color_h = get_theme_mod(’ff_font_color_h’, '#333333′);
$width_v = get_theme_mod(’ff_width_v’, 100);
$bg_color_v = get_theme_mod(’ff_bg_color_v’, '#ffffff’);
$font_color_v = get_theme_mod(’ff_font_color_v’, '#333333′);
$bar_color = get_theme_mod(’ff_bar_color’, '#ffffff’);
$bar_opacity = get_theme_mod(’ff_bar_opacity’, 100); $slider_w_h = get_theme_mod(’ff_slider_width_h’, 100);
$slider_h_h = get_theme_mod(’ff_slider_height_h’, 452);
$slider_w_v = get_theme_mod(’ff_slider_width_v’, 100);
$slider_h_v = get_theme_mod(’ff_slider_height_v’, 232); $slider_margin_h = get_theme_mod(’ff_slider_margin_h’, 45);
$slider_margin_v = get_theme_mod(’ff_slider_margin_v’, 0); $slider_nav = get_theme_mod(’ff_slider_nav_show’, 'on’);
$arrow_style = get_theme_mod(’ff_slider_arrow_style’, 'style1′);
$slider_pager = get_theme_mod(’ff_slider_pager_show’, 'on’);
$pager_style = get_theme_mod(’ff_slider_pager_style’, 'p_style1′); $slider_title = get_theme_mod(’ff_slider_title_show’, 'on’);
$text_shadow = get_theme_mod(’ff_slider_text_shadow’, 'off’);
$ken_burns = get_theme_mod(’ff_slider_ken_burns’, 'off’); $rgba_bar_color = ff_v12_6_hex2rgba($bar_color, $bar_opacity); echo „\n\n\n\n”;
}
Wciśnij / aby wybrać blok
