Skip to content

Instantly share code, notes, and snippets.

@bainternet
bainternet / gist:1565110
Created January 5, 2012 12:46
include html
<div id="content">
<div class="lz_embed" v_id="MKIxhq8elrU"></div><br/><br/>
<div class="lz_embed" v_id="y-SpsT1dIJ0"></div><br/><br/>
<div class="lz_embed" v_id="YxGlfiP-3UA"></div><br/><br/>
</div>
@bainternet
bainternet / gist:1565112
Created January 5, 2012 12:47
include lyte_video js
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#content').lyte_video();
});
</script>
@bainternet
bainternet / gist:1706524
Created January 30, 2012 20:36
Notify admin on new post pending
<?php
add_action('new_to_pending','notify_admin_on_pending');
function notify_admin_on_pending($post){
add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
$message = '
<p>
You have a new post pending a review:<br />
'.$post->post_title.' <br />
<a href="'.get_edit_post_link( $post->ID).'">Edit the Post</a>
</p>
@bainternet
bainternet / DD32s-combine-plugin.php
Created February 11, 2012 17:06 — forked from mjc/DD32s-combine-plugin.php
WIP: Combine Javascript and CSS in wordpress
<?php
/*
Plugin Name: The Combiner
Plugin URI: http://dd32.id.au/wordpress-plugins/?plugin=combine-css-js
Description: Combine CSS & JS into one large monolithic file
Author: DD32
Version: 1.0
Author URI: http://dd32.id.au/
*/
@bainternet
bainternet / .gitignore
Created February 25, 2012 14:46 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@bainternet
bainternet / image-shortcode.php
Created March 19, 2012 10:55 — forked from kovshenin/image-shortcode.php
Image shortcode for WordPress
<?php
/**
* Image shortcode callback
*
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files
* from existing media library entries. Usage:
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"]
*
* @uses image_make_intermediate_size
*/
@bainternet
bainternet / gist:2175805
Created March 23, 2012 22:32
simple view counter for wordpress plugin
<?php
/*
Plugin Name: Simple Post Views
Plugin URI: http://en.bainternet.info
Description: Simple And lightweight plugin to track post views.
Version: 0.2
Author: Bainternet
Author URI: http://en.bainternet.info
*/
if ( !class_exists('PostViews')){
<?php
/*
Plugin Name: User Meta Upload
Plugin URI: http://trepmal.com
Description: Add a file-upload form to the user edit profile page
Version: 0.1
Author: Kailey Lampert
Author URI: http://kaileylampert.com
Copyright (C) 2012 Kailey Lampert
@bainternet
bainternet / gist:2916079
Created June 12, 2012 08:08
custom post type id in premalink
<?php
//in register post type args array set rewrite to:
'rewrite' => array(
'slug' => 'mycpt',
'with_front' => false,
'feeds' => false,
'pages' => true
)
//then add this to functions.php
@bainternet
bainternet / wp-registration-keys.php
Created September 23, 2012 18:59 — forked from chrisguitarguy/wp-registration-keys.php
Only lets users with an invite code register for a WordPress site.
<?php
/*
Plugin Name: WP Invite Codes
Plugin URI: http://pmg.co/
Description: Makes wordpress an invite only community.
Version: n/a
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
*/