Skip to content

Instantly share code, notes, and snippets.

View noruzzamans's full-sized avatar

Noruzzaman noruzzamans

View GitHub Profile
@noruzzamans
noruzzamans / Automatically Populate a Secondary Taxonomy When Creating Terms in Primary Taxonomies
Last active March 14, 2024 16:33
Automatically Populate a Secondary Taxonomy When Creating Terms in Primary Taxonomies
<?php
/** Start Auto-Create Terms in Secondary Taxonomy */
add_action( 'created_term', 'custom_create_taxonomy_term', 10, 3 );
function custom_create_taxonomy_term( $term_id, $tt_id, $taxonomy ) {
/** Define mapping between source taxonomies and destination taxonomies */
$taxonomy_mapping = array(
'product_cat' => 'your_target_taxonomy',
'category' => 'your_target_taxonomy',
);
.bnav_bottom_nav_wrapper {
display: block !important;
margin-left: auto;
margin-right: auto;
display: block;
width: 420px;
::-webkit-scrollbar {
height: 4px;
width: 4px;
<?php
//stap one ajax action fire on a plugin
public function __construct() {
$this->register_ajax_hooks();
}
<?php
//Walker function
function custom_taxonomy_walker($taxonomy, $parent = 0)
{
$terms = get_terms($taxonomy, array('parent' => $parent, 'hide_empty' => false));
//If there are terms, start displaying
if(count($terms) > 0)
{
//Displaying as a list
$out = "<ul>";
//function
function wpdocs_deregister_section( $wp_customize ) {
$main_section_id = 'custom_marker_icon';
$wp_customize->add_section( $main_section_id , [
'title' => __( 'Custom Marker Icon', 'timeandtidebell-vgm-add-on' ),
'description' => __( 'Upload Marker Icon', 'timeandtidebell-vgm-add-on' ),
] );
global $wp_session;
$wp_session['set_session_name'] = set_the_value;
$data = '';
if(isset($_COOKIE['set_session_name'])){
$data = $_COOKIE['set_session_name'];
}
//input field
value="<?php echo $data; ?>"
//create Cookie
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>date time</title>
</head>
add_action('init', 'stripe_google_apple_pay_button', 11);
function stripe_google_apple_pay_button()
{
remove_action('woocommerce_checkout_before_customer_details', array(WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html'), 1);
remove_action('woocommerce_checkout_before_customer_details', array(WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html'), 2);
// remove_action('woocommerce_after_add_to_cart_quantity', array(WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html'), 1);
//
@noruzzamans
noruzzamans / move_stripeprbutton.php
Created August 11, 2022 10:59 — forked from dougaitken/move_stripeprbutton.php
[broken] Moving the WooCommerce Stripe Payment Request buttons below the add to cart button
I'm removing this for now as it broke some point due to code changes. I may revert in the future. I'm glad it helped some folks in the past.