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_action( 'init', 'add_my_custom_header' ); | |
function add_my_custom_header() { | |
remove_action( 'onepress_site_start', 'onepress_site_header' ); | |
add_action( 'onepress_site_start', 'custom_onepress_site_header' ); | |
} | |
function custom_onepress_site_header() { | |
$header_width = get_theme_mod( 'onepress_header_width', 'contained' ); | |
$is_disable_sticky = sanitize_text_field( get_theme_mod( 'onepress_sticky_header_disable' ) ); | |
$classes = array( |
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
"use strict";Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),function(){var e=function(){this.options={menuToggleDuration:300},this.menuSidebarState="closed",this.isPreviewing=document.body.classList.contains("customize-previewing"),this.init()};e.prototype.checkTouchScreen=function(){"ontouchstart"in document.documentElement?document.body.classList.add("ontouch-screen"):document.body.classList.add("not-touch-screen")},e.prototype.isMobile=function(){return!!(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.us |
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
var isMobile = { | |
Android: function() { | |
return navigator.userAgent.match(/Android/i); | |
}, | |
BlackBerry: function() { | |
return navigator.userAgent.match(/BlackBerry/i); | |
}, | |
iOS: function() { | |
return navigator.userAgent.match(/iPhone|iPad|iPod/i); | |
}, |
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
// https://buddydev.com/hiding-users-on-buddypress-based-site/ | |
add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users_by_role' ); | |
function buddydev_exclude_users_by_role( $args ) { | |
//do not exclude in admin | |
if( is_admin() && ! defined( 'DOING_AJAX' ) ) { | |
return $args; | |
} | |
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
<!DOCTYPE html> | |
<html <?php language_attributes(); ?>> | |
<head> | |
<meta charset="<?php bloginfo('charset'); ?>" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> | |
<?php wp_head(); ?> | |
</head> | |
<body <?php body_class(); ?>> |
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: WC Apartment Number | |
* Plugin URI: https://github.com/longkt/wc-apartment-number | |
* Description: This plugin add new field "Apartment Number" for the billing address. | |
* Author: longnguyen | |
* Author URI: https://profiles.wordpress.org/longnguyen | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { |
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 | |
$order = new WC_Order(206); // Order id | |
$billing_address = $order->get_address('billing'); | |
echo "<pre>"; | |
print_r($billing_address); | |
echo "</pre>"; | |
?> |
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
// In general settings | |
add_filter( 'woocommerce_general_settings', array( $this, 'add_VN_districts_in_general_settings' ) ); | |
public function add_VN_districts_in_general_settings( $settings ) { | |
$settings[3] = array( | |
'title' => __( 'City', 'woocommerce' ), | |
'desc' => __( 'The city in which your business is located.', 'woocommerce' ), | |
'id' => 'woocommerce_store_city', | |
'default' => '', | |
'type' => 'select', |
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
$('#billing_country').val('VN'); | |
$('#billing_country').select2({ | |
disabled: true, | |
}); |
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 | |
global $wpdb; | |
$location_zone = $wpdb->get_results( | |
" | |
SELECT {$wpdb->prefix}woocommerce_shipping_zone_locations.location_code, {$wpdb->prefix}woocommerce_shipping_zone_methods.instance_id | |
FROM {$wpdb->prefix}woocommerce_shipping_zone_locations | |
INNER JOIN {$wpdb->prefix}woocommerce_shipping_zone_methods | |
ON {$wpdb->prefix}woocommerce_shipping_zone_locations.zone_id = {$wpdb->prefix}woocommerce_shipping_zone_methods.zone_id | |
" | |
, ARRAY_A ); |