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
<!DOCTYPE html> | |
<html lang="en-US" prefix="og: http://ogp.me/ns#"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>JS Driven Weather View</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> | |
<script src="https://raw.github.com/andris9/jStorage/master/jstorage.js"></script> |
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( 'do_meta_boxes', function() { | |
global $pagenow; | |
if( 'edit.php' != $pagenow ) { | |
// Only show on edit.php page | |
return; | |
} | |
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_filter( 'the_content', function( $content ) { | |
$response = wp_remote_get( 'http://ben.lobaugh.net/wp-json/posts' ); | |
if( '200' == wp_remote_retrieve_response_code( $response ) ) { | |
$posts = json_decode( wp_remote_retrieve_body( $response ) ); | |
foreach( $posts AS $p ) { | |
echo $p->title->rendered . "<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
<?php | |
/* | |
* wp-content/install.php | |
* | |
* This file runs automatically when the WordPress installer is run. | |
* Most WordPress functionality will be available to provide the ability | |
* to perform any additional actions on installation you would like. | |
*/ | |
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
Missing from the Plugin Handbook | |
These are notes of things from the new plugin handbook that are either currently missing or that need some serious updating. | |
Section 1 - Intro to Plugin Dev | |
How do plugins work | |
What is a plugin - Just sounds cheesy, and it is inaccurate on what a plugin needs. See 2. Plugin Basics | |
Section 2 - Plugin Basics | |
Activation/Deactivation hooks |
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
syntax on | |
set number | |
set linebreak | |
set showbreak=+++ | |
set textwidth=0 | |
set showmatch | |
set visualbell | |
set hlsearch | |
set smartcase | |
set ignorecase |
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 | |
echo $bob['thisisbad']; |
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: Serve from WordPress.com | |
Plugin URI: http://github.com/blobaugh/serve-from-wordpress-com | |
Description: Switches the URL on built-in WordPress javascript files to serve from WordPress.com rather than locally | |
Author: Ben Lobaugh | |
Version: 0.6 | |
Author URI: http://ben.lobaugh.net | |
*/ |
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 tweakjp_custom_is_support() { | |
$supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || is_search() ); | |
return $supported; | |
} | |
add_filter( 'infinite_scroll_archive_supported', 'tweakjp_custom_is_support' ); |
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 tweakjp_allow_cpt( $allowed_post_types ) { | |
// my_cpt is the name of your <span class="hilite">Custom</span> <span class="hilite">Post</span> <span class="hilite">Type</span> | |
$allowed_post_types[] = 'my_cpt'; | |
return $allowed_post_types; | |
} | |
add_filter( 'rest_api_allowed_post_types', 'tweakjp_allow_cpt' ); |