This file contains 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 | |
namespace WordPress\Filters; | |
class PreGetPosts{ | |
public $filterPriority = 10; | |
public function __construct( $priority = 10 ){ | |
//TODO: Set your custom properties if needed | |
$this->filterPriority; |
This file contains 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
Select post_date, count(post_date) as post_count from wp_posts | |
where post_status = 'publish' | |
and ( post_date between '2015-05-01' And '2015-05-30' ) | |
Group By DAYOFYEAR( post_date ) | |
; | |
This file contains 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 | |
// Este es un demo de la Sintaxis Curly de PHP | |
class Empleado{ | |
public $id; | |
public $nombre; | |
public $apellido; | |
public $email; |
This file contains 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 getPostByMeta( $metaKey, $metaValue, $operatos = '=' ){ | |
$args = array( | |
'showposts' => -1, | |
'meta_query' => array( | |
'relation' => 'AND', | |
array( | |
'key' => $metaKey, | |
'value' => $metaValue, |
This file contains 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
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 |
This file contains 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
{ | |
"name": "page-carbajal/my-awesome-package", | |
"description": "My Awesome Package", | |
"type": "Plugin", | |
"authors": [ | |
{ | |
"name": "Page Carbajal", | |
"email": "awesom@pagecarbajal.com" | |
} | |
], |
This file contains 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 | |
// 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; |
This file contains 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 | |
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') ){ |
This file contains 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
// 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 ************/ |
This file contains 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 | |
/** | |
* 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 ) ){ |
OlderNewer