Skip to content

Instantly share code, notes, and snippets.

View jwondrusch's full-sized avatar

Jonathan Wondrusch jwondrusch

View GitHub Profile
<?php
/*
A quick snippet for getting basic data about courses.
See: zippy-courses/app/Shortcodes/Views/CourseDirectory.php for more info on how the current Course Directory is set up.
See: zippy-courses/lib/Models/Course/Course.php for available methods on course object
*/
$zippy = Zippy::instance();
@jwondrusch
jwondrusch / wordpress-disable-distraction-free.php
Last active September 13, 2022 18:02
Disable Distraction Free Writing Mode and Full Height Editor editor based on a list of post types.
<?php
/**
* Disable Distraction Free Writing Mode and the "Auto Expanding"
* height of the editor based on a list of post types.
*
* @return void
*/
function my_deregister_editor_expand($val, $post_type)
{
@jwondrusch
jwondrusch / wp-post-type-parent-of-another-post-type.php
Last active September 28, 2016 22:55
Allow a WordPress custom post type to select another post type as a parent.
// Source: http://janina.tumblr.com/post/3588081423/post-parent-different-type
// Modified to be more generic
add_action('admin_menu', function() {
remove_meta_box( 'pageparentdiv', 'post-type', 'normal');
});
add_action('add_meta_boxes', function() {
add_meta_box( 'post-type-parent', 'Section', 'post_type_attributes_meta_box', 'post-type', 'side', 'high');
});