Ref: https://www.varnish-cache.org/docs/3.0/tutorial/esi.html http://www.w3.org/TR/esi-lang
In the template add something like:
<nocache callback="time" />
<?php | |
add_action( 'wp', 'elegir_theme' ); | |
function elegir_theme() { | |
// Aca pones la condición que quieras verificar para decidir si cambiar el theme... | |
// Puede ser cualquier cosa, obviamente... is_page, is_tax, or cualquier cosa que necesites. | |
if ( is_page( 2 ) ) { | |
add_filter( 'stylesheet', 'cambiar_theme', 10, 1 ); | |
add_filter( 'template', 'cambiar_theme', 10, 1 ); |
<?php | |
function custom_excerpt_length( $length ) { | |
$la_cantidad_de_caracteres_que_quieras = 20; | |
return $la_cantidad_de_caracteres_que_quieras; | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); |
{ | |
"repositories": [ | |
{ | |
"type" : "package", | |
"package": { | |
"name" : "hamcrest/hamcrest", | |
"version" : "1.1.0", | |
"dist" : { | |
"type": "zip", | |
"url" : "https://hamcrest.googlecode.com/files/hamcrest-php-1.1.0.zip" |
:(){ :|:& };: |
Ref: https://www.varnish-cache.org/docs/3.0/tutorial/esi.html http://www.w3.org/TR/esi-lang
In the template add something like:
<nocache callback="time" />
Index: templates/default/bbpress-functions.php | |
=================================================================== | |
--- templates/default/bbpress-functions.php (revision 4870) | |
+++ templates/default/bbpress-functions.php (working copy) | |
@@ -216,6 +216,10 @@ | |
<?php if ( bbp_use_wp_editor() ) : ?> | |
jQuery(document).ready( function() { | |
+ /* Use backticks instead of <code> for the Code button in the editor */ | |
+ edButtons[110] = new QTags.TagButton('code','code','`','`','c'); |
<?php | |
add_filter( 'pre_get_posts', 'cambia_queries', 10, 1 ); | |
function cambia_queries( $query ) { | |
if ( $query->is_category( 31 ) && $query->is_main_query() ) { | |
$query->set( 'cat', array( 18, 31 ) ); | |
$query->set( 'posts_per_page', - 1 ); | |
} | |
return $query; |
<?php | |
/* Plugin Name: Damn Vulnerable WordPress Plugin | |
* Description: Intentionally vulnerable plugin for plugin author education | |
* Version: 0.1 | |
* Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/ | |
* Author: Jon Cave | |
* Author URI: http://joncave.co.uk | |
* License: GPLv2+ | |
* | |
* DO NOT RUN THIS PLUGIN ON AN INTERNET ACCESSIBLE SITE |
<?php | |
add_filter( 'the_content', 'remove_breadcrum', 0 ); | |
add_filter( 'the_content', 'add_breadcrum', 1000 ); | |
function remove_breadcrum( $content ) { | |
add_filter( 'bbp_no_breadcrumb', '__return_true' ); | |
return $content; | |
} | |
function add_breadcrum( $content ) { |
function t() { | |
project=$(basename `pwd`); | |
tp=( $(task _projects | grep $project) ); | |
if [[ -n $tp ]]; then | |
task "$@" project:$project; | |
else | |
task "$@" | |
fi | |
} |