Skip to content

Instantly share code, notes, and snippets.

View ravinderk's full-sized avatar

Ravinder Kumar ravinderk

View GitHub Profile
@raftaar1191
raftaar1191 / give-install-addon.sh
Last active January 4, 2018 19:07
Shell script to download all the add-on at once
#!/bin/bash
array=(
"Give"
"Give-2Checkout"
"Give-Recurring-Donations"
"Give-Dwolla"
"Give-Email-Reports"
"Give-Fee-Recovery"
"Give-Form-Field-Manager"
"Give-Gift-Aid"
@OriginalEXE
OriginalEXE / pe-customize-controls.css
Last active June 26, 2023 05:07
Extending WordPress Customizer Panels and Sections to allow nesting
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent,
#customize-theme-controls .customize-pane-child.current-section-parent {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
}
@markjaquith
markjaquith / wp-update-plugins-git.sh
Created August 5, 2016 13:17
Update all WordPress plugins using WP-CLI and make a separate git commit for each one
#!/bin/bash
PLUGINS=$(wp plugin list --update=available --field=name | tr -d '\r');
wp plugin update-all;
for plugin in $PLUGINS; do
git add -A "wp-content/plugins/$plugin";
git commit -m "Update plugin: $plugin";
done;
@sabl0r
sabl0r / confirm.js
Created December 11, 2015 08:48 — forked from stefket/confirm.js
JavaScript confirm with magnific popup
var confirmDialog = function(message, headline, cb) {
var dialog = '<div class="dialog confirm mfp-with-anim">';
if (headline) {
dialog += '<h2>' + headline + '</h2>';
}
dialog += '<div class="content"><p>' + message + '</p></div>';
dialog += '<div class="actions">';
dialog += '<button type="button" class="btn btn-default btn-cancel">Abbrechen</button> ';
dialog += '<button type="button" class="btn btn-primary btn-submit">OK</button>';
dialog += '</div>';
Example codes for article Learning accessibility in WordPress themes, part I.
@jdevalk
jdevalk / logging-helper.php
Last active December 9, 2021 16:25
This little hack enables fatal error logging for your site, without creating an error log that is insanely big.
<?php
/**
* This changes logging to only log fatal errors. This file should go in your mu-plugins directory.
*/
// Set the error logging to only log fatal errors
error_reporting( E_ERROR );
// Optional: change the location of your error log, it might be wise to put it outside your WP content dir.
// If you don't change it, the default place for this log is debug.log in your WP_CONTENT_DIR.
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@staltz
staltz / introrx.md
Last active May 18, 2024 05:17
The introduction to Reactive Programming you've been missing
@azanebrain
azanebrain / change_user_lang.php
Last active July 15, 2016 15:59
Change the user language depending on the username. This example defaults to Japanese, unless you are me
<?php
/**
* Plugin Name: Change User Language
* Description: Change the language depending on the user
* Version: 0.1
* Author: AJ Zane
* Author URI: http://AJZane.com
* License: GPL2
*/
@LeaVerou
LeaVerou / RAINBOWlog.js
Created March 12, 2014 23:30
AWESOMEify your console.log()ing! Because life is too short to be black & white!!!!!!1111one
(function(){
var log = console.log;
console.log = function(str) {
var css = 'background: linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); color: white; font-weight: bold;';
var args = Array.prototype.slice.call(arguments);
args[0] = '%c' + args[0];
args.splice(1,0,css);
return log.apply(console, args);
}