Skip to content

Instantly share code, notes, and snippets.

View pagelab's full-sized avatar
🚀

Márcio Duarte pagelab

🚀
View GitHub Profile

Installation

To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:

sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n

You don't have to put the library in /usr/lib/wpi18n, but if you don't put it there, make sure to set the $WP_I18N_LIB environment variable in your .bashrc or .bash_profile file (with no trailing slash):

export WP_I18N_LIB="/path/to/i18n/lib"

<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
/**
* This gist demonstrates how to properly load jQuery within the context of WordPress-targeted JavaScript so that you don't
* have to worry about using things such as `noConflict` or creating your own reference to the jQuery function.
*
* @version 1.0
*/
(function( $ ) {
"use strict";
$(function() {
// Clone the repo
git clone --depth=1 git://someserver/somerepo dirformynewrepo
// Remove the .git directory
rm -rf !$/.git
<?php # -*- coding: utf-8 -*-
declare( encoding = 'UTF-8' );
/**
* Plugin Name: Defer Contact Form 7 Scripts
* Description: Adds <code>defer='defer'</code> to enqueued javascripts.
* Version: 1.0
* Required: 3.3
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: GPL
<?php
/**
* Adds a simple WordPress pointer to Settings menu
*/
function thsp_enqueue_pointer_script_style( $hook_suffix ) {
// Assume pointer shouldn't be shown
$enqueue_pointer_script_style = false;
<?php
# License: Public Domain
# I recommend replacing 'my_' with your own prefix.
function my_template_path() {
return My_Wrapping::$main_template;
}
<?php namespace PaintedCloud\WP\Classes;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class CustomTaxonomy {
protected $textdomain;
protected $taxonomies;
public function __construct ( $textdomain )
<?php namespace PaintedCloud\WP\Classes;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class CustomPost {
protected $textdomain;
protected $posts;
public function __construct( $textdomain )
function my_load_meta() {
$script = '/js/script.js';
wp_enqueue_script( 'my-tools', get_template_directory_uri().$script, null, my_version_hash($script) );
$stylesheet = '/style.css';
wp_enqueue_style( 'my-style', get_template_directory_uri().$stylesheet, null, my_version_hash($stylesheet) );
}
add_action('wp_enqueue_scripts', 'my_load_meta');
// Create a hash of the file and pass it back for caching purposes
function my_version_hash($file) {