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
<pre><?php | |
error_reporting(-1); | |
class BasicArrayObject implements ArrayAccess { | |
protected $_vars = array(); | |
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_filter( 'posts_join', function($join, $wp_query) { | |
global $wpdb; | |
if ( $wp_query->get('post_type') == 'topic' && $wp_query->get('participant') ) { | |
$join .= " | |
LEFT OUTER JOIN ( | |
SELECT DISTINCT(post_parent) |
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 | |
/** | |
* Empêche la mise à jour des plugins modifiés (identifié par un numéro de version contenant `modified`) | |
*/ | |
add_filter( 'pre_set_site_transient_' . 'update_plugins', 'dont_upgrade_modified_plugins' ); | |
function dont_upgrade_modified_plugins($value) | |
{ | |
if ( $value && isset($value->response) && $value->response) |
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
#!/bin/bash | |
if [ $# -eq 1 ] | |
NM=`uname -a && date` | |
NAME=`echo $NM | md5sum | cut -f1 -d" "` | |
then | |
ppa_name=`echo "$1" | cut -d":" -f2 -s` | |
if [ -z "$ppa_name" ] | |
then | |
echo "PPA name not found" | |
echo "Utility to add PPA repositories in your debian machine" |
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
if ( ! document.querySelectorAll) | |
{ | |
// http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed | |
document.querySelectorAll = function(selectors){ | |
var head = document.documentElement.firstChild; | |
var styleTag = document.createElement("STYLE"); | |
head.appendChild(styleTag); | |
document.__qsResult = []; | |
styleTag.styleSheet.cssText = selectors + "{x:expression(document.__qsResult.push(this))}"; |
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 | |
/** | |
* Author: Daniel Doezema | |
* Author URI: http://dan.doezema.com | |
* Version: 0.2 (Beta) | |
* Description: This script was developed to help ease migration of WordPress sites from one domain to another. | |
* | |
* Copyright (c) 2010, Daniel Doezema | |
* All rights reserved. | |
* |
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
window.fbAsyncInit = function() { | |
FB.init({ | |
appId : '<?php echo FB_APP_ID; ?>', // App ID | |
status : true, // check login status | |
cookie : true, // enable cookies to allow the server to access the session | |
oauth : true, // enable OAuth 2.0 | |
xfbml : true // parse XFBML | |
}); | |
FB.Canvas.setAutoGrow(); |
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
// Shadowbox | |
jQuery(function($){ | |
if (typeof Shadowbox == 'undefined') return; | |
// Correction du bug avec IE8 | |
var originalGetStyle = Shadowbox.lib.getStyle; | |
Shadowbox.lib.getStyle = function(el, style) { | |
var value = originalGetStyle.apply(Shadowbox.lib, arguments); | |
if ($.inArray(value, ['thin', 'medium', 'thick']) && style.match(/^border(-(top|right|bottom|left))?-width$/)) | |
{ |
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 admin_notice_blog_norobots() | |
{ | |
if ( ! get_option('blog_public') && current_user_can('manage_options')) | |
{ | |
printf('<div class="error">%s</div>', | |
"<p><strong>Attention</strong>, le site n'est actuellement pas indexable par les moteurs de recherche !</p>" | |
); | |
} |
OlderNewer