Skip to content

Instantly share code, notes, and snippets.

View ravinderk's full-sized avatar

Ravinder Kumar ravinderk

View GitHub Profile
<?php
$GLOBALS['wp_filter'] = array(
'enable_wp_debug_mode_checks' => array(
10 => array(
array(
'accepted_args' => 0,
'function' => function () {
return false;
},
),
@ravinderk
ravinderk / setup-phpunit.sh
Created October 27, 2017 06:00 — forked from DevinWalker/setup-phpunit.sh
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, git, subversion, composer, curl and wget
#
# WordPress and the WP_UnitTestCase are installed in the /tmp directory
# The $WP_CORE_DIR and $WP_TESTS_DIR variables are added to the .bashrc file
@ravinderk
ravinderk / plugin-class-demo.php
Created August 12, 2016 10:31 — forked from thefuxia/plugin-class-demo.php
Plugin Class Demo
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Plugin Class Demo
* Description: How I am using the base class in plugins.
* Plugin URI:
* Version: 2012.09.29
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: GPL
* Text Domain: plugin_unique_name
@ravinderk
ravinderk / grumphp.yml
Last active July 20, 2016 15:59
Grumphp configuration
parameters:
git_dir: .
bin_dir: path_to_global_composer_bin_dir
# For example: /Users/********/.composer/vendor/bin
tasks:
git_blacklist:
keywords:
- error_log(
- var_dump(
#- console.log(
@ravinderk
ravinderk / custom-domain-localhost-xampp
Last active July 5, 2016 05:22 — forked from oozman/custom-domain-localhost-xampp
How to add a custom domain name on your localhost using XAMPP. Codes are based on Windows, but Step 2 onwards are pretty much applicable on other operating system.
Step 1:
Go to: \etc\hosts
And add this to the bottom of the file:
=============
127.0.0.1 your.domain.com
=============
Step 2:
Go to [your XAMPP directory]/apache/conf/httpd.conf
@ravinderk
ravinderk / 0_reuse_code.js
Created February 11, 2016 09:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ravinderk
ravinderk / .gitMessage
Last active November 17, 2018 07:08 — forked from Linell/.git-commit-template.txt
This is commit template which follows git commit best practices used by angular team :)
#<type>(<scope>): <subject>
#<BLANK LINE>
#<body>
#<BLANK LINE>
#<footer>
@ravinderk
ravinderk / widget_reorder_example.php
Last active November 20, 2015 10:43
Reorder widget area appearance in WordPress backend
/**
* Reorder widget areas under admin
*/
add_action( 'admin_head', function () {
global $wp_registered_sidebars;
if ( array_key_exists( 'first', $wp_registered_sidebars ) ) {
/**
* Add gravity forms to acf gravityform select field
*
* @param array $field field data.
*
* @return mixed
*/
function acf_load_color_field_choices( $field ) {
// Reset choices.
@ravinderk
ravinderk / functions.php
Created September 9, 2015 13:31
Add property tag to link attribute which print in footer in WordPress
/**
* add property attribute to gravity form link tags
*
* @param array $handle style imfo
*
* @return mixed
*/
function pos_gform_edit_link_tag( $link, $handle ) {
global $is_style_in_queue;