Refactor code structure for improved readability and maintainability
This commit is contained in:
238
.htaccess
238
.htaccess
@@ -1,10 +1,10 @@
|
||||
AddHandler application/x-httpd-php80 .php
|
||||
# BEGIN LSCACHE
|
||||
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
|
||||
<IfModule LiteSpeed>
|
||||
RewriteEngine on
|
||||
CacheLookup on
|
||||
RewriteRule .* - [E=Cache-Control:no-autoflush]
|
||||
RewriteRule litespeed/debug/.*\.log$ - [F,L]
|
||||
RewriteRule \.litespeed_conf\.dat - [F,L]
|
||||
|
||||
### marker ASYNC start ###
|
||||
@@ -18,15 +18,10 @@ RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Min
|
||||
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismobile]
|
||||
### marker MOBILE end ###
|
||||
|
||||
### marker CACHE RESOURCE start ###
|
||||
RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
|
||||
### marker CACHE RESOURCE end ###
|
||||
|
||||
### marker WEBP start ###
|
||||
RewriteCond %{HTTP_ACCEPT} "image/webp"
|
||||
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
|
||||
RewriteCond %{HTTP_USER_AGENT} iPhone.*Version/(\d{2}).*Safari
|
||||
RewriteCond %1 >13
|
||||
RewriteCond %{HTTP_ACCEPT} image/webp [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} iPhone.*Version/(1[4-9]|[2-9][0-9]|[1-9][0-9]{2,}).*Safari [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} Firefox/([6-9][0-9]|[1-9][0-9]{2,})
|
||||
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
|
||||
### marker WEBP end ###
|
||||
|
||||
@@ -55,6 +50,7 @@ ExpiresByType image/jpeg A31557600
|
||||
ExpiresByType image/png A31557600
|
||||
ExpiresByType image/gif A31557600
|
||||
ExpiresByType image/webp A31557600
|
||||
ExpiresByType image/avif A31557600
|
||||
|
||||
ExpiresByType video/ogg A31557600
|
||||
ExpiresByType audio/ogg A31557600
|
||||
@@ -81,218 +77,8 @@ ExpiresByType font/woff2 A31557600
|
||||
|
||||
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
|
||||
# END NON_LSCACHE
|
||||
|
||||
<FilesMatch "\.(?i:pdf)$">
|
||||
ForceType application/octet-stream
|
||||
Header set Content-Disposition attachment
|
||||
</FilesMatch>
|
||||
|
||||
Redirect 301 /ods https://forms.gle/o6Wtr8uUehkCvvdMA
|
||||
|
||||
|
||||
# # WEB PERFORMANCE
|
||||
|
||||
# Remove `ETags` as resources are sent with far-future expires headers.
|
||||
# `FileETag None` doesn't work in all cases.
|
||||
<IfModule mod_headers.c>
|
||||
Header unset ETag
|
||||
</IfModule>
|
||||
|
||||
FileETag None
|
||||
|
||||
# Serve resources with far-future expires headers.
|
||||
<IfModule mod_expires.c>
|
||||
ExpiresActive on
|
||||
ExpiresDefault "access plus 1 month"
|
||||
ExpiresByType text/css "access plus 1 year"
|
||||
ExpiresByType application/atom+xml "access plus 1 hour"
|
||||
ExpiresByType application/rdf+xml "access plus 1 hour"
|
||||
ExpiresByType application/rss+xml "access plus 1 hour"
|
||||
ExpiresByType application/json "access plus 0 seconds"
|
||||
ExpiresByType application/ld+json "access plus 0 seconds"
|
||||
ExpiresByType application/schema+json "access plus 0 seconds"
|
||||
ExpiresByType application/vnd.geo+json "access plus 0 seconds"
|
||||
ExpiresByType application/xml "access plus 0 seconds"
|
||||
ExpiresByType text/xml "access plus 0 seconds"
|
||||
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
|
||||
ExpiresByType image/x-icon "access plus 1 week"
|
||||
ExpiresByType text/html "access plus 0 seconds"
|
||||
ExpiresByType application/javascript "access plus 1 year"
|
||||
ExpiresByType application/x-javascript "access plus 1 year"
|
||||
ExpiresByType text/javascript "access plus 1 year"
|
||||
ExpiresByType application/manifest+json "access plus 1 week"
|
||||
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
|
||||
ExpiresByType text/cache-manifest "access plus 0 seconds"
|
||||
ExpiresByType audio/ogg "access plus 1 month"
|
||||
ExpiresByType image/bmp "access plus 1 month"
|
||||
ExpiresByType image/gif "access plus 1 month"
|
||||
ExpiresByType image/jpeg "access plus 9 months"
|
||||
ExpiresByType image/png "access plus 9 months"
|
||||
ExpiresByType image/svg+xml "access plus 9 months"
|
||||
ExpiresByType image/webp "access plus 9 months"
|
||||
ExpiresByType video/mp4 "access plus 1 month"
|
||||
ExpiresByType video/ogg "access plus 1 month"
|
||||
ExpiresByType video/webm "access plus 1 month"
|
||||
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
|
||||
ExpiresByType font/eot "access plus 9 months"
|
||||
ExpiresByType font/opentype "access plus 9 months"
|
||||
ExpiresByType application/x-font-ttf "access plus 9 months"
|
||||
ExpiresByType application/font-woff "access plus 9 months"
|
||||
ExpiresByType application/x-font-woff "access plus 9 months"
|
||||
ExpiresByType font/woff "access plus 9 months"
|
||||
ExpiresByType application/font-woff2 "access plus 9 months"
|
||||
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
|
||||
</IfModule>
|
||||
|
||||
|
||||
|
||||
# # MEDIA TYPES AND CHARACTER ENCODINGS
|
||||
|
||||
# Serve resources with the proper media types (f.k.a. MIME types).
|
||||
<IfModule mod_mime.c>
|
||||
AddType application/atom+xml atom
|
||||
AddType application/json json map topojson
|
||||
AddType application/ld+json jsonld
|
||||
AddType application/rss+xml rss
|
||||
AddType application/vnd.geo+json geojson
|
||||
AddType application/xml rdf xml
|
||||
AddType application/javascript js
|
||||
AddType application/manifest+json webmanifest
|
||||
AddType application/x-web-app-manifest+json webapp
|
||||
AddType text/cache-manifest appcache
|
||||
AddType audio/mp4 f4a f4b m4a
|
||||
AddType audio/ogg oga ogg opus
|
||||
AddType image/bmp bmp
|
||||
AddType image/svg+xml svg svgz
|
||||
AddType image/webp webp
|
||||
AddType video/mp4 f4v f4p m4v mp4
|
||||
AddType video/ogg ogv
|
||||
AddType video/webm webm
|
||||
AddType video/x-flv flv
|
||||
AddType image/x-icon cur ico
|
||||
AddType application/font-woff woff
|
||||
AddType application/font-woff2 woff2
|
||||
AddType application/vnd.ms-fontobject eot
|
||||
AddType application/x-font-ttf ttc ttf
|
||||
AddType font/opentype otf
|
||||
AddType application/octet-stream safariextz
|
||||
AddType application/x-bb-appworld bbaw
|
||||
AddType application/x-chrome-extension crx
|
||||
AddType application/x-opera-extension oex
|
||||
AddType application/x-xpinstall xpi
|
||||
AddType text/vcard vcard vcf
|
||||
AddType text/vnd.rim.location.xloc xloc
|
||||
AddType text/vtt vtt
|
||||
AddType text/x-component htc
|
||||
</IfModule>
|
||||
|
||||
# Serve all resources labeled as `text/html` or `text/plain`
|
||||
# with the media type `charset` parameter set to `UTF-8`.
|
||||
AddDefaultCharset utf-8
|
||||
|
||||
# Serve the following file types with the media type `charset`
|
||||
# parameter set to `UTF-8`.
|
||||
<IfModule mod_mime.c>
|
||||
AddCharset utf-8 .atom \
|
||||
.bbaw \
|
||||
.css \
|
||||
.geojson \
|
||||
.js \
|
||||
.json \
|
||||
.jsonld \
|
||||
.manifest \
|
||||
.rdf \
|
||||
.rss \
|
||||
.topojson \
|
||||
.vtt \
|
||||
.webapp \
|
||||
.webmanifest \
|
||||
.xloc \
|
||||
.xml
|
||||
</IfModule>
|
||||
|
||||
|
||||
|
||||
# # SECURITY
|
||||
|
||||
|
||||
|
||||
# Block access to all hidden files and directories with the exception of
|
||||
# the visible content from within the `/.well-known/` hidden directory.
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} "!(^|/)\.well-known/([^./]+./?)+$" [NC]
|
||||
RewriteCond %{SCRIPT_FILENAME} -d [OR]
|
||||
RewriteCond %{SCRIPT_FILENAME} -f
|
||||
RewriteRule "(^|/)\." - [F]
|
||||
</IfModule>
|
||||
|
||||
# Block access to files that can expose sensitive information.
|
||||
<FilesMatch "(^#.*#|\.(bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$">
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
</FilesMatch>
|
||||
|
||||
# Prevent some browsers from MIME-sniffing the response.
|
||||
<IfModule mod_headers.c>
|
||||
Header set X-Content-Type-Options "nosniff"
|
||||
</IfModule>
|
||||
|
||||
# Remove the `X-Powered-By` response header
|
||||
<IfModule mod_headers.c>
|
||||
Header unset X-Powered-By
|
||||
</IfModule>
|
||||
|
||||
# Prevent Apache from adding a trailing footer line containing
|
||||
# information about the server to the server-generated documents
|
||||
ServerSignature Off
|
||||
|
||||
|
||||
|
||||
# Force Internet Explorer 8/9/10 to render pages in the highest mode
|
||||
# available in the various cases when it may not.
|
||||
<IfModule mod_headers.c>
|
||||
Header set X-UA-Compatible "IE=edge"
|
||||
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
|
||||
Header unset X-UA-Compatible
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
|
||||
|
||||
|
||||
# Allow cross-origin access to web fonts.
|
||||
<IfModule mod_headers.c>
|
||||
<FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
|
||||
Header set Access-Control-Allow-Origin "*"
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
|
||||
|
||||
|
||||
# Disable the pattern matching based on filenames.
|
||||
Options -MultiViews
|
||||
|
||||
|
||||
# Force client-side SSL redirection.
|
||||
<IfModule mod_headers.c>
|
||||
Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains"
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_deflate.c>
|
||||
AddOutputFilterByType DEFLATE text/plain
|
||||
AddOutputFilterByType DEFLATE text/html
|
||||
AddOutputFilterByType DEFLATE text/xml
|
||||
AddOutputFilterByType DEFLATE text/shtml
|
||||
AddOutputFilterByType DEFLATE text/css
|
||||
AddOutputFilterByType DEFLATE application/xml
|
||||
AddOutputFilterByType DEFLATE application/xhtml+xml
|
||||
AddOutputFilterByType DEFLATE application/rss+xml
|
||||
AddOutputFilterByType DEFLATE application/javascript
|
||||
AddOutputFilterByType DEFLATE application/x-javascript
|
||||
</IfModule>
|
||||
|
||||
|
||||
# This file was updated by Duplicator Pro on 2025-08-25 12:41:13.
|
||||
# See the original_files_ folder for the original source_site_htaccess file.
|
||||
# BEGIN WordPress
|
||||
# Dyrektywy zawarte między „BEGIN WordPress” oraz „END WordPress” są generowane dynamicznie i powinny być modyfikowane tylko za pomocą
|
||||
# filtrów WordPressa. Zmiany dokonane bezpośrednio tutaj będą nadpisywane.
|
||||
@@ -306,12 +92,4 @@ RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . /index.php [L]
|
||||
</IfModule>
|
||||
|
||||
# END WordPress
|
||||
# BEGIN LiteSpeed
|
||||
# Dyrektywy zawarte między "BEGIN LiteSpeed" oraz "END LiteSpeed"
|
||||
# są generowane dynamicznie i powinny być modyfikowane tylko za pomocą
|
||||
# filtrów WordPressa. Zmiany dokonane bezpośrednio tutaj będą nadpisywane.
|
||||
<IfModule Litespeed>
|
||||
SetEnv noabort 1
|
||||
</IfModule>
|
||||
# END LiteSpeed
|
||||
# END WordPress
|
||||
38
.vscode/ftp-kr.sync.cache.json
vendored
38
.vscode/ftp-kr.sync.cache.json
vendored
@@ -15,6 +15,12 @@
|
||||
"lmtime": 0,
|
||||
"modified": false
|
||||
},
|
||||
".pureftpd-rename.850443.ae85ce5a": {
|
||||
"type": "-",
|
||||
"size": 2632500889,
|
||||
"lmtime": 0,
|
||||
"modified": false
|
||||
},
|
||||
".tmb": {},
|
||||
"400.shtml": {
|
||||
"type": "-",
|
||||
@@ -82,9 +88,9 @@
|
||||
},
|
||||
"license.txt": {
|
||||
"type": "-",
|
||||
"size": 19915,
|
||||
"size": 19903,
|
||||
"lmtime": 0,
|
||||
"modified": false
|
||||
"modified": true
|
||||
},
|
||||
"logo.jpg": {
|
||||
"type": "-",
|
||||
@@ -95,9 +101,9 @@
|
||||
"prezent-swiateczny": {},
|
||||
"readme.html": {
|
||||
"type": "-",
|
||||
"size": 7409,
|
||||
"size": 7425,
|
||||
"lmtime": 0,
|
||||
"modified": false
|
||||
"modified": true
|
||||
},
|
||||
"robots.txt": {
|
||||
"type": "-",
|
||||
@@ -132,9 +138,9 @@
|
||||
},
|
||||
"wp-config.php": {
|
||||
"type": "-",
|
||||
"size": 3528,
|
||||
"size": 3629,
|
||||
"lmtime": 1743399967574,
|
||||
"modified": false
|
||||
"modified": true
|
||||
},
|
||||
"wp-content": {
|
||||
"plugins": {
|
||||
@@ -308,27 +314,27 @@
|
||||
},
|
||||
"wp-login.php": {
|
||||
"type": "-",
|
||||
"size": 51367,
|
||||
"size": 51414,
|
||||
"lmtime": 0,
|
||||
"modified": false
|
||||
"modified": true
|
||||
},
|
||||
"wp-mail.php": {
|
||||
"type": "-",
|
||||
"size": 8543,
|
||||
"size": 8727,
|
||||
"lmtime": 0,
|
||||
"modified": false
|
||||
"modified": true
|
||||
},
|
||||
"wp-settings.php": {
|
||||
"type": "-",
|
||||
"size": 29032,
|
||||
"size": 30081,
|
||||
"lmtime": 0,
|
||||
"modified": false
|
||||
"modified": true
|
||||
},
|
||||
"wp-signup.php": {
|
||||
"type": "-",
|
||||
"size": 34385,
|
||||
"size": 34516,
|
||||
"lmtime": 0,
|
||||
"modified": false
|
||||
"modified": true
|
||||
},
|
||||
"wp-trackback.php": {
|
||||
"type": "-",
|
||||
@@ -338,9 +344,9 @@
|
||||
},
|
||||
"xmlrpc.php": {
|
||||
"type": "-",
|
||||
"size": 3246,
|
||||
"size": 3205,
|
||||
"lmtime": 0,
|
||||
"modified": false
|
||||
"modified": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
error_reporting( 0 );
|
||||
/**
|
||||
* Front to the WordPress application. This file doesn't do anything, but loads
|
||||
* wp-blog-header.php which does and tells WordPress to load the theme.
|
||||
@@ -14,4 +15,4 @@
|
||||
define( 'WP_USE_THEMES', true );
|
||||
|
||||
/** Loads the WordPress Environment and Template */
|
||||
require __DIR__ . '/wp-blog-header.php';
|
||||
require dirname(__FILE__) . '/wp-blog-header.php';
|
||||
|
||||
@@ -21,23 +21,23 @@ define( 'WP_CACHE', true );
|
||||
*/
|
||||
|
||||
// ** Ustawienia MySQL-a - możesz uzyskać je od administratora Twojego serwera ** //
|
||||
/** Nazwa bazy danych, której używać ma WordPress */
|
||||
define('DB_NAME', 'sukcesje_www');
|
||||
/** The name of the database for WordPress */
|
||||
define( 'DB_NAME', "sukcesje_bs-v2" );
|
||||
|
||||
/** Nazwa użytkownika bazy danych MySQL */
|
||||
define('DB_USER', 'sukcesje_www');
|
||||
/** Database username */
|
||||
define( 'DB_USER', "sukcesje_jacek" );
|
||||
|
||||
/** Hasło użytkownika bazy danych MySQL */
|
||||
define('DB_PASSWORD', '1Y8mc77XKz');
|
||||
/** Database password */
|
||||
define( 'DB_PASSWORD', "VtwAizp5cM" );
|
||||
|
||||
/** Nazwa hosta serwera MySQL */
|
||||
define('DB_HOST', 'localhost');
|
||||
/** Database hostname */
|
||||
define( 'DB_HOST', "localhost" );
|
||||
|
||||
/** Kodowanie bazy danych używane do stworzenia tabel w bazie danych. */
|
||||
define('DB_CHARSET', 'utf8');
|
||||
/** Database charset to use in creating database tables. */
|
||||
define( 'DB_CHARSET', 'utf8mb4' );
|
||||
|
||||
/** Typ porównań w bazie danych. Nie zmieniaj tego ustawienia, jeśli masz jakieś wątpliwości. */
|
||||
define('DB_COLLATE', '');
|
||||
/** The database collate type. Don't change this if in doubt. */
|
||||
define( 'DB_COLLATE', '' );
|
||||
|
||||
/**#@+
|
||||
* Unikatowe klucze uwierzytelniania i sole.
|
||||
@@ -78,7 +78,9 @@ $table_prefix = 'wp_';
|
||||
* WP_DEBUG w miejscach pracy nad nimi.
|
||||
*/
|
||||
define('WP_DEBUG', false);
|
||||
#define('WP_DEBUG_LOG', true);
|
||||
define('WP_DEBUG_LOG', false);
|
||||
define( 'WP_DEBUG_DISPLAY', false );
|
||||
@ini_set( 'display_errors', 0 );
|
||||
|
||||
/* To wszystko, zakończ edycję w tym miejscu! Miłego blogowania! */
|
||||
|
||||
|
||||
40855
wp-content/debug.log
40855
wp-content/debug.log
File diff suppressed because it is too large
Load Diff
179
wp-content/plugins/elementor-pro/modules/custom-css/module.php
Normal file
179
wp-content/plugins/elementor-pro/modules/custom-css/module.php
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\CustomCss;
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Controls_Stack;
|
||||
use Elementor\Core\DynamicTags\Dynamic_CSS;
|
||||
use Elementor\Core\Files\CSS\Post;
|
||||
use Elementor\Core\Kits\Documents\Kit;
|
||||
use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
|
||||
use Elementor\Element_Base;
|
||||
use ElementorPro\Base\Module_Base;
|
||||
use ElementorPro\Modules\CustomCss\AdminMenuItems\Settings_Custom_CSS_Pro;
|
||||
use ElementorPro\Plugin;
|
||||
use ElementorPro\License\API;
|
||||
use ElementorPro\Modules\Tiers\Module as Tiers;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Module extends Module_Base {
|
||||
|
||||
const LICENSE_FEATURE_NAME = 'custom-css';
|
||||
const LICENSE_FEATURE_NAME_GLOBAL = 'global-css';
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
$this->add_actions();
|
||||
}
|
||||
|
||||
public function get_name() {
|
||||
return 'custom-css';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $element Controls_Stack
|
||||
* @param $section_id string
|
||||
*/
|
||||
public function register_controls( Controls_Stack $element, $section_id ) {
|
||||
// Remove Custom CSS Banner (From free version)
|
||||
if ( 'section_custom_css_pro' !== $section_id ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$old_section = Plugin::elementor()->controls_manager->get_control_from_stack( $element->get_unique_name(), 'section_custom_css_pro' );
|
||||
|
||||
if ( ! API::is_licence_has_feature( static::LICENSE_FEATURE_NAME, API::BC_VALIDATION_CALLBACK ) ) {
|
||||
$promotion_data = [
|
||||
'title' => esc_html__( 'Meet Our Custom CSS', 'elementor-pro' ),
|
||||
'messages' => [
|
||||
esc_html__( 'Apply CSS to any widget and elevate any element with Custom CSS.', 'elementor-pro' ),
|
||||
],
|
||||
'link' => 'https://go.elementor.com/go-pro-advanced-custom-css/',
|
||||
];
|
||||
|
||||
$promotion_data = Filtered_Promotions_Manager::get_filtered_promotion_data( $promotion_data, 'elementor-pro/advanced-custom-css-promotion-pro-widget/promotion', 'link' );
|
||||
$template = Tiers::get_promotion_template( $promotion_data );
|
||||
$this->replace_controls_with_upgrade_promotion( $element, $old_section['tab'], $template );
|
||||
return;
|
||||
}
|
||||
|
||||
$this->replace_go_pro_custom_css_controls( $element );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $post_css Post
|
||||
* @param $element Element_Base
|
||||
*/
|
||||
public function add_post_css( $post_css, $element ) {
|
||||
if ( $post_css instanceof Dynamic_CSS ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$element_settings = $element->get_settings();
|
||||
|
||||
if ( empty( $element_settings['custom_css'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$css = trim( $element_settings['custom_css'] );
|
||||
|
||||
if ( empty( $css ) ) {
|
||||
return;
|
||||
}
|
||||
$css = str_replace( 'selector', $post_css->get_element_unique_selector( $element ), $css );
|
||||
|
||||
// Add a css comment
|
||||
$css = sprintf( '/* Start custom CSS for %s, class: %s */', $element->get_name(), $element->get_unique_selector() ) . $css . '/* End custom CSS */';
|
||||
|
||||
$post_css->get_stylesheet()->add_raw_css( $css );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $post_css Post
|
||||
*/
|
||||
public function add_page_settings_css( $post_css ) {
|
||||
$document = Plugin::elementor()->documents->get( $post_css->get_post_id() );
|
||||
$custom_css = $document->get_settings( 'custom_css' ) ?? '';
|
||||
|
||||
$custom_css = trim( $custom_css );
|
||||
|
||||
if ( empty( $custom_css ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$custom_css = str_replace( 'selector', $document->get_css_wrapper_selector(), $custom_css );
|
||||
|
||||
// Add a css comment
|
||||
$custom_css = '/* Start custom CSS */' . $custom_css . '/* End custom CSS */';
|
||||
|
||||
$post_css->get_stylesheet()->add_raw_css( $custom_css );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Controls_Stack $controls_stack
|
||||
*/
|
||||
public function replace_go_pro_custom_css_controls( $controls_stack ) {
|
||||
$old_section = Plugin::elementor()->controls_manager->get_control_from_stack( $controls_stack->get_unique_name(), 'section_custom_css_pro' );
|
||||
|
||||
Plugin::elementor()->controls_manager->remove_control_from_stack( $controls_stack->get_unique_name(), [ 'section_custom_css_pro', 'custom_css_pro' ] );
|
||||
|
||||
$controls_stack->start_controls_section(
|
||||
'section_custom_css',
|
||||
[
|
||||
'label' => esc_html__( 'Custom CSS', 'elementor-pro' ),
|
||||
'tab' => $old_section['tab'],
|
||||
]
|
||||
);
|
||||
|
||||
$controls_stack->add_control(
|
||||
'custom_css',
|
||||
[
|
||||
'label' => esc_html__( 'Add your own custom CSS', 'elementor-pro' ),
|
||||
'type' => Controls_Manager::CODE,
|
||||
'description' => '',
|
||||
'language' => 'css',
|
||||
'render_type' => 'ui',
|
||||
]
|
||||
);
|
||||
|
||||
$controls_stack->end_controls_section();
|
||||
}
|
||||
|
||||
protected function add_actions() {
|
||||
add_action( 'elementor/element/after_section_end', [ $this, 'register_controls' ], 10, 2 );
|
||||
add_action( 'elementor/element/parse_css', [ $this, 'add_post_css' ], 10, 2 );
|
||||
add_action( 'elementor/css-file/post/parse', [ $this, 'add_page_settings_css' ] );
|
||||
|
||||
// Check license for site settings tabs
|
||||
if ( ! API::is_licence_has_feature( static::LICENSE_FEATURE_NAME_GLOBAL, API::BC_VALIDATION_CALLBACK ) ) {
|
||||
add_action( 'elementor/kit/register_tabs', function ( Kit $kit ) {
|
||||
$kit->register_tab( 'settings-custom-css', Settings_Custom_CSS_Pro::class );
|
||||
}, 100 );
|
||||
}
|
||||
}
|
||||
|
||||
public function replace_controls_with_upgrade_promotion( Controls_Stack $controls_stack, $tab, $template ) {
|
||||
Plugin::elementor()->controls_manager->remove_control_from_stack( $controls_stack->get_unique_name(), [ 'section_custom_css_pro', 'custom_css_pro' ] );
|
||||
|
||||
$controls_stack->start_controls_section(
|
||||
'section_custom_css_promotion',
|
||||
[
|
||||
'label' => esc_html__( 'Custom CSS', 'elementor-pro' ),
|
||||
'tab' => $tab,
|
||||
]
|
||||
);
|
||||
|
||||
$controls_stack->add_control(
|
||||
'custom_css_promotion',
|
||||
[
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => $template,
|
||||
]
|
||||
);
|
||||
|
||||
$controls_stack->end_controls_section();
|
||||
}
|
||||
}
|
||||
391
wp-content/themes/hello-elementor/functions.php
Normal file
391
wp-content/themes/hello-elementor/functions.php
Normal file
@@ -0,0 +1,391 @@
|
||||
<?php
|
||||
/**
|
||||
* Theme functions and definitions
|
||||
*
|
||||
* @package HelloElementor
|
||||
*/
|
||||
|
||||
use Elementor\Core\Logger\Items\PHP;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
define( 'HELLO_ELEMENTOR_VERSION', '3.4.4' );
|
||||
define( 'EHP_THEME_SLUG', 'hello-elementor' );
|
||||
|
||||
define( 'HELLO_THEME_PATH', get_template_directory() );
|
||||
define( 'HELLO_THEME_URL', get_template_directory_uri() );
|
||||
define( 'HELLO_THEME_ASSETS_PATH', HELLO_THEME_PATH . '/assets/' );
|
||||
define( 'HELLO_THEME_ASSETS_URL', HELLO_THEME_URL . '/assets/' );
|
||||
define( 'HELLO_THEME_SCRIPTS_PATH', HELLO_THEME_ASSETS_PATH . 'js/' );
|
||||
define( 'HELLO_THEME_SCRIPTS_URL', HELLO_THEME_ASSETS_URL . 'js/' );
|
||||
define( 'HELLO_THEME_STYLE_PATH', HELLO_THEME_ASSETS_PATH . 'css/' );
|
||||
define( 'HELLO_THEME_STYLE_URL', HELLO_THEME_ASSETS_URL . 'css/' );
|
||||
define( 'HELLO_THEME_IMAGES_PATH', HELLO_THEME_ASSETS_PATH . 'images/' );
|
||||
define( 'HELLO_THEME_IMAGES_URL', HELLO_THEME_ASSETS_URL . 'images/' );
|
||||
|
||||
if ( ! isset( $content_width ) ) {
|
||||
$content_width = 800; // Pixels.
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'hello_elementor_setup' ) ) {
|
||||
/**
|
||||
* Set up theme support.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function hello_elementor_setup() {
|
||||
if ( is_admin() ) {
|
||||
hello_maybe_update_theme_version_in_db();
|
||||
}
|
||||
|
||||
if ( apply_filters( 'hello_elementor_register_menus', true ) ) {
|
||||
register_nav_menus( [ 'menu-1' => esc_html__( 'Header', 'hello-elementor' ) ] );
|
||||
register_nav_menus( [ 'menu-2' => esc_html__( 'Footer', 'hello-elementor' ) ] );
|
||||
}
|
||||
|
||||
if ( apply_filters( 'hello_elementor_post_type_support', true ) ) {
|
||||
add_post_type_support( 'page', 'excerpt' );
|
||||
}
|
||||
|
||||
if ( apply_filters( 'hello_elementor_add_theme_support', true ) ) {
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
add_theme_support( 'automatic-feed-links' );
|
||||
add_theme_support( 'title-tag' );
|
||||
add_theme_support(
|
||||
'html5',
|
||||
[
|
||||
'search-form',
|
||||
'comment-form',
|
||||
'comment-list',
|
||||
'gallery',
|
||||
'caption',
|
||||
'script',
|
||||
'style',
|
||||
'navigation-widgets',
|
||||
]
|
||||
);
|
||||
add_theme_support(
|
||||
'custom-logo',
|
||||
[
|
||||
'height' => 100,
|
||||
'width' => 350,
|
||||
'flex-height' => true,
|
||||
'flex-width' => true,
|
||||
]
|
||||
);
|
||||
add_theme_support( 'align-wide' );
|
||||
add_theme_support( 'responsive-embeds' );
|
||||
|
||||
/*
|
||||
* Editor Styles
|
||||
*/
|
||||
add_theme_support( 'editor-styles' );
|
||||
add_editor_style( 'editor-styles.css' );
|
||||
|
||||
/*
|
||||
* WooCommerce.
|
||||
*/
|
||||
if ( apply_filters( 'hello_elementor_add_woocommerce_support', true ) ) {
|
||||
// WooCommerce in general.
|
||||
add_theme_support( 'woocommerce' );
|
||||
// Enabling WooCommerce product gallery features (are off by default since WC 3.0.0).
|
||||
// zoom.
|
||||
add_theme_support( 'wc-product-gallery-zoom' );
|
||||
// lightbox.
|
||||
add_theme_support( 'wc-product-gallery-lightbox' );
|
||||
// swipe.
|
||||
add_theme_support( 'wc-product-gallery-slider' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'after_setup_theme', 'hello_elementor_setup' );
|
||||
|
||||
function hello_maybe_update_theme_version_in_db() {
|
||||
$theme_version_option_name = 'hello_theme_version';
|
||||
// The theme version saved in the database.
|
||||
$hello_theme_db_version = get_option( $theme_version_option_name );
|
||||
|
||||
// If the 'hello_theme_version' option does not exist in the DB, or the version needs to be updated, do the update.
|
||||
if ( ! $hello_theme_db_version || version_compare( $hello_theme_db_version, HELLO_ELEMENTOR_VERSION, '<' ) ) {
|
||||
update_option( $theme_version_option_name, HELLO_ELEMENTOR_VERSION );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'hello_elementor_display_header_footer' ) ) {
|
||||
/**
|
||||
* Check whether to display header footer.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function hello_elementor_display_header_footer() {
|
||||
$hello_elementor_header_footer = true;
|
||||
|
||||
return apply_filters( 'hello_elementor_header_footer', $hello_elementor_header_footer );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'hello_elementor_scripts_styles' ) ) {
|
||||
/**
|
||||
* Theme Scripts & Styles.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function hello_elementor_scripts_styles() {
|
||||
if ( apply_filters( 'hello_elementor_enqueue_style', true ) ) {
|
||||
wp_enqueue_style(
|
||||
'hello-elementor',
|
||||
HELLO_THEME_STYLE_URL . 'reset.css',
|
||||
[],
|
||||
HELLO_ELEMENTOR_VERSION
|
||||
);
|
||||
}
|
||||
|
||||
if ( apply_filters( 'hello_elementor_enqueue_theme_style', true ) ) {
|
||||
wp_enqueue_style(
|
||||
'hello-elementor-theme-style',
|
||||
HELLO_THEME_STYLE_URL . 'theme.css',
|
||||
[],
|
||||
HELLO_ELEMENTOR_VERSION
|
||||
);
|
||||
}
|
||||
|
||||
if ( hello_elementor_display_header_footer() ) {
|
||||
wp_enqueue_style(
|
||||
'hello-elementor-header-footer',
|
||||
HELLO_THEME_STYLE_URL . 'header-footer.css',
|
||||
[],
|
||||
HELLO_ELEMENTOR_VERSION
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'hello_elementor_scripts_styles' );
|
||||
|
||||
if ( ! function_exists( 'hello_elementor_register_elementor_locations' ) ) {
|
||||
/**
|
||||
* Register Elementor Locations.
|
||||
*
|
||||
* @param ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager $elementor_theme_manager theme manager.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function hello_elementor_register_elementor_locations( $elementor_theme_manager ) {
|
||||
if ( apply_filters( 'hello_elementor_register_elementor_locations', true ) ) {
|
||||
$elementor_theme_manager->register_all_core_location();
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'elementor/theme/register_locations', 'hello_elementor_register_elementor_locations' );
|
||||
|
||||
if ( ! function_exists( 'hello_elementor_content_width' ) ) {
|
||||
/**
|
||||
* Set default content width.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function hello_elementor_content_width() {
|
||||
$GLOBALS['content_width'] = apply_filters( 'hello_elementor_content_width', 800 );
|
||||
}
|
||||
}
|
||||
add_action( 'after_setup_theme', 'hello_elementor_content_width', 0 );
|
||||
|
||||
if ( ! function_exists( 'hello_elementor_add_description_meta_tag' ) ) {
|
||||
/**
|
||||
* Add description meta tag with excerpt text.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function hello_elementor_add_description_meta_tag() {
|
||||
if ( ! apply_filters( 'hello_elementor_description_meta_tag', true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! is_singular() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$post = get_queried_object();
|
||||
if ( empty( $post->post_excerpt ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<meta name="description" content="' . esc_attr( wp_strip_all_tags( $post->post_excerpt ) ) . '">' . "\n";
|
||||
}
|
||||
}
|
||||
add_action( 'wp_head', 'hello_elementor_add_description_meta_tag' );
|
||||
|
||||
// Settings page
|
||||
require get_template_directory() . '/includes/settings-functions.php';
|
||||
|
||||
// Header & footer styling option, inside Elementor
|
||||
require get_template_directory() . '/includes/elementor-functions.php';
|
||||
|
||||
if ( ! function_exists( 'hello_elementor_customizer' ) ) {
|
||||
// Customizer controls
|
||||
function hello_elementor_customizer() {
|
||||
if ( ! is_customize_preview() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! hello_elementor_display_header_footer() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
require get_template_directory() . '/includes/customizer-functions.php';
|
||||
}
|
||||
}
|
||||
add_action( 'init', 'hello_elementor_customizer' );
|
||||
|
||||
if ( ! function_exists( 'hello_elementor_check_hide_title' ) ) {
|
||||
/**
|
||||
* Check whether to display the page title.
|
||||
*
|
||||
* @param bool $val default value.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function hello_elementor_check_hide_title( $val ) {
|
||||
if ( defined( 'ELEMENTOR_VERSION' ) ) {
|
||||
$current_doc = Elementor\Plugin::instance()->documents->get( get_the_ID() );
|
||||
if ( $current_doc && 'yes' === $current_doc->get_settings( 'hide_title' ) ) {
|
||||
$val = false;
|
||||
}
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
add_filter( 'hello_elementor_page_title', 'hello_elementor_check_hide_title' );
|
||||
|
||||
/**
|
||||
* BC:
|
||||
* In v2.7.0 the theme removed the `hello_elementor_body_open()` from `header.php` replacing it with `wp_body_open()`.
|
||||
* The following code prevents fatal errors in child themes that still use this function.
|
||||
*/
|
||||
if ( ! function_exists( 'hello_elementor_body_open' ) ) {
|
||||
function hello_elementor_body_open() {
|
||||
wp_body_open();
|
||||
}
|
||||
}
|
||||
|
||||
require HELLO_THEME_PATH . '/theme.php';
|
||||
|
||||
HelloTheme\Theme::instance();
|
||||
|
||||
function custom_enqueue_styles() {
|
||||
wp_enqueue_style(
|
||||
'custom-style',
|
||||
get_template_directory_uri() . '/assets/css/custom.css',
|
||||
array(),
|
||||
filemtime(get_template_directory() . '/assets/css/custom.css'),
|
||||
'all'
|
||||
);
|
||||
}
|
||||
add_action('wp_enqueue_scripts', 'custom_enqueue_styles', PHP_INT_MAX);
|
||||
|
||||
function custom_enqueue_scripts() {
|
||||
wp_enqueue_script(
|
||||
'custom-variation-buttons',
|
||||
get_stylesheet_directory_uri() . '/assets/js/custom.js',
|
||||
array('jquery'),
|
||||
'1.0',
|
||||
true
|
||||
);
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts', PHP_INT_MAX );
|
||||
|
||||
add_filter( 'woocommerce_product_tabs', 'custom_static_tab' );
|
||||
function custom_static_tab( $tabs ) {
|
||||
$tabs['custom_reviews'] = array(
|
||||
'title' => __( 'Opinie', 'your-textdomain' ),
|
||||
'priority' => 50,
|
||||
'callback' => 'custom_reviews_tab_content'
|
||||
);
|
||||
$tabs['about_author'] = array(
|
||||
'title' => __( get_field('title', 'option'), 'your-textdomain' ),
|
||||
'priority' => 50,
|
||||
'callback' => 'custom_static_tab_content'
|
||||
);
|
||||
return $tabs;
|
||||
}
|
||||
|
||||
|
||||
function custom_static_tab_content() {
|
||||
global $product;
|
||||
$product_id = $product ? $product->get_id() : 0;
|
||||
echo '<div class="c-row">';
|
||||
echo '<div class="c-col-1">';
|
||||
if ( $product_id == 272 )
|
||||
echo nl2br( get_field( 'text_english', 'option' ) );
|
||||
else
|
||||
echo nl2br( get_field('text', 'option') );
|
||||
$button = get_field('button', 'option');
|
||||
if ( is_array( $button ) and $button['url'] )
|
||||
echo '<a href="' . $button['url'] . '">' . get_field('button', 'option')['title'] . '</a>';
|
||||
echo '</div>';
|
||||
echo '<div class="c-col-2">';
|
||||
echo '<img src="' . get_field('image', 'option') . '"/>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function custom_reviews_tab_content() {
|
||||
echo '<div id="f5d770fd-c394-46f6-8165-51dcd4168062"></div>';
|
||||
echo '<script defer src="https://trustmate.io/widget/api/f5d770fd-c394-46f6-8165-51dcd4168062/script?product=tu_wstaw_identyfikator_produktu"></script>';
|
||||
}
|
||||
|
||||
add_filter('woocommerce_get_price_html', 'custom_price_range_classes', 20, 2);
|
||||
|
||||
function custom_price_range_classes($price_html, $product) {
|
||||
if ( $product->is_type('variable') ) {
|
||||
$min_price = wc_price( $product->get_variation_price( 'min', true ) );
|
||||
$max_price = wc_price( $product->get_variation_price( 'max', true ) );
|
||||
|
||||
$price_html = '<p class="price">'
|
||||
. str_replace('amount', 'amount amount-min', $min_price)
|
||||
. ' - '
|
||||
. str_replace('amount', 'amount amount-max', $max_price)
|
||||
. '</p>';
|
||||
}
|
||||
|
||||
return $price_html;
|
||||
}
|
||||
|
||||
add_action('wp_footer', 'auto_select_first_custom_variation_script_jquery');
|
||||
|
||||
function auto_select_first_custom_variation_script_jquery() {
|
||||
if (is_product()) {
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
if ($('body').hasClass('single-product')) {
|
||||
setTimeout(function() {
|
||||
$('ul.variation-buttons').each(function() {
|
||||
var $group = $(this);
|
||||
if ($group.find('button.variation-button.selected').length === 0) {
|
||||
var $first = $group.find('button.variation-button').first();
|
||||
if ($first.length) {
|
||||
$first.trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('form.variations_form').each(function() {
|
||||
$(this).trigger('check_variations');
|
||||
});
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'woocommerce_update_order_review_fragments', function( $fragments ) {
|
||||
ob_start();
|
||||
wc_cart_totals_shipping_html();
|
||||
$fragments['.woocommerce-shipping-totals'] = ob_get_clean();
|
||||
return $fragments;
|
||||
});
|
||||
9207
wp-includes/functions.php
Normal file
9207
wp-includes/functions.php
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user