Skip to content

Instantly share code, notes, and snippets.

@seebz
seebz / basic-array-object.php
Created October 7, 2011 15:52
BasicArrayObject
<pre><?php
error_reporting(-1);
class BasicArrayObject implements ArrayAccess {
protected $_vars = array();
@seebz
seebz / custom-post-type-archive-menu-links.php
Created July 20, 2012 09:59 — forked from helgatheviking/custom-post-type-archive-menu-links.php
Adds Custom Post Type archives to the WordPress-powered menus
<?php
/*
Plugin Name: Custom Post Type Archive Menu Links
Plugin URI: http://codeseekah.com/2012/03/01/custom-post-type-archives-in-wordpress-menus-2/
Description: Easily Add Custom Post Type Archives to the Nav Menus
Version: 1.0
Author: soulseekah
Author URI: http://codeseekah.com
License: GPL2
@seebz
seebz / user-topics-replied-to.php
Created July 29, 2012 13:35
Missing bbp template file
<?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)
@seebz
seebz / gist:3706322
Created September 12, 2012 12:33
WP: Empêche la mise à jour des plugins modifiés
<?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)
#!/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"
@seebz
seebz / gist:3787098
Created September 26, 2012 09:54
document.querySelector for IE7
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))}";
<?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.
*
@seebz
seebz / gist:3904297
Created October 17, 2012 07:59
FB app page tab - infinite scroll
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();
@seebz
seebz / gist:4123863
Created November 21, 2012 08:48
Shadowbox IE8 fix
// 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$/))
{
@seebz
seebz / gist:4161791
Created November 28, 2012 14:57
WP admin_notice_blog_norobots
<?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>"
);
}