Skip to content

Instantly share code, notes, and snippets.

View codehooligans's full-sized avatar
🤠
I may be slow to respond.

Paul Menard codehooligans

🤠
I may be slow to respond.
View GitHub Profile
@codehooligans
codehooligans / wp_theme_customize_iframe.php
Created June 21, 2012 22:43
WordPress theme customizer iframe
<?php
/*
* Template Name: Theme Custom
*/
?>
<?php
if ( ! current_user_can( 'edit_theme_options' ) ) {
?><p>You doe not have access to custom this theme</p><?php
} else {
?><iframe src="http://local.wp34.com/wp-admin/customize.php" width="800" height="800"></iframe><?php
@codehooligans
codehooligans / popup_newsletter
Created June 20, 2012 16:08
WPMUDEV Newsletter within Popover
Test popover message. Test popover message. Test popover message. Test popover message. Test popover message. Test popover message. Test popover message. Test popover message.
Test popover message. Test popover message. Test popover message. Test popover message. Test popover message. Test popover message.
<form id="subscribes_form_popover" action="" method="post" name="subscribes_form_popover">
<input id="newsletter_action_popover" type="hidden" name="newsletter_action" value="" />
<div style="padding: 10px 5px 2px 10px;"><h5><input id="e_newsletter_email_popover" type="text" name="e_newsletter_email" /></h5></div>
<div style="padding: 10px 5px 2px 10px;"><input id="new_subscribe_popover" style="height: 2em; width: 10em;" type="button" value="Subscribe" /></div>
</form>
@codehooligans
codehooligans / mp-query-filter
Created June 19, 2012 15:26
WordPress MarketPress query filter
add_filter( 'query', 'mp_query_filter');
function mp_query_filter($query) {
global $wpdb;
if ( preg_match( '/('. $wpdb->base_prefix .'mp_terms|'. $wpdb->base_prefix .'mp_term_relationships)/i', $query ) ) {
$query_after = str_replace($wpdb->base_prefix."mp_terms", $wpdb->base_prefix."terms", $query);
$query_after = str_replace($wpdb->base_prefix."mp_term_relationships", $wpdb->base_prefix."mp_term_relationships", $query_after);
// DEBUG START - This following is just for debug to check the output. This will write