Skip to content

Instantly share code, notes, and snippets.

View dvdpearson's full-sized avatar

David Pearson dvdpearson

  • San Francisco, CA
View GitHub Profile
<?xml version="1.0"?>
<config>
<modules>
<NewNamespace_NewModule>
<version>1.0.0</version>
</NewNamespace_NewModule>
</modules>
</config>
<?xml version="1.0"?>
<config>
<modules>
<NewNamespace_NewModule>
<active>true</active>
<codePool>local</codePool>
</NewNamespace_NewModule>
</modules>
</config>
@dvdpearson
dvdpearson / function.php
Last active November 22, 2023 20:58
Temporary disable WPML's adjust_id functionality in order to let me choose the right locale
global $sitepress;
$translated_term_id = icl_object_id($term_id, $taxonomy, true, $language_code);
remove_filter( 'get_term', array( $sitepress, 'get_term_adjust_id' ), 1 );
$translated_term_object = get_term_by('id', $translated_term_id, $taxonomy);
add_filter( 'get_term', array( $sitepress, 'get_term_adjust_id' ), 1, 1 );
$pays = array(
"ad" => "andorre",
"ae" => "emirats arabes unis",
"af" => "afghanistan",
"ag" => "antigua-et-barbuda",
"ai" => "anguilla",
"al" => "albanie",
"am" => "arménie",
"an" => "antilles",
"ao" => "angola",
var $country = array(
'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica', 'Antigua And Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia And Herzegovina', 'Botswana', 'Bouvet Island', 'Brazil', 'British Indian Ocean Territory', 'Brunei', 'Bulgaria', 'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon', 'Canada', 'Cape Verde', 'Cayman Islands', 'Central African Republic', 'Chad', 'Chile', 'China', 'Christmas Island', 'Cocos (Keeling) Islands', 'Columbia', 'Comoros', 'Congo', 'Cook Islands', 'Costa Rica', 'Cote D\'Ivorie (Ivory Coast)', 'Croatia (Hrvatska)', 'Cuba', 'Cyprus', 'Czech Republic', 'Democratic Republic Of Congo (Zaire)', 'Denmark', 'Djibouti', 'Dominica', 'Dominican Republic', 'East Timor', 'Ecuador', 'Egypt', 'El Salvador', 'Equatorial Guinea', 'Eritrea', 'Estonia', 'Ethiopia', 'Falkland Islands
@dvdpearson
dvdpearson / gist:5724459
Created June 6, 2013 20:00
A set of small, responsive CSS modules that you can use in every web project.
http://purecss.io/
<?php
/**
* Remove a given term from the specified post
*
* Helper function since this functionality doesn't exist in core
*/
function my_remove_post_term( $post_id, $term, $taxonomy ) {
if ( ! is_numeric( $term ) ) {
@dvdpearson
dvdpearson / gist:5672393
Created May 29, 2013 18:07
froont - Responsive web design, the visual way
http://froont.com/
@dvdpearson
dvdpearson / gist:5672372
Created May 29, 2013 18:06
IE 10+ - Transit - Super Smooth CSS Transitions for jQuery
http://ricostacruz.com/jquery.transit/