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: Custom QW Field Example | |
Description: Example of custom Query Wrangler field with $post and $field parameters. | |
Author: Jonathan Daggerhart | |
Version: 1.0 | |
*/ | |
add_filter('qw_fields', 'custom_qw_field'); | |
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 the most recently replied-to topics, and their most recent reply | |
*/ | |
function custom_bbpress_recent_replies_by_topic($atts){ | |
$short_array = shortcode_atts(array('show' => 5, 'forum' => false, 'include_empty_topics' => false), $atts); | |
extract($short_array); | |
// default values |
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 | |
/* | |
* Filter for bbpress reply post_title, without "Reply To: " prefix | |
* - reference: https://bbpress.trac.wordpress.org/browser/trunk/src/includes/replies/template.php | |
*/ | |
function custom_bbp_get_reply_title_fallback( $post_title = '', $post_id = 0 ){ | |
// Bail if title not empty, or post is not a reply | |
if ( ! empty( $post_title ) || ! bbp_is_reply( $post_id ) ) { | |
return $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 | |
/* | |
* Get the most recently replied-to topics, and their most recent reply | |
*/ | |
function custom_bbpress_recent_replies_by_topic($atts){ | |
$short_array = shortcode_atts(array('show' => 5), $atts); | |
extract($short_array); | |
// get the 5 topics with the most recent replies |
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: Intro to Wordpres Plugin Development | |
Description: Generic example plugin | |
Plugin URI: http://www.daggerhart.com/blog/introduction-wordpress-plugin-development/ | |
Author: Jonathan Daggerhart | |
Author URI: http://www.daggerhart.com | |
Version: 1.0 | |
Text Domain: intro-to-plugin-dev | |
Domain: /lang |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require 'yaml' | |
# jon - | |
box_name = "ubuntu-trusty" | |
# end jon - | |
dir = File.dirname(File.expand_path(__FILE__)) | |
configValues = YAML.load_file("#{dir}/puphpet/config.yaml") |
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 disabled modules, skip 'test' modules | |
$modules = db_query("SELECT `name` FROM {system} WHERE TYPE = 'module' AND `status` = 0 AND `name` NOT LIKE '%test%' ORDER BY `name` DESC")->fetchCol(); | |
// ensure disabled | |
module_disable($modules); | |
// force uninstall | |
foreach ($modules as $module) { |
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 __cleanup_post_data(){ | |
global $wpdb; | |
// default wordpress "allowed html" for posts | |
$allowed_tags = wp_kses_allowed_html( 'post' ); | |
// don't allow spans | |
unset($allowed_tags['span']); |
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 | |
/** | |
* Example of using wp_kses() to clean up WordPress post data. | |
*/ | |
function __cleanup_post_data(){ | |
global $wpdb; | |
// default wordpress "allowed html" for posts | |
$allowed_tags = wp_kses_allowed_html( 'post' ); |
OlderNewer