Skip to content

Instantly share code, notes, and snippets.

View maheshwaghmare's full-sized avatar
🎯
Focusing

Mahesh Waghmare maheshwaghmare

🎯
Focusing
View GitHub Profile
@maheshwaghmare
maheshwaghmare / test1
Last active June 24, 2016 11:02
test1
// Menu item spacing
array(
'id' => 'nice-supplementary-menu-item-padding-lr',
'title' => __( 'Menu Item Horizontal Spacing', 'nice' ),
'desc' => __( 'Controls left & right spacing of each menu item.', 'nice' ),
'type' => 'spinner',
'default' => 20,
'step' => 1,
'max' => 250,
'display_value' => 'select',
add_filter('redux/options/{REDUX_OPTION_NAME}/sections', 'addSections' );
function addSections( $sections ) {
$sections[] = array(
'title' => __( 'SECTION NAME', 'redux-framework-demo' ),
'desc' => __('DESCRIPTION GOES HERE', 'redux-framework-demo'),
'icon' => 'el-icon-paper-clip',
'fields' => array(
)
@maheshwaghmare
maheshwaghmare / on-visit-scroll-to-hash-link
Created July 13, 2016 05:37
on website Visit Scroll to # link
@maheshwaghmare
maheshwaghmare / Get products from 2 or more categories
Created August 5, 2016 08:40
Get products from 2 or more categories
Get products from 2 or more categories
@maheshwaghmare
maheshwaghmare / disable-emojis.php
Created August 22, 2016 07:22
WordPress - Disable Emojis
/*
Gist from plugin "Disable Emojis"
Yo'll get it from WordPress repository "https://plugins.svn.wordpress.org/disable-emojis/"
*/
/**
* Disable the emoji's
*/
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
@maheshwaghmare
maheshwaghmare / WordPress transient example
Created August 23, 2016 08:42
WordPress transients example
<?php
/**
* Get a list of email subscribers.
*
* @return object The HTTP response that comes as a result of a wp_remote_get().
*/
function css_t_subscribers() {
// Do we have this information in our transients already?
$transient = get_transient( 'css_t_subscribers' );
@maheshwaghmare
maheshwaghmare / php-class-boilderplate.php
Last active April 26, 2021 15:56
PHP Class boilerplate - *The Singleton Pattern*
<?php
/**
* MY CLASS NAME
*
* @package MY PACKAGE
* @since 1.0.0
*/
if( ! class_exists( 'MY_CLASS_NAME' ) ) :
/**
* Helper showControlIfhasValues()
*/
function showControlIfhasValues( setting, ExpectedValues ) {
return function( control ) {
// Check the current value in the array of ExpectedValues
var isDisplayed = function() {
return $.inArray( setting.get(), ExpectedValues ) !== -1;
@maheshwaghmare
maheshwaghmare / youtube-player-js-api-reference-for-iframe-embeds
Last active November 18, 2016 10:18
YouTube player JS API Reference for iframe embeds
/**
* YouTube <iframe> video
*
* Set 40% volume for YouTube <iframe> video
*/
var DebugLog = false, // For debugging
YouTubeID = 'YOUTUBE_IFRAME_ID', // Set YouTube <iframe> id
YouTubeVolume = 40; // Set volume from 1 to 100
@maheshwaghmare
maheshwaghmare / google-fonts.json
Created March 15, 2017 18:01
Google Fonts list Generated though API on Date 15 - March - 2017
{
"kind": "webfonts#webfontList",
"items": [
{
"kind": "webfonts#webfont",
"family": "ABeeZee",
"category": "sans-serif",
"variants": [
"regular",
"italic"