This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$vat_number = 'HU12345678'; | |
if(!preg_match('/^((AT)?U[0-9]{8}|(BE)?[0-9]{10}|(BG)?[0-9]{9,10}|(CY)?[0-9]{8}[A-Z]|(CZ)?[0-9]{8,10}|(DE)?[0-9]{9}|(DK)?[0-9]{8}|(EE)?[0-9]{9}|(EL|GR)?[0-9]{9}|(ES)?[0-9A-Z][0-9]{7}[0-9A-Z]|(FI)?[0-9]{8}|(FR)?[0-9A-Z]{2}[0-9]{9}|(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})|(HU)?[0-9]{8}|(IE)?[0-9]S[0-9]{5}[A-Z]|(IT)?[0-9]{11}|(LT)?([0-9]{9}|[0-9]{12})|(LU)?[0-9]{8}|(LV)?[0-9]{11}|(MT)?[0-9]{8}|(NL)?[0-9]{9}B[0-9]{2}|(PL)?[0-9]{10}|(PT)?[0-9]{9}|(RO)?[0-9]{2,10}|(SE)?[0-9]{12}|(SI)?[0-9]{8}|(SK)?[0-9]{10})$/', $vat_number)) { | |
return array( | |
"valid" => false | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.chatgpt-button-container { | |
clear: both; | |
position: relative; | |
} | |
.chatgpt-button-container.loading { | |
cursor: wait; | |
opacity: 0.5; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'check_scf_upgrade' ) ) : | |
function check_scf_upgrade() { | |
add_action( 'admin_notices', function(){ | |
if(!get_user_meta(get_current_user_id(), 'acf_upgrade_notice_dismissed', true) && class_exists( 'ACF_Admin' ) && !method_exists('ACF_Admin', 'setup_help_tab')) { | |
?> | |
<div class="notice notice-error acf-upgrade-notice is-dismissible"> | |
<p><strong>Advanced Custom Fields is no longer available through WordPress.org.</strong> Please update to the latest version following these instructions:</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--primary-color: #35c287; | |
--primary-color-opaque: #35c287 40; | |
--primary-color-light: #35c287 80; | |
} | |
html a, html .button.is-ghost, html .button.is-ghost:hover, html .button.is-ghost.is-hovered, html .breadcrumb a, html .menu-list a.is-active, html .panel-list a:hover, html .panel-block.is-active .panel-icon, html .navbar-item.is-tab.is-active, html .carousel-arrow .icon, html .copy-text:hover, html .autocomplete a.dropdown-item:hover, html .autocomplete .dropdown .dropdown-menu .has-link a:hover, html .dropdown .dropdown-menu .has-link .autocomplete a:hover, html .autocomplete a.dropdown-item.is-hovered, html .autocomplete .dropdown .dropdown-menu .has-link a.is-hovered, html .dropdown .dropdown-menu .has-link .autocomplete a.is-hovered, html section.lists .view:hover, html .log-view .lines .timestamp, html a.navbar-item:focus, html a.navbar-item:focus-within, html a.navbar-item:hover, html a.navbar-item.is-active, html .navbar-link:focus, html .navbar-link:focus-within, html .navbar-link:hover, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Save coorindates of the billing address when order marked completed using google geocode API and save it to order meta | |
add_action('woocommerce_order_status_completed', function($order_id) { | |
$order = wc_get_order($order_id); | |
$billing_address = $order->get_formatted_billing_address(); | |
// Replace spaces with '+' for URL encoding | |
$formatted_address = str_replace(' ', '+', $billing_address); | |
$api_key = 'YOUR GOOGLE API KEY'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: shipping-cache-test-block | |
Version: 1.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_validate_postcode', function($valid, $postcode, $country){ | |
if($country != 'HU') return $valid; | |
$postcode = intval($postcode); | |
$valid_postcodes = array(1007, 1011, 1012, 1013, 1014, 1015, 1016, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1051, 1052, 1053, 1054, 1055, 1056, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1121, 1122, 1123, 1124, 1125, 1126, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1161, 1162, 1163, 1164, 1165, 1171, 1172, 1173, 1174, 1181, 1182, 1183, 1184, 1185, 1186, 1188, 1191, 11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Environment(\.colorScheme) var colorScheme | |
Form { | |
ZStack(alignment:.bottomLeading) { | |
Text("Custom Shortcuts Button") | |
HStack(spacing:0) { | |
ShortcutsLink().shortcutsLinkStyle((colorScheme == .dark) ? .dark : .light).frame(height: 20).opacity(0.011) | |
ShortcutsLink().shortcutsLinkStyle((colorScheme == .dark) ? .dark : .light).frame(height: 20).opacity(0.011) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create search bar on the top of the my account / orders page | |
add_action('woocommerce_before_account_orders', function(){ | |
?> | |
<form method="get"> | |
<input type="text" name="keyword" placeholder="Keresés" value="<?php echo esc_attr($_GET['keyword']); ?>"> | |
<input type="submit" value="Keresés" /> | |
</form> | |
<?php | |
$customer_orders = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode( 'add-to-cart-form', function($atts) { | |
global $post; | |
//Get shortcode attributes | |
$a = shortcode_atts( array( | |
'id' => 0 | |
), $atts ); | |
//Find the product and set it to global | |
$product_data = get_post( $a['id'] ); |
NewerOlder