Skip to content

Instantly share code, notes, and snippets.

<?php
/*
* Plugin Name: Commercial Client
* Plugin URI: http://pento.net/
* Description: A sample client plugin for showing updates for non-WordPress.org plugins
* Author: pento
* Version: 0.1
* Author URI: http://pento.net/
* License: GPL2+
*/
@corradomatt
corradomatt / WordPress Template Comment
Last active December 20, 2015 05:59
WordPress template file commenting for developers who want to help us out with which file is loading parts of a page.
<?php
// Beginning of File
begin_template( __FILE__ );
// End of File
end_template( __FILE__ );
@corradomatt
corradomatt / gravityforms-bs-datepicker.less
Last active November 28, 2023 20:34
Addon for using gravity forms with a bootstrap based development such as the roots.io theme for WordPress. I specifically wrote this for a roots theme and it's based on this post http://roots.io/style-gravity-forms-with-bootstrap/ by Ben Word.This goes one step further and provides support for some native gravity forms style declarations for for…
/**
* Borrowed from https://github.com/addyosmani/jquery-ui-bootstrap
* Styles the datepicker popup for gravityforms used with bootstrap
*/
/*
* jQuery UI Datepicker
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
@corradomatt
corradomatt / roots-pagination.php
Created November 27, 2013 21:46
Advanced Pagination WordPress Roots Theme
<?php
if ( !function_exists('your_pagination')) :
function your_pagination($custom_query) {
if ( !$current_page = get_query_var( 'paged' ) ) $current_page = 1;
$permalinks = get_option( 'permalink_structure' );
if( is_front_page() ) {
$format = empty( $permalinks ) ? '?paged=%#%' : 'page/%#%/';
} else {

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@corradomatt
corradomatt / SSL and WooCommerce Exclude for Migrate DB Pro
Last active November 23, 2020 18:39
The settings for Migrate-DB-Pro plugin to exclude Better WordPress Security, WooCommerce SSL and WooCommerce Plugin Activation settings when pushing or pulling your database. This code DOES NOT work as a stand-alone gist. You will need to utilize it within this code - https://github.com/deliciousbrains/wp-migrate-db-pro-tweaks/
/**
* Exclude certain WordPress database settings from being migrated when pushing or pulling
* with Migrate-DB-Pro
*
* Useful when developing locally and wanting to push or pull database settings between envirnments
* USE CAUTION! - Must be used with https://github.com/deliciousbrains/wp-migrate-db-pro-tweaks/
*/
function preserved_options( $options ) {
$options[] = 'blog_public'; // discourage search engines setting
$options[] = 'bit51_bwps'; // Better WordPress Security Settings
@corradomatt
corradomatt / 0_reuse_code.js
Last active August 29, 2015 14:11
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

First time server setup

  • Prerequisites: Git, Ruby, WP-CLI, Node.JS, NPM, Bower, Sass, Gulp, Grunt (Grunt as a backup)

Set up Wordpress using WP-CLI

mkdir project.com.au
cd project.com.au/
wp core download
mysql -u [mysql-username] -p
# Enter MySQL password
@corradomatt
corradomatt / compiler.php
Last active August 29, 2015 14:20 — forked from dovy/compiler.php
<?php
Redux::setSection( $opt_name, array(
'title' => __( 'Text Area', 'redux-framework-demo' ),
'desc' => __( 'For full documentation on this field, visit: ', 'redux-framework-demo' ) . '<a href="http://docs.reduxframework.com/core/fields/textarea/" target="_blank">http://docs.reduxframework.com/core/fields/textarea/</a>',
'id' => 'opt-textarea-subsection',
'subsection' => true,
'fields' => array(
array(
'id' => 'background-parallax',
@corradomatt
corradomatt / CPT_Columns.php
Created June 1, 2015 18:57
Create custom columns for WordPress Custom Post Types Admin Screen.
<?php
//Based on Ohad Raz - https://en.bainternet.info/custom-post-types-columns/
//Some info:
// The classes read the meta field of the CPT ID and enable the sorting
// Is possible remove other column
// Support 4 type of object natively: Title, Thumbnail, Custom taxonomy, Custom Field
// Add a filter cpt_columns_text_{column_name_id} in Title type
// prefix/suffix values are for all the objects except post_thumb
// New features by Mte90: