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
function rkv_custom_redirect() { | |
$source = 'http://domain.com/default.aspx'; | |
$redirect = 'http://domain.com/'; | |
if ($source) { | |
wp_redirect( esc_url_raw( $redirect ), 301 ); | |
exit(); | |
} |
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
// front end | |
function custom_front_scripts() { | |
wp_enqueue_style( 'front-css', plugins_url('/lib/css/front-css.css', __FILE__), array(), null, 'all' ); | |
wp_enqueue_script( 'front-init', plugins_url('/lib/js/front.init.js', __FILE__) , array('jquery'), null, true ); | |
} | |
add_action('wp_enqueue_scripts', 'custom_front_scripts' ); | |
// back end | |
function custom_admin_scripts() { |
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 rkv_plugin_list($user) { | |
$url = 'http://api.wordpress.org/plugins/info/1.0/'; | |
$args = array( | |
'body' => array ( | |
'action' => 'query_plugins', | |
'request' => serialize( (object) array( | |
'author' => $user, |
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
// filter inside theme or plugin | |
function schema_bodyitems($item) { | |
$item[] = 'itemtype="http://schema.org/Blog"'; | |
$item[] = 'itemscope=""'; | |
return $item; | |
} |
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
// assuming that the input that fires the pop-up has the ID of 'pop_form'. Change as needed. | |
$('input#pop_form').trigger('click'); |
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
add_shortcode( 'liveblog_recap', 'wpcom_liveblog_recap' ); | |
function wpcom_liveblog_recap( $atts, $content = null) { | |
// get ID if shortcode has declared | |
extract(shortcode_atts(array( | |
'id' => '' | |
), $atts)); | |
// bail if missing ID | |
if (empty($id)) | |
return $content; |
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
case 'page_select': | |
echo '<select name="', $field['id'], '" id="', $field['id'], '">'; | |
$linked_items = get_posts(array( | |
'post_type' => array ('page',), | |
'post_status' => 'publish', | |
'posts_per_page' => -1, | |
'orderby' => 'modified', | |
'order' => 'DESC' | |
)); | |
foreach ($linked_items as $linked_item) { |
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: Mukulla Custom Widgets | |
Plugin URI: https://gist.github.com/3726056 | |
Description: A test plugin for showing some example widgets | |
Version: 0.1 | |
Author: norcross | |
Author URI: http://andrewnorcross.com | |
License: GPL2 | |
*/ |
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
body { | |
background-color: #FFFFFF; | |
color: #111; | |
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; | |
font-size: 14px; | |
line-height: 20px; | |
margin: 0; | |
} | |
#wrapper { | |
width: 500px; |