Skip to content

Instantly share code, notes, and snippets.

@marco-s
marco-s / gist:75b0b53a75999011c16f
Created February 25, 2016 01:12 — forked from anonymous/gist:80fb467852c2c71a5168
Add wp_termmeta table to WordPress database
function hm_add_term_meta_table() {
global $wpdb;
if ( ! current_theme_supports( 'term-meta' ) )
return false;
hm_create_term_meta_table();
$wpdb->tables[] = 'termmeta';
$wpdb->termmeta = $wpdb->prefix . 'termmeta';
}
add_action( 'init', 'hm_add_term_meta_table' );
/**
<script type='text/javascript'>
$(document).ready(function(){
var checkIframe = setInterval(function bringSecondPhase(){
if (iframeIsLoaded){
clearInterval(checkIframe)
console.log("iframe loaded!")
iframeHasAdvertismentAndShowOrHide()
}
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
<?php
/**
* Gravity Wiz // Gravity Forms // Populate Field With User Meta
*
* Populate choice-based fields (i.e. drop downs, radios, checkboxes) with data from WordPress users.
*
* @version 1.0
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
<?php
/*
Plugin Name: Favorites
Plugin URI:
Description: Let users save posts/pages as favorites - then access them through a quick menu.
Version: 1.0
Author: Crowd Favorite
Author URI: http://crowdfavorite.com
*/
<?php
// relies on https://gist.github.com/1549613
class WP_Widget_Recent_Posts_By_Format extends WP_Widget {
function __construct() {
$widget_ops = array('classname' => 'widget_recent_entries_by_format', 'description' => __( "The most recent posts on your site by format") );
parent::__construct('recent-posts-by-format', __('Recent Posts by Format'), $widget_ops);
$this->alt_option_name = 'widget_recent_entries_by_format';
@marco-s
marco-s / ms-remove-empty-menu-link.php
Last active July 11, 2024 06:47
WordPress menu: remove href link for "empty" menu items
<?php
# License: Public Domain
# I recommend replacing 'my_' with your own prefix.
function my_template_path() {
return My_Wrapping::$main_template;
}
@marco-s
marco-s / r-debug.php
Created February 26, 2014 18:50 — forked from Rarst/r-debug.php
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: http://www.rarst.net/
License: MIT
*/
/**
@marco-s
marco-s / gist.css
Created November 26, 2013 00:58 — forked from tollmanz/gist.css
.gist {
color: #e4322e;
}
.gistdiv {
padding: 0;
margin: 0;
}
.gist .gist-file {