Skip to content

Instantly share code, notes, and snippets.

Kellen Mace kellenmace

Block or report user

Report or block kellenmace

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
@kellenmace
kellenmace / remove-slug-from-custom-post-type.php
Created May 14, 2014
Remove Custom Post Type Slug from Permalinks
View remove-slug-from-custom-post-type.php
/**
* Remove the slug from published post permalinks. Only affect our CPT though.
*/
function gp_remove_cpt_slug( $post_link, $post, $leavename ) {
if ( 'race' != $post->post_type || 'publish' != $post->post_status ) {
return $post_link;
}
@kellenmace
kellenmace / remove-custom-post-type-slug-from-permalinks-2.php
Created May 14, 2014
Remove Custom Post Type Slug from Permalinks 2
View remove-custom-post-type-slug-from-permalinks-2.php
/**
* Have WordPress match postname to any of our public post types (page, post, race)
* All of our public post types can have /post-name/ as the slug, so they better be unique across all posts
* By default, core only accounts for posts and pages where the slug is /post-name/
*/
function gp_parse_request_trick( $query ) {
// Only noop the main query
if ( ! $query->is_main_query() )
return;
View oop-settings-page.php
/**
* Admin page markup
* @since 0.1.0
*/
public function admin_page_display() {
self::admin_page_setup();
?>
<div class="wrap cmb_options_page <?php echo self::$key; ?>">
View oop-settings-page-full.php
<?php
/**
* Facebook Conversion Pixel Options
* @version 1.0
*/
class Fb_Pxl_Admin {
/**
* Option key, and option page slug
* @var string
View facebook-conversion-pixel-admin.php
<?php
/**
* Facebook Conversion Pixel Options
* @version 1.0
*/
class Fb_Pxl_Admin {
/**
* Option key, and option page slug
* @var string
View facebook-conversion-pixel-2.php
<?php
/**
* Facebook Conversion Pixel Options
* @version 1.0
*/
class Fb_Pxl_Admin {
/**
* Option key, and option page slug
* @var string
View admin.php
public static $key = 'fb_pxl_options';
View admin.php
<?php
/**
* Facebook Conversion Pixel Options
* @version 1.0
*/
class Fb_Pxl_Admin {
/**
* Option key, and option page slug
* @var string
View facebook-conversion-pixel.php
<?php
/*
Plugin Name: Facebook Conversion Pixel
Plugin URI: n/a
Description: Add Facebook Conversion Pixels to Posts, Pages, or any other custom post types.
Version: 1.0
Author: Kellen Mace
Author URI: http://kellenmace.com/
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
View class.subscriptions.php
<?php
/**
* Enable Subscriptions Options for supporting product types and payment gateways
* @package exchange-addon-recurring-payments
* @since 1.0.0
*/
if( class_exists( 'IT_Exchange_Recurring_Payments' ) ) {
class IT_Exchange_Subscriptions extends IT_Exchange_Recurring_Payments {
You can’t perform that action at this time.