Zoe Rooney | Slides: http://bit.ly/take-wp-out
Pros | Cons |
---|---|
quick & easy | potential for conflicts |
someone else maintains them | no one updates or maintains them |
<?php | |
add_filter( 'mce_css', 'jpry_add_editor_styles' ); | |
/** | |
* Filter the TinyMCE styles. | |
* | |
* @param string $styles The comma-separated list of stylesheets to be loaded by TinyMCE. | |
* | |
* @return string The updated comma-separated list of stylesheets to be loaded by TinyMCE. | |
*/ |
<?php | |
/** | |
* Register a template_part shortcode handler. | |
* | |
* @param array $atts The array of attributes the user entered into the shortcode. | |
*/ | |
function template_part_shortcode( $atts ) { | |
$defaults = array( | |
'main_part' => 'loop', |
<?php | |
add_filter( 'pre_get_posts', 'sample_pre_get_posts' ); | |
function sample_pre_get_posts( $query ) { | |
// Possibly check to make sure this is the query we want to modify | |
if ( $query->is_main_query() && ! $query->is_admin() ) { | |
$query->set( 'post_status', array( | |
'draft', | |
'publish', | |
'pending', |
<?php | |
$some_var = 'something'; | |
$func = function() use ( $some_var ) { | |
echo $some_var; // echos "something" | |
}; | |
$func(); |
Zoe Rooney | Slides: http://bit.ly/take-wp-out
Pros | Cons |
---|---|
quick & easy | potential for conflicts |
someone else maintains them | no one updates or maintains them |
<?php | |
/** | |
* Plugin Name: Allow Heartbeat on more pages | |
* Plugin URI: https://gist.github.com/JPry/b1f6c55a5d5337557f97 | |
* Description: Allow the Heartbeat API on more pages in the Dashboard | |
* Version: 1.0 | |
* Author: Jeremy Pry | |
* Author URI: http://jeremypry.com/ | |
* License: GPL2 | |
*/ |
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install python-software-properties curl
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu precise main'
sudo apt-get update
sudo echo -e "Package: *\nPin: origin ftp.osuosl.org\nPin-Priority: 1000" | tee /etc/apt/preferences.d/mariadb
sudo apt-get install mariadb-server
mysql -uroot -p
This content has been moved. Please see http://jeremypry.com/wordpress-plugin-development-with-github/
In your theme, you should be using the wp_enqueue_style()
function instead of calling your stylesheet directly in your header.php
file. Use something like this in your theme's functions.php
file:
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_stylesheet' );
<?php | |
// full path to customer log file | |
$log_file = __DIR__.'/../__admin_ajax.log'; | |
// if it's not a POST request, just move along | |
if($_SERVER['REQUEST_METHOD'] != "POST") { | |
return(0); | |
} | |
// if you only want specific files like admin-ajax or xmlrpc, uncomment the next line |