Skip to content

Instantly share code, notes, and snippets.

View andrewahead4's full-sized avatar

Andrew Fielden andrewahead4

View GitHub Profile
$labels = array(
'name' => _x( 'Blog Tags', 'Taxonomy General Name', 'text_domain' ),
'singular_name' => _x( 'Blog Tag', 'Taxonomy Singular Name', 'text_domain' ),
'menu_name' => __( 'Blog Tag', 'text_domain' ),
'all_items' => __( 'All Items', 'text_domain' ),
'parent_item' => __( 'Parent Item', 'text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
'new_item_name' => __( 'New Item Name', 'text_domain' ),
'add_new_item' => __( 'Add New Item', 'text_domain' ),
'edit_item' => __( 'Edit Item', 'text_domain' ),
add_action( 'init', 'register_cpt_blog_entry' );
function register_cpt_blog_entry() {
$labels = array(
'name' => _x( 'Blog Entries', 'blog_entry' ),
'singular_name' => _x( 'Blog Entry', 'blog_entry' ),
'add_new' => _x( 'Add New', 'blog_entry' ),
'add_new_item' => _x( 'Add New Blog Entry', 'blog_entry' ),
'edit_item' => _x( 'Edit Blog Entry', 'blog_entry' ),
@andrewahead4
andrewahead4 / rest_insert_post.php
Last active April 18, 2024 13:55
A simple post insert using WP REST API and PHP over basic authentication
<?php
///////////////////////////////////////////////////////////////////////////////////
// //
// This is using a sample local WordPress Install and is not production safe //
// It uses the REST and Basic Auth plugins //
// //
///////////////////////////////////////////////////////////////////////////////////
@andrewahead4
andrewahead4 / gymcpt.php
Created July 21, 2015 10:32
Sample of a WordPress custom post type set up for a DataFlexor Gym example
add_action( 'init', 'register_cpt_gym' );
function register_cpt_gym() {
$labels = array(
'name' => _x( 'Gyms', 'gym' ),
'singular_name' => _x( 'Gym', 'gym' ),
'add_new' => _x( 'Add New', 'gym' ),
'add_new_item' => _x( 'Add New', 'gym' ),
'edit_item' => _x( 'Edit', 'gym' ),
@andrewahead4
andrewahead4 / test.txt
Created July 11, 2015 09:04
Sample for test
This is a text edit
It spans a couple of lines
And has a break