Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / ImageAndDropDownsFieldType.php
Last active August 29, 2015 14:15
An Admin Page Framework custom field type with image and multiple drop-down lists.
<?php
/**
* An Admin Page Framework custom field type that has one image input and 5 drop-down lists.
*
* @version 0.0.2
*/
if ( class_exists( 'AdminPageFramework_FieldType_image' ) && ! class_exists( 'ImageAndDropDownsFieldType' ) ) :
class ImageAndDropDownsFieldType extends AdminPageFramework_FieldType_image {
/**
@michaeluno
michaeluno / admin-page-framework-test-page-tabas-and-meta-box-form-secitons.php
Created April 26, 2015 07:31
Tests form capabilities in Admin Page Framework.
<?php
/*
Plugin Name: Admin Page Framework Test - Form Capability
Plugin URI: http://en.michaeluno.jp/admin-page-framework
Description: Tests form capabilities.
Author: Michael Uno
Author URI: http://michaeluno.jp
Version: 1.0.0
*/
@michaeluno
michaeluno / admin-page-framework-example-wizard-type-form.php
Created May 6, 2015 20:16
Demonstrates a simple Wizard form with Admin Page Framework.
<?php
/*
Plugin Name: Admin Page Framework Example - Wizard Type Form
Plugin URI: http://en.michaeluno.jp/admin-page-framework
Description: Demonstrates a simple Wizard form.
Author: Michael Uno
Author URI: http://michaeluno.jp
Version: 1.0.0
*/
@michaeluno
michaeluno / admin-page-framework-example-sortable-labels.php
Created May 21, 2015 10:12
Shows how to create asortable lables with Admin Page Framework
<?php
/*
Plugin Name: Admin Page Framework Example - Sortable Labels
Plugin URI: http://en.michaeluno.jp/admin-page-framework
Description: Shows how to create asortable lables.
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.8 or above
*/
@michaeluno
michaeluno / admin-page-framework-test-tabs-in-post-listing-pages.php
Created June 29, 2015 01:24
Tests tabs in post listing pages with Admin Page Framework.
<?php
/*
Plugin Name: Admin Page Framework Test - Tabs in Post Listing Page.
Plugin URI: http://en.michaeluno.jp/admin-page-framework
Description: Tests tabs in post listing pages.
Author: Michael Uno
Author URI: http://michaeluno.jp
Version: 1.0.0
*/
@michaeluno
michaeluno / patch-admin-page-framework-global-post-variable.php
Created September 9, 2015 06:15
Restores the global $post variable in the admin area as some plugins modify it.
<?php
/*
Plugin Name: Patch - Admin Page Framework Global Post Variable
Description: Restores the global $post variable in the admin area as some plugins modify it.
*/
class Patch_AdminPageFramework_GlobalPostVariable {
public function __construct() {
@michaeluno
michaeluno / patch-wr-mega-menu-and-admin-page-framework.php
Last active September 10, 2015 08:36
Fixes a conflict of WR MegaMenu and Admin Page Framework.
<?php
/*
Plugin Name: Patch - WR MegaMenu & Admin Page Framework Conflict
*/
class FixConflict_WRMegaMenuAndAdminPageFramework {
public function __construct() {