Skip to content

Instantly share code, notes, and snippets.

@michaeluno
michaeluno / APF_CustomTextFieldType.php
Created February 28, 2016 06:53
A sample WordPress plugin that demonstrates a custom text field type for Admin Page Framework.
<?php
class APF_CustomTextFieldType extends AdminPageFramework {
public function setUp() {
$this->setRootMenuPage( 'Sample' ); // where to belong
$this->addSubMenuItem(
array(
'title' => __( 'Custom Text Field Type', 'admin-page-framework-demo-custom-field-type' ), // page and menu title
'page_slug' => 'apf_custom_text_field_type' // page slug
@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() {
@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 / 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 / task-scheduler-sample-action.php
Created May 12, 2015 06:05
A custom action plugin of the Task Scheduler WordPress plugin.
<?php
/**
* Plugin Name: Task Scheduler - Sample Action
* Plugin URI: http://en.michaeluno.jp/
* Description: Uses a custom action with Task Scheduler.
* 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-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 / 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 / CustomTextAreaFieldType.php
Last active June 12, 2016 07:42
A custom textarea field type for Admin Page Framwork that is compatible with the SiteOrign Page Builder plugin.
<?php
/**
* Custom Text Area Field Type
*
* A custom textarea field type compatible with the SiteOrigin Page Builder plugin.
*
* @version 0.0.2
*/
if ( class_exists( 'AdminPageFramework_FieldType_textarea' ) && ! class_exists( 'CustomTextAreaFieldType' ) ) :
class CustomTextAreaFieldType extends AdminPageFramework_FieldType_textarea {