Skip to content

Instantly share code, notes, and snippets.

View Xtremefaith's full-sized avatar
:bowtie:
I may be slow to respond.

Nick Worth Xtremefaith

:bowtie:
I may be slow to respond.
View GitHub Profile
@Xtremefaith
Xtremefaith / ignore_wp-config.md
Last active December 30, 2015 04:59
Developing locally? Here's a quick snippet for ignoring your local wp-config.php settings

Developing locally? Here's a quick snippet for ignoring your local wp-config.php settings

git update-index --assume-unchanged -- wp-config.php

Thanks to Linquize: http://stackoverflow.com/a/14513920/1058371

####Use on other settings files as well

git update-index --assume-unchanged -- wp-content/sftp-config.json

@Xtremefaith
Xtremefaith / Widget-Form.php
Created December 3, 2013 18:07
This is a quick basic template for WordPress widget forms function. Passing an array through a loop that creates the fields. This can be expanded to included columns, but that is not the intention of this gist. Currently only builds TEXT & SELECT fields
<?php
function form($instance){
/** Merge with defaults */
$instance = wp_parse_args( (array) $instance, $this->defaults ); //Only if you set defaults in constructor (i.e.- $this->defaults = array(); )
extract ( $instance, EXTR_SKIP);
//Create new fields by adding to this array
$fields = array(
'title' => array(
'label' => __( 'Title', 'div' ),
@Xtremefaith
Xtremefaith / ST2 Snippets.md
Last active December 20, 2015 23:49
Sublime Text Snippets

Inline PHP

<snippet>
    <content><![CDATA[
<?php ${1:${TM_SELECTED_TEXT}} ?>
]]></content>
	<tabTrigger>?</tabTrigger>
	<description>Inline PHP</description>
</snippet>