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 | |
/* | |
//CÓDIGO A INSERTAR EN EL HEADER DEL THEME DE MOODLE | |
ftp://dominio.es//domains/dominio.es/public_html/tuaulavirtual/theme/essential/layout/includes/header.php | |
<!-- jvrdbug --> | |
<?php | |
include($_SERVER['DOCUMENT_ROOT'].'/tuaulavirtual/check_user_can_access_content.php'); | |
//echo "<div style='display:none' id='jvrdbug'>".($_SERVER['DOCUMENT_ROOT'].'/tuaulavirtual/check_user_can_access_content.php')."</div>"; |
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 to convert text url into links. | |
function makeClickableLinks($s) { | |
return preg_replace('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@', '<a target="blank" rel="nofollow" href="$1" target="_blank">$1</a>', $s); | |
} | |
//usage | |
echo makeClickableLinks($str); |
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
/* WC HPD */ | |
//manage_product_posts_custom_column | |
add_filter( 'manage_edit-product_columns', 'products_customcol_fn' ); | |
function products_customcol_fn($columns){ | |
$new_columns = (is_array($columns)) ? $columns : array(); | |
$new_columns['HPD'] = 'hpd'; | |
return $new_columns; | |
} | |
add_action( 'manage_product_posts_custom_column', 'products_customcol_value_fn', 2 ); |
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 | |
/** | |
* Template Name: Movie Reviews | |
**/ | |
get_header(); | |
?> | |
<?php | |
global $post; | |
$posts = get_posts( array( 'post_type' => 'movie-reviews' ) ); |
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 | |
//create custom post type: movie review | |
function movie_reviews_init() { | |
$args = array( | |
'label' => 'Movie Reviews', | |
'public' => true, | |
'show_ui' => true, | |
'capability_type' => 'page',//post | |
'hierarchical' => false, | |
'rewrite' => array('slug' => 'movie-reviews'), |
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
//fn to prevent file caching | |
function flushVersion(length) { | |
var glyphs = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP1234567890"; | |
var version = ""; | |
for (var j = 0; j < length; j++) { | |
var i = Math.floor(Math.random() * glyphs.length); | |
version += glyphs.charAt(i); | |
} | |
return version; | |
} |
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 | |
//wp_get_active_and_valid_plugins() is the function which fetches all the active plugins and load them. | |
//This function gets these active plugins from the database where the list of active plugins are stored | |
//as an array in the wpdb_options table with option name as “active_plugins” | |
foreach ( wp_get_active_and_valid_plugins() as $plugin ) | |
include_once( $plugin ); | |
unset( $plugin ); | |
?> |
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 | |
/* | |
Plugin Name: WP API Load Time Enhancement | |
*/ | |
//http://codex.wordpress.org/Must_Use_Plugins | |
$listener_term = '/webservices/'; | |
$current_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . ''; | |
// if $current_url contains $listener_term |
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
var $test = $(".ricochet"), | |
multiply = function(x,y) { | |
console.log("multiply ok: " + x * y); | |
}, | |
siberet = function(add2div){ | |
$test.html("siberet ok");//write inside .ricochet | |
}; | |
siberet( multiply(2,4) );//initialize everythin' |
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
var app = { | |
layout: { | |
init: function() { | |
app.loader.init(); | |
console.info("1. app layout init"); | |
var wwidth = window.innerWidth; | |
var wheight = window.innerHeight; | |
windowdata(wwidth,wheight); | |
} |
OlderNewer