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
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
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
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 | |
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
<!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
if ( ! function_exists( 'unregister_post_type' ) ) : | |
function unregister_post_type( $post_type ) { | |
global $wp_post_types; | |
if ( isset( $wp_post_types[ $post_type ] ) ) { | |
unset( $wp_post_types[ $post_type ] ); | |
return true; | |
} | |
return false; | |
} | |
endif; |
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 showit( $stuff ) { | |
if( is_array( $stuff ) ) { | |
foreach( $stuff as $s ) | |
showit( $s ); | |
} else { | |
echo $stuff; | |
} | |
} |
OlderNewer