Well this is kind of fun right. Specially since must of us have not used SVN for over 10 years.
Lets do this. Our objective here is to create a common codebase for both SVN and Git.
<?php | |
/** | |
* Return the Post Thumbnail URL if $post has thumbnail | |
* $post is a WordPress Post Object | |
* @param $post | |
* @return string | |
*/ | |
private function getPostThumbnailURL( $post ){ | |
if ( has_post_thumbnail( $post->ID ) ){ |
// Force jQuery Injection | |
(function($d){ | |
if( 'undefined' === typeof jQuery ){ | |
var head = document.getElementsByTagName("head")[0]; | |
var customScript = document.createElement("script"); | |
customScript.src = scriptSource; | |
customScript.onload = function(){ | |
if( jQuery ){ | |
/******** Start writing you jQuery code here ************/ |
<?php | |
add_action('template_redirect','justIfContentHas'); | |
function justIfContentHas() | |
{ | |
global $post; | |
// Set the condition for loading your resources | |
if( has_shortcode($post->post_content, 'my_short_code') ){ |
<?php | |
// Late Static Binding in PHP are great. | |
// However they are not supported in every version of PHP | |
// Use the code below in a new 3val.org window to test support | |
// for Late Static Bindings inside closures. | |
abstract class Demo | |
{ | |
protected $item; |
{ | |
"name": "page-carbajal/my-awesome-package", | |
"description": "My Awesome Package", | |
"type": "Plugin", | |
"authors": [ | |
{ | |
"name": "Page Carbajal", | |
"email": "awesom@pagecarbajal.com" | |
} | |
], |
xdebug.remote_enable=1 | |
xdebug.profiler_enable=1 | |
xdebug.profiler_output_name = xdebug.profiler.%H.%t | |
xdebug.profiler_enable_trigger=1 | |
xdebug.profiler_output_dir=/set/a/path |
<?php | |
function getPostByMeta( $metaKey, $metaValue, $operatos = '=' ){ | |
$args = array( | |
'showposts' => -1, | |
'meta_query' => array( | |
'relation' => 'AND', | |
array( | |
'key' => $metaKey, | |
'value' => $metaValue, |