This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class shortcode { | |
//Shortcode name | |
public $name = 'shortcode_name' | |
//Default attributes | |
public $args = array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class custom_post_type { | |
//Custom post type name | |
public $post_type_name = 'name'; | |
//Custom metabox key | |
public $key = $this->post_type_name = 'key'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class custom_metabox { | |
//Custom metabox key | |
public $key = 'meta_box_key'; | |
//Custom metabox options | |
public $options = array( | |
'post_types' => get_post_types(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Urls | |
$tweet = preg_replace('/(http[^\s]+)/', '<a target="_blank" class="tweet-link" href="$1">$1</a>', $tweet->text); | |
//Mentions | |
$tweet = preg_replace('/\@([a-zA-Z1-9]+)/', '<a title="@$1" target="_blank" href="https://twitter.com/$1" class="tweet-user">@$1</a>', $string); | |
//Hashtags | |
$tweet = preg_replace('/#([a-zA-Z1-9]+)/', '<a title="#$1" target="_blank" href="https://twitter.com/search?q=%23$1&src=hash" class="tweet-hashtag">#$1</a>', $string); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Get transient data | |
$data = get_transient( 'data_key' ); | |
//Check transient data exists | |
if(!$data){ | |
//Query API |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp.services', []) | |
.service('$_http', function($http, $q, $compile) { | |
//Serialize Parameters | |
var $param = function(obj){ | |
var query = '', | |
name, value, fullSubName, subName, subValue, innerObj, i; | |
for(name in obj){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ui = { | |
buildMarkers: function( data, first ){ | |
var results = []; | |
$.each( data, function(i, marker){ | |
var html = ui.buildHTML( marker.title, marker.address, marker.telephone ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sc_pagination( $query ){ | |
$string = ""; | |
if( !$query ){ | |
global $wp_query; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Encode | |
function encodeBase64( string ){ | |
try{ | |
if( typeof string == 'object'){ | |
throw 'error'; | |
} | |
return window.btoa(unescape(encodeURIComponent( string ))); | |
} catch(e){ | |
return false; |
OlderNewer