Skip to content

Instantly share code, notes, and snippets.

@michaeluno
michaeluno / admin-page-framework-test-user-meta.php
Last active August 29, 2015 14:13
Tests user meta of Admin Page Framework v3.5.0.
<?php
/*
Plugin Name: Admin Page Framework Test - User Meta
Plugin URI: http://en.michaeluno.jp/admin-page-framework
Description: Tests the user meta factory class.
Author: Michael Uno
Author URI: http://michaeluno.jp
Version: 1.0.0
Requirements: PHP 5.2.4 or above, WordPress 3.3 or above. Admin Page Framework 3.5.0 or above
*/
@michaeluno
michaeluno / tutorials-13 -add-a-meta-box-to-a-framework-custom-post-type.php
Last active December 25, 2015 05:55
Demonstrates how to add a meta box to a custom post type created by the framework and display the set custom field value in the front end article page and a custom cloumn in the post listing table. This is a sample plugin introduced in the tutorial Add a Meta Box to a Custom Post Type (http://en.michaeluno.jp/admin-page-framework/tutorials-v3/13…
<?php
/**
* Plugin Name: Admin Page Framework Tutorial 13 - Add a Meta Box to a Custom Post Type
* Plugin URI: http://en.michaeluno.jp/admin-page-framework
* Description: Adds a meta box to custom post type created by the framework and display the set custom field value.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.0.0
* Requirements: PHP 5.2.4 or above, WordPress 3.4 or above. Admin Page Framework 3.0.6 or above
*/
@michaeluno
michaeluno / tutorials-12-create-a-custom-post-type-and-custom-taxonomy.php
Last active June 27, 2023 19:57
Demonstrates how to create a custom post type and a custom taxonomy which belongs to it with Admin Page Framework. This is a sample plugin introduced in the tutorial Create a Custom Post Type and Custom Taxonomy (http://en.michaeluno.jp/admin-page-framework/tutorials-v3/12-create-a-custom-post-type-and-custom-taxonomy/).
<?php
/**
* Plugin Name: Admin Page Framework Tutorial 12 - Create a Custom Post Type and Custom Taxonomy
* Plugin URI: http://en.michaeluno.jp/admin-page-framework
* Description: Creates a custom post type and a custom taxonomy that belongs to it.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.0.1
* Requirements: PHP 5.2.4 or above, WordPress 3.4 or above. Admin Page Framework 3.0.6 or above
*/
@michaeluno
michaeluno / fetch-tweets-disable-content-security-policy-warnings.php
Last active August 29, 2015 14:11
A Fetch Tweets extention WordPress plugin that disables the content security policy warningss caused by widgets.js, the script provided by Twitter.com.
<?php
/*
Plugin Name: Fetch Tweets - Disable Content Security Policy Warning
Plugin URI: http://en.michaeluno.jp/admin-page-framework
Description: Disables the content security policy warnings caused by widgets.js, the script provided by Twitter.com.
Author: Michael Uno
Author URI: http://michaeluno.jp
Version: 1.0.0
Requirements: PHP 5.2.4 or above, WordPress 3.3 or above. Admin Page Framework 3.0.6 or above
*/
@michaeluno
michaeluno / tutorials-11-add-a-meta-box-for-posts.php
Last active December 25, 2015 04:08
Demonstrates how to add a meta box for the built-in 'post' post type with Admin Page Framework. This is a sample plugin introduced in the tutorial Add a Meta Box for Posts (http://en.michaeluno.jp/admin-page-framework/tutorials-v3/11-add-a-meta-box-for-posts/).
<?php
/*
* Plugin Name: Admin Page Framework Tutorial 11 - Add a Meta Box for Posts
* Plugin URI: http://en.michaeluno.jp/admin-page-framework
* Description: Adds a meta box for posts.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.0.1
* Requirements: PHP 5.2.4 or above, WordPress 3.4 or above. Admin Page Framework 3.0.6 or above
*/
@michaeluno
michaeluno / tutorials-10-add -a-page-meta-box-to-an in-page-tab.php
Last active December 25, 2015 03:31
Demonstrates how to add page meta box specific to in-page tabs with Admin Page Framework. This is a sample plugin introduced in the tutorial Add a Page Meta Box Specific to an In-page Tab (http://en.michaeluno.jp/admin-page-framework/tutorials-v3/10-add-a-page-meta-box-specific-to-an-in-page-tab/).
<?php
/*
* Plugin Name: Admin Page Framework Tutorial 10 - Add a Page Meta Box Specific to an In-page Tab
* Plugin URI: http://en.michaeluno.jp/admin-page-framework
* Description: Adds a page meta box specific to in-page tab.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.0.1
* Requirements: PHP 5.2.4 or above, WordPress 3.4 or above. Admin Page Framework 3.0.6 or above
*/
@michaeluno
michaeluno / tutorials-09-add-a-page-meta-box.php
Last active December 25, 2015 03:34
Demonstrates a way to add a page-meta-box to an existing admin page created by Admin Page Framework. This is a sample plugin introduced in the tutorial Add a Meta Box in an Admin Page (http://en.michaeluno.jp/admin-page-framework/tutorials-v3/09-add-a-meta-box-in-an-admin-page/).
<?php
/*
* Plugin Name: Admin Page Framework Tutorial 09 - Add a Page Meta box
* Plugin URI: http://en.michaeluno.jp/admin-page-framework
* Description: Creates a page meta box and its form fields.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.0.1
* Requirements: PHP 5.2.4 or above, WordPress 3.4 or above. Admin Page Framework 376.0 or above
*/
@michaeluno
michaeluno / TextAndTextAreaFieldType.php
Last active August 29, 2015 14:11
An example WordPress plugin that shows how to create a custom field type with text input and textarea which can be repeated ans sorted.
<?php
if ( ! class_exists( 'TextAndTextAreaFieldType' ) ) :
class TextAndTextAreaFieldType extends AdminPageFramework_FieldType {
/**
* Defines the field type slugs used for this field type.
*/
public $aFieldTypeSlugs = array( 'text_and_textarea', );
/**
@michaeluno
michaeluno / admin-page-framework-test-custom-section-tabs.php
Created December 9, 2014 15:17
Displays form sections of Admin Page Framework with custom groups.
<?php
/* Plugin Name: Admin Page Framework Test - Custom Seciton Tabs */
// Include the library file. Set your file path here.
$_sLibraryPath = defined( 'WP_DEBUG' ) && WP_DEBUG
? dirname( dirname( __FILE__ ) ) . '/admin-page-framework/development/admin-page-framework.php'
: dirname( dirname( __FILE__ ) ) . '/admin-page-framework/library/admin-page-framework.min.php';
if ( ! class_exists( 'AdminPageFramework' ) && ! include( $_sLibraryPath ) ) {
return;
}
@michaeluno
michaeluno / fetch-tweets-modify-widget-title-tag.php
Created November 12, 2014 22:10
A small WordPress plugin that modifies the title tag of the Fetch Tweets plugin widgets.
<?php
/**
* Plugin Name: Fetch Tweets - Modify Widget Title Tag
* Plugin URI: http://en.michaeluno.jp/
* Description: Modifies the title tag of the Fetch Tweets plugin widgets.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.0.0
*/
function fetch_tweets_modify_widget_title_tag( $aParams ) {