Skip to content

Instantly share code, notes, and snippets.

View mehul0810's full-sized avatar
👋
Hey there! Let’s Connect

Mehul Gohil mehul0810

👋
Hey there! Let’s Connect
View GitHub Profile
<script type="text/javascript">
jQuery( 'document' ).ready( function ($) {
$('#billing_postcode').on( 'focusout', function() {
$(this).trigger('update_checkout');
});
});
</script>
<?php
function mg_update_order_review_on_checkout( $post_data ) {
@mehul0810
mehul0810 / default-wordpress-blocks-sass.scss
Created January 23, 2019 10:46 — forked from davewarfel/default-wordpress-blocks-sass.scss
WordPress Blocks Styles - Cleaned Up, Commented & Sassified
/**
* WordPress Blocks
*
* Default block styling included with WordPress core.
* Provides a better starting point for WordPress theme developers,
* especially when using Sass.
*
* @link https://github.com/WordPress/WordPress/blob/master/wp-includes/css/dist/block-library/style.css
*
* Most styles from the above file are included.
<?php
/**
* This function will add new custom avatar to WordPress.
*
* @param array $avatars List of avatars in WordPress.
*
* @author Mehul Gohil
* @link https://www.mehulgohil.in/set-default-avatar/
*
* @return array
<?php
/**
* Enqueue Inline Styles in WordPress.
*
* @author Mehul Gohil
* @link https://www.mehulgohil.in/code-snippets/enqueue-inline-styles/
*/
function mg_enqueue_inline_styles() {
$css = '';
<?php
Stripe\Error\InvalidRequest Object
(
[message:protected] => Invalid token id: card_1CNHELLyXkL8xusLcSLH59hA
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => /app/public/wp-content/plugins/Give-Stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php
[line:protected] => 124
[trace:Exception:private] => Array
(
<?php
$source_args = apply_filters( 'give_stripe_get_source_args', array(
'type' => 'card',
'token' => $token_id,
) );
$charge_options = array();
if ( give_is_stripe_connected() ) { // This ensures that stripe is connected using Connect API.
$charge_options['stripe_account'] = give_get_option( 'give_stripe_user_id' );
@mehul0810
mehul0810 / wp_core_setup_local_by_flywheel.sh
Last active July 16, 2024 14:18
WordPress Core Development SetUp on Local by FlyWheel
#!/bin/bash
# Welcome to the WP Core Development Wizard.
#
# Author: Mehul Gohil
# Email: [email protected]
# Supports: Local 5.2.8. or later
#
# PreRequisites:
# 1. Install wget, subversion, curl, php5-cli, and git
@mehul0810
mehul0810 / Remove_Existing_Product_Data_Tabs.php
Created October 19, 2017 13:32
How to Remove Existing Product Data Tabs Programmatically in WooCommerce?
<?php
/**
* Remove Existing Product Data Tabs from Products Detail Page
*
* @param array $tabs List of Tabs displayed on Products Detail Page.
*
* @return array $tabs
*/
function mg_woo_remove_product_tabs( $tabs ) {
@mehul0810
mehul0810 / Rename_Existing_Product_Data_Tabs.php
Created October 19, 2017 13:24
How to Rename Existing Product Data Tabs?
<?php
function mg_woo_rename_tabs( $tabs ) {
// Rename the Description Tab.
$tabs['description']['title'] = __( 'Details', 'your-textdomain-here' );
// Rename the Reviews Tab.
$tabs['reviews']['title'] = __( 'Ratings', 'your-textdomain-here' );
// Rename the Additional Information Tab.
$tabs['additional_information']['title'] = __( 'More Information', 'your-textdomain-here' );
<?php
/**
* The Class.
*/
class Give_Sample_Meta_Box {
/**
* Hook into the appropriate actions when the class is constructed.
*/
public function __construct() {