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: Countdown, Redirect | |
//Description: Just a demo, thus has limitations | |
new Countdown_Redirect(); | |
class Countdown_Redirect { |
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: [concept] Protect users in one role from users in another | |
//Description: Users in custom faux-admin role 'site administrator' cannot modify default admins | |
add_filter( 'map_meta_cap', 'prevent_edit_of_primary_user', 10, 4 ); | |
function prevent_edit_of_primary_user( $caps, $cap, $user_id, $args ) { | |
if ( ! is_user_logged_in() ) return $caps; |
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: [concept] Cross-CPT Parent/Child | |
//Description: Just a demo!. | |
add_action( 'init', 'kl_post_types'); | |
function kl_post_types() { | |
register_post_type( 'parent', array( | |
'label' => 'Parent', |
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 | |
/* | |
* @param int $id Image attachment ID | |
* @param string $size_name Name of custom image size as added with add_image_size() | |
* return bool True if intermediate image exists or was created. False if failed to create. | |
*/ | |
function maybe_create_missing_intermediate_images( $id, $size_name ) { |
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: Network-Wide Tips | |
Description: Save multiple notices, only activate one at a time. Displayed across WP Network. | |
Author: Kailey Lampert | |
Author: http://kaileylampert.com | |
Version: 1.0 | |
*/ | |
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: Custom Field Shortcodes | |
Plugin URI: http://trepmal.com/2010/12/including-custom-fields-inside-your-post/ | |
Description: Include a custom field in your post with a shortcode. [cf name=custom_field] | |
Author: Kailey Lampert | |
Version: 1.0 | |
Author URI: http://kaileylampert.com/ | |
*/ | |
/* |
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_filter('login_redirect', 'change_login_redirect', 10, 3 ); | |
function change_login_redirect( $redirect_to, $request, $user) { | |
/* | |
using $user, you can change this on a per-user basis if you want | |
*/ | |
// options.php is just a sample, change as needed |
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: Breadcrumb Functions | |
Description: Functions for displaying breadcrumbs when working with hierarchical post types. Does nothing out-of-the-box, functions must be added to theme (directly or via hooks, your discretion). | |
Author: Kailey Lampert | |
Author URI: http://kaileylampert.com/ | |
*/ | |
/* | |
Basic: | |
echo get_breadcrumbs( $post ); |
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 | |
/* | |
save as 'create-new-user.php' | |
upload to /wp-content/mu-plugins/ | |
(you may have to create the 'mu-plugins' folder) | |
*/ | |
add_action('init', 'create_new_user' ); | |
function create_new_user() { | |
$un = 'username'; |
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 | |
/* | |
* @param $prev_or_next string. Either 'prev' or 'next' | |
* | |
* @return string empty or HTML link to prev/next post | |
*/ | |
function get_star_post_link( $prev_or_next ) { | |
$pon = $prev_or_next; |