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 data to HTML according to object's property name | |
function addContentFromDataToHtml(object, dataSet) { | |
recursiveObject({object: object, callback: addContentFromDataToHtmlCallback, dataSet: dataSet}); | |
} | |
var recursiveObject = function(recursiveParams) { | |
if (recursiveParams.parentsItem) { | |
recursiveParams.parentsItem = recursiveParams.parentsItem+'.'; | |
} else { | |
recursiveParams.parentsItem = ''; | |
} |
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 | |
// enqueue these scripts and styles before admin_head | |
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though... | |
wp_enqueue_style( 'wp-jquery-ui-dialog' ); | |
?> | |
<!-- The modal / dialog box, hidden somewhere near the footer --> | |
<div id="my-dialog" class="hidden" style="max-width:800px"> | |
<h3>Dialog content</h3> | |
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p> |
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: Import demo | |
Plugin URI: http://royduineveld.nl | |
Description: A demo import for my blog | |
Version: 1.0 | |
Author: Roy Duineveld | |
Author URI: http://royduineveld.nl | |
*/ |
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_filter( 'the_content', 'crd_append_post_links' ); | |
function crd_append_post_links( $content ) { | |
if ( is_page() ) { | |
$post_links_data = get_post_meta( get_the_ID() ); | |
if ( isset( $post_links_data[ 'blog_group' ][ 0 ] ) ) { | |
$blog_list = maybe_unserialize( $post_links_data[ 'blog_group' ][ 0 ] ); | |
$posts_list = '<ul>'; | |
foreach ( $blog_list as $post_info ) { |
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: Multisite: Passwort Reset on Local Blog | |
* Plugin URI: https://gist.github.com/eteubert/293e07a49f56f300ddbb | |
* Description: By default, WordPress Multisite uses the main blog for passwort resets. This plugin enables users to stay in their blog during the whole reset process. | |
* Version: 1.0.0 | |
* Author: Eric Teubert | |
* Author URI: http://ericteubert.de | |
* License: MIT | |
*/ |
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($) { | |
var style = $('#yourtheme-color-scheme-css'), | |
api = wp.customize; | |
if (!style.length) { | |
style = $('head').append('<style type="text/css" id="yourtheme-color-scheme-css" />') | |
.find('#yourtheme-color-scheme-css'); | |
} | |
// Color Scheme CSS. | |
api.bind('preview-ready', function() { |
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 | |
/** | |
* The constants defined here are used as a fallback to whatever options you | |
* end up specifying specifically. | |
* | |
* @var constant string | |
*/ | |
define('WATERMARK_SOURCE', ABSPATH.'/wp-content/themes/mytheme/images/fb_thumb_watermark.png'); | |
define('WATERMARK_ORIENTATION', 'bottom right'); |
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
if( ! function_exists( 'wp_date_format_php_to_js') ){ | |
/** | |
* Convert a date format to a jQuery UI DatePicker format | |
* | |
* @param string $dateFormat a date format | |
* | |
* @return string | |
*/ | |
function wp_date_format_php_to_js( $dateFormat ) { |
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 | |
// Get all blog ids in network except main site (id 1) | |
$blogs = $wpdb->get_results(" | |
SELECT blog_id | |
FROM {$wpdb->blogs} | |
WHERE site_id = '{$wpdb->siteid}' | |
AND spam = '0' | |
AND deleted = '0' | |
AND archived = '0' |
OlderNewer