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
/** | |
* [[%%ask1: Nombre del Widget]] | |
* [[%%ask2: Descripción]] | |
*/ | |
class [[%%ask3: Nombre de la función]] extends WP_Widget { | |
/** constructor */ | |
function [[%%ask3]]() { | |
$widget_ops = array('classname' => '[[%%ask3]]', 'description' => '[[%%ask2]]'); | |
$control_ops = array('width' => 400); | |
$this->WP_Widget('[[%ask3]]', '[[%%ask1]]', $widget_ops, $control_ops); |
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 | |
/* Register WordPress theme settings ******************************************/ | |
/* Navigation menus -----------------*/ | |
register_nav_menus( array( | |
'primary' => 'Principal' | |
)); | |
/* Images ---------------------------*/ | |
add_theme_support( 'post-thumbnails' ); | |
/* Sidebars -------------------------*/ |
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 | |
/** | |
* To be used on a WordPress Widget object | |
* Fields named as '_foo_bar' will become $new_instance['foo']['bar'] = $val | |
* Fields named as '_lorem_ipsum_dolor' become $new_instance['lorem']['ipsum']['dolor'] = $val | |
**/ | |
function update( $new_instance, $old_instance ) { | |
foreach ( $new_instance as $key => $val ) { |
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
// comillas internas | |
'. [[%(w:else:)]] .' | |
// concatenar a $out | |
$out .= '[[%(w:else:)]]'; |
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 | |
abstract class av_transients_helper{ | |
var $transient_name; | |
var $expire; | |
function __construct($id, $expire){ | |
$this->transient_name = $id; | |
$_expire = ( (int)$expire > 0 ) ? (int)$expire : 1; | |
$this->transient_expire = 60 * 60 * $_expire; | |
} | |
public function get_data(){ |
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 | |
/** | |
* Basically, a posts objects iterator | |
* @author Felipe Lavín Z. <[email protected]> | |
**/ | |
abstract class av_post_objects{ | |
public $id; | |
public $meta; | |
public $type; |
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
#! /bin/bash | |
if curl --write-out %{http_code} --silent --output /dev/null http://www.yukei.net | grep 504 | |
then | |
killall -s KILL php-cgi | |
spawn-fcgi -U www-data -G www-data -a 127.0.0.1 -p 47990 /usr/bin/php-cgi | |
fi |