Skip to content

Instantly share code, notes, and snippets.

Avatar
Proudly powered by 🦄 💩 & , mostly

Ian M. Jones ianmjones

Proudly powered by 🦄 💩 & , mostly
View GitHub Profile
@ianmjones
ianmjones / pixie-article.php
Created Jun 17, 2015
A tiny little article plugin to demo Extended CPTs.
View pixie-article.php
<?php
/**
* @link https://deliciousbrains.com/blog/
* @since 1.0
* @package Pixie_Article
*
* @wordpress-plugin
* Plugin Name: Pixie Article
* Plugin URI: https://deliciousbrains.com/blog/
@ianmjones
ianmjones / pixie-article.php
Last active Aug 29, 2015
A tiny little article plugin to demo Extended CPTs ... with translatable labels.
View pixie-article.php
<?php
/**
* @link https://deliciousbrains.com/blog/
* @since 1.0
* @package Pixie_Article
*
* @wordpress-plugin
* Plugin Name: Pixie Article
* Plugin URI: https://deliciousbrains.com/blog/
@ianmjones
ianmjones / pixie-article.php
Last active Aug 29, 2015
A tiny little article plugin to demo Extended CPTs ... with translatable labels and a menu icon.
View pixie-article.php
<?php
/**
* @link https://deliciousbrains.com/blog/
* @since 1.0
* @package Pixie_Article
*
* @wordpress-plugin
* Plugin Name: Pixie Article
* Plugin URI: https://deliciousbrains.com/blog/
@ianmjones
ianmjones / gist:19019fcb675d4c85b4a3
Created Jun 18, 2015
Adding a menu icon to our Extended CPT.
View gist:19019fcb675d4c85b4a3
$options = array(
'labels' => $labels,
'menu_icon' => 'dashicons-media-document',
);
register_extended_post_type( 'pixie-article', $options );
@ianmjones
ianmjones / gist:e6a5c0bac60799b18f04
Created Jun 19, 2015
Adding Pixie Article Audiences taxonomy to our plugin.
View gist:e6a5c0bac60799b18f04
require_once( 'extended-taxos/extended-taxos.php' );
register_extended_taxonomy( 'pixie-article-audience', 'pixie-article' );
@ianmjones
ianmjones / gist:06de411f32787a0e7104
Last active Aug 29, 2015
Adding columns to our Extended CPTs admin screen.
View gist:06de411f32787a0e7104
$options = array(
'labels' => $labels,
'menu_icon' => 'dashicons-media-document',
'admin_cols' => array(
'pixie_article_audience' => array(
'taxonomy' => 'pixie-article-audience',
'title' => _x( 'Audience', 'Pixie Article Taxonomy', 'pixie-article' ),
),
'post_date' => array(
'title' => __( 'Created', 'Date', 'pixie-article' ),
@ianmjones
ianmjones / gist:cd24af13726e1deb3ebf
Created Jun 19, 2015
admin_filters settings for our Extended CPTs plugin.
View gist:cd24af13726e1deb3ebf
'admin_filters' => array(
'pixie_article_audience' => array(
'taxonomy' => 'pixie-article-audience',
'title' => _x( 'Audience', 'Pixie Article Taxonomy', 'pixie-article' ),
),
),
@ianmjones
ianmjones / pixie-article.php
Created Jun 19, 2015
A tiny little article plugin to demo Extended CPTs ... with translatable labels, menu icon, custom taxonomy, admin columns and admin filters.
View pixie-article.php
<?php
/**
* @link https://deliciousbrains.com/blog/
* @since 1.0
* @package Pixie_Article
*
* @wordpress-plugin
* Plugin Name: Pixie Article
* Plugin URI: https://deliciousbrains.com/blog/
@ianmjones
ianmjones / pixie-article.php
Created Jun 19, 2015
A tiny little article plugin to demo Extended CPTs ... with translatable labels, menu icon, custom taxonomy, admin columns, admin filters and shortcode.
View pixie-article.php
<?php
/**
* @link https://deliciousbrains.com/blog/
* @since 1.0
* @package Pixie_Article
*
* @wordpress-plugin
* Plugin Name: Pixie Article
* Plugin URI: https://deliciousbrains.com/blog/
@ianmjones
ianmjones / install-wp-tests.sh
Created Jun 19, 2015
WordPress's install-wp-tests.sh using curl instead of wget and adding an optional drop_db parameter.
View install-wp-tests.sh
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [drop_db]"
exit 1
fi
DB_NAME=$1
DB_USER=$2
DB_PASS=$3
You can’t perform that action at this time.