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 theme_pwal_url_filter($href='') { | |
// Just replace 'key1' and 'value1' with your custom URL key1=value1 set | |
return add_query_arg( array('key1' => 'value1'), $href ); | |
} | |
add_filter('pwal_url_to_like', 'theme_pwal_url_filter'); |
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 check_upgrade() { | |
// Check our version against the options table | |
if (is_multisite()) | |
$options_version = get_site_option('wpmudev-chat-version'); | |
else | |
$options_version = get_option('wpmudev-chat-version'); | |
if (version_compare($this->chat_current_version, $options_version) > 0) { | |
$this->install(); |
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
<html dir="ltr" lang="en-US"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Scroll tester</title> | |
<style type="text/css"> | |
#scroll-box { margin-top: 100px; width: 100%; background-color: #666bea; font-family: Arial, Helvetica, sans-serif;font-size: 12px;; } | |
#scroll-box div.scroll-messages-list { position: relative; height:250px; overflow: auto; background-color: #FFFFFF; border:1px solid #CCCCCC; } | |
#scroll-box div.scroll-messages-list div.row { position: relative; background-color:#FFFFFF; border:1px solid #CCCCCC; height: 100px;} | |
#scroll-box div.scroll-messages-list div.row span.message { color:#000000; } | |
</style> |
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
/* Simple function to show existing WordPress filters */ | |
function show_filter($filter_key='') { | |
if (empty($filter_key)) return false; | |
global $wp_filter; | |
if (isset($wp_filter[$filter_key])) { | |
foreach($wp_filter[$filter_key] as $priority => $filter_sets) { | |
echo "=== Priority [{$priority}] ===<br />"; | |
foreach($filter_sets as $filter_set_key => $filter_set_data) { | |
echo $filter_set_key."<br />"; |
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
$item_output .= '<div class="live-stream-text">'; | |
/* Show the User Name */ | |
if (isset($user_data['display_name'])) | |
$item_output .= $author_anchor_begin . $user_data['display_name'] . $author_anchor_end ." "; | |
if ($item->post_type == "comment") { | |
$item_output .= __(" commented on ", LIVE_STREAM_I18N_DOMAIN); ; | |
/* Show the Post Title */ |
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 | |
add_action('admin_init','my_postdatemeta_init'); | |
add_action('save_post', 'env_save_post_date_meta', 1, 2); // save the custom fields | |
/*** Add Post Date Metabox */ | |
function my_postdatemeta_init() | |
{ | |
// Paul: The metaboarcx are really just display for the admin to check the date. Should not be seen for regular users. | |
if (get_current_user_id() == 1) { // Change the '1' to some other userID | |
// Paul: changed so all post_types use the same metabox. Don't need one just for Events. |
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 Post Date Metabox */ | |
function my_postdatemeta_init() | |
{ | |
add_meta_box('env_post_date_meta', 'Admin Meta', 'env_post_date_meta', 'post', 'normal', 'low'); | |
add_meta_box('env_post_date_meta', 'Admin Meta', 'env_post_date_meta', 'news', 'normal', 'low'); | |
add_meta_box('env_event_date_meta', 'Admin Meta', 'env_event_date_meta', 'ai1ec_event', 'normal', 'low'); | |
} | |
add_action('admin_init','my_postdatemeta_init'); |
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 theme_switcher_markup( $style = 'text', $instance = array() ) { | |
if ( ! $theme_data = wp_cache_get('themes-data', 'advanced-theme-switcher') ) { | |
$themes = (array) get_themes(); | |
if (!$themes) return; | |
if ( is_multisite() ) { | |
//$allowed_themes = (array) get_site_option( 'allowedthemes' ); | |
$allowed_themes = WP_Theme::get_allowed(); |
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
/* Exclude logic for MarketPress Product Categories */ | |
// Add product_categories to exclude here. Note this is an array so multiple category IDs need to be seperated by comma. Also wrapped in single quote. | |
// The minus sign is not used. You need to update the mp_excluded_categories with the slugs of your excluding categories. | |
$mp_excluded_categories = array('products'); | |
// Page ID to redirect non-logged in users when viewing a single product page associated with an excluded category | |
$mp_redirect_archive_page_id = 123; | |
// Page ID to redirect non-logged in users when viewing a product category archive for an excluded category |
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 mp_js_override() { | |
global $mp; | |
if (!is_object($mp)) return; | |
// #1 - Disable AJAX on the Product page. | |
remove_action( 'template_redirect', array(&$mp, 'store_script') ); //only on front pages | |
// #2 - Deregister the MP script(s) and reregister in the footer. |