Skip to content

Instantly share code, notes, and snippets.

Mike Schinkel mikeschinkel

Block or report user

Report or block mikeschinkel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mikeschinkel / test-get-comment-replies.php
Created Sep 23, 2010
get_comment_replies() function for WordPress with a working example that returns a WordPress comment object for a given comment ID annotated with "reply_count" and "replies" properties.
View test-get-comment-replies.php
* test-get-comment-replies.php
* Returns a comment object for a given comment ID annotated with "reply_count" and "replies" properties:
* reply_count: count of all replies including sum of child replies.
* replies: array of child comment objects also annotated with "reply_count" and "replies" properties, recursively.
* Examples:
mikeschinkel /
Last active Jul 29, 2019
List of funcs in GoLang 1.12.6 SDK w/over declarations over 100 characters long
# This is how I created funcs.txt
# I also manually edited out anything that was not a func declaration
find /usr/local/opt/go/libexec/src/. | grep "\.go" | grep -v syscall | xargs awk '{print length, $0}' |grep func |grep -v "="|grep -v "//" |sort -nr | head -1000 > funcs.txt
mikeschinkel / index.php
Created Jul 21, 2019
Example PHP showing how to "return" a value from a require()
View index.php
$version = require(__DIR__.'/version.php');
echo "The current version is {$version}";
View gist:503778
* Example code showing how to hook WordPress to add fields to the taxonomny term edit screen.
* This example is meant to show how, not to be a drop in example.
* This example was written in response to this question:
mikeschinkel / .readme.txt
Last active May 8, 2019
Proof-of-concept example of Swift using The Break/Continue Guard Clause pattern
View .readme.txt
Here is an example of using what I am currently calling the Break/Continue Guard Clause pattern.
View functions.php
Description: Adds a taxonomy filter in the admin list page for a custom post type.
Written for:
By: Mike Schinkel -
Instructions: Put this code in your theme's functions.php file or inside your own plugin. Edit to suite your post types and taxonomies. Hope this helps...
add_filter('manage_listing_posts_columns', 'add_businesses_column_to_listing_list');
function add_businesses_column_to_listing_list( $posts_columns ) {
if (!isset($posts_columns['author'])) {
mikeschinkel / log.txt
Created May 6, 2019
Raw grep file for WordPress plugins having 'wp_edit_nav_menu_walker' hook as of 2019-05-05
View log.txt
add-to-menus-lite/index.php: add_filter( 'wp_edit_nav_menu_walker', array( $this, 'edit_nav_menu_walker' ) );
advanced-custom-fields/includes/forms/form-nav-menu.php: add_filter('wp_edit_nav_menu_walker', array($this, 'wp_edit_nav_menu_walker'), 10, 2);
advanced-custom-fields/includes/forms/form-nav-menu.php: * wp_edit_nav_menu_walker
advanced-custom-fields/includes/forms/form-nav-menu.php: function wp_edit_nav_menu_walker( $class, $menu_id = 0 ) {
affilicious/vendor/htmlburger/carbon-fields/core/Container/Nav_Menu_Container.php: add_filter( 'wp_edit_nav_menu_walker', array( $self, 'edit_walker' ), 10, 2 );
agp-font-awesome-collection/classes/MenuIcons.php: add_filter( 'wp_edit_nav_menu_walker', array( $this, 'editWalker'), 10, 2 );
amnav-menu-control/inc/class.aMNav_Menu_Control.php: add_filter( 'wp_edit_nav_menu_walker', array( $this, 'edit_nav_menu_walker' ) );
apollo13-framework-extensions/features/mega-menu.php:add_filter( 'wp_edit_nav_menu_walker', 'a13fe_admin_change_walker_class', 10, 2
mikeschinkel / log.txt
Last active May 6, 2019
Raw grep file for plugins having 'wp_nav_menu_item_custom_fields' hook as of 2019-05-05
View log.txt
add-to-menus-lite/class.Walker_Nav_Menu_Edit.php: do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );
advanced-custom-fields/includes/walkers/class-acf-walker-nav-menu-edit.php: do_action( 'wp_nav_menu_item_custom_fields', $item->ID, $item, $depth, $args, $id );
amnav-menu-control/inc/class.Walker_Nav_Menu_Edit_Roles.php: do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );
apparelcuts-spreadshirt/resources/advanced-custom-fields/includes/walkers/class-acf-walker-nav-menu-edit.php: do_action( 'wp_nav_menu_item_custom_fields', $item->ID, $item, $depth, $args, $id );
arrivala-online-business-reviews/vendor/advanced-custom-fields/includes/walkers/class-acf-walker-nav-menu-edit.php: do_action( 'wp_nav_menu_item_custom_fields', $item->ID, $item, $depth, $args, $id );
asciinema-player/includes/acf/includes/walkers/class-acf-walker-nav-menu-edit.php: do_action( 'wp_nav_menu_item_custom_fields', $item->ID, $item, $depth, $args, $id
mikeschinkel / log.txt
Last active May 6, 2019
Raw grep file for WordPress plugins extending Walker_Nav_Menu_Edit as of 2019-05-05
View log.txt
advanced-custom-fields/includes/walkers/class-acf-walker-nav-menu-edit.php:class ACF_Walker_Nav_Menu_Edit extends Walker_Nav_Menu_Edit {
apparelcuts-spreadshirt/resources/advanced-custom-fields/includes/walkers/class-acf-walker-nav-menu-edit.php:class ACF_Walker_Nav_Menu_Edit extends Walker_Nav_Menu_Edit {
arrivala-online-business-reviews/vendor/advanced-custom-fields/includes/walkers/class-acf-walker-nav-menu-edit.php:class ACF_Walker_Nav_Menu_Edit extends Walker_Nav_Menu_Edit {
asciinema-player/includes/acf/includes/walkers/class-acf-walker-nav-menu-edit.php:class ACF_Walker_Nav_Menu_Edit extends Walker_Nav_Menu_Edit {
auto-generate-submenus/auto-generate-submenus.php: class Willy_Walker_Nav_Menu_Edit extends Walker_Nav_Menu_Edit {
automatic-submenu/automatic-submenu.php:class AutomaticSubmenu_Walker_Nav_Menu_Edit extends Walker_Nav_Menu_Edit
beagency-lite/inc/custom-menu/walker-nav-menu-edit.php:class beagency_Menu_Item_Custom_Fields_Walker extends Walker_Nav_Menu_Edit {
View instrument-hooks.php
Plugin Name: Instrument Hooks for WordPress
Description: Instruments Hooks for a Page. Outputs during the Shutdown Hook.
Version: 0.1
Author: Mike Schinkel
Author URI:
if (isset($_GET['instrument']) && $_GET['instrument']=='hooks') {
You can’t perform that action at this time.