Skip to content

Instantly share code, notes, and snippets.

/**
* External dependencies
*/
import { map, isUndefined } from 'lodash'
import { withRouter } from 'react-router-dom'
import { TableCard } from '@woocommerce/components'
/**
* WordPress dependencies
*/
@shakeeb-mts
shakeeb-mts / tests.php
Created January 4, 2019 14:51
New test
<?php
/**
* Notify about the default tagline if the user hasn't changed it
*/
private function default_tagline_notice() {
$customize_url = add_query_arg( [ 'autofocus[control]' => 'blogdescription' ], wp_customize_url() );
$info_message = sprintf(
/* translators: 1: link open tag; 2: link close tag. */
esc_html__( 'You still have the default WordPress tagline, even an empty one is probably better. %1$sYou can fix this in the customizer%2$s.', 'rank-math' ),
'<a href="' . esc_attr( $customize_url ) . '">',
@shakeeb-mts
shakeeb-mts / functions.php
Last active October 7, 2018 16:01
Merge Subscriptions
<?php
/**
* Remove woocommerce and woo-subscriptions delete actions.
* @return [type] [description]
*/
function mts_remove_delete_actions() {
remove_action( 'delete_user', 'WC_Subscriptions_Manager::trash_users_subscriptions' );
remove_action( 'deleted_user', 'wc_reset_order_customer_id_on_deleted_user' );
}
<?php
Kirki::add_field( 'gs', array(
'type' => 'color',
'settings' => 'my_setting',
'label' => __( 'Header Background Color', 'my_textdomain' ),
'section' => 'my_section',
'default' => '#0088CC',
'priority' => 10,
'output' => array(
array(