Skip to content

Instantly share code, notes, and snippets.

@michaeluno
michaeluno / tutorials-08-validate-multiple-fields.php
Last active December 25, 2015 01:50
Demonstrates validating multiple fields of the form created by the framework. This is a sample plugin introduced in the tutorial, Validate Submitted Form Data of Multiple Fields (http://en.michaeluno.jp/admin-page-framework/tutorials-v3/08-validate-submitted-form-data-of-multiple-fields/).
<?php
/*
* Plugin Name: Admin Page Framework Tutorial 08 - Validate Submitted Form Data
* Plugin URI: http://en.michaeluno.jp/admin-page-framework
* Description: Validate the form data of a section.
* 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 / LinkFieldType.php
Created May 26, 2014 09:35
An example definition class of the link custom field type for Admin Page Framework.
<?php
if ( ! class_exists( 'LinkFieldType' ) ) :
class LinkFieldType extends AdminPageFramework_FieldType {
/**
* Defines the field type slugs used for this field type.
*/
public $aFieldTypeSlugs = array( 'link', );
/**
@michaeluno
michaeluno / admin-page-framework-demo-custom-field-values.php
Last active August 29, 2015 14:02
Demonstrates how to set a custom value to the field created by Admin Page Framework.
<?php
/*
* Plugin Name: Admin Page Framework Demo - Setting Custom Field Values
* Description: Demonstrates how to set a custom value to the field created by Admin Page Framework.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.0.1
* Requirement: Admin Page Framework v3.1.0 or higher.
*/
@michaeluno
michaeluno / demo-custom-repeatable-field-values.php
Created June 28, 2014 08:15
This shows how to set custom values to repeatable fields created by Admin Page Framework.
<?php
/* Plugin Name: Admin Page Framework - Setting Custom Repeatable Field Values */
if ( ! class_exists( 'AdminPageFramework' ) ) {
include_once( dirname( __FILE__ ) . '/class/admin-page-framework.min.php' );
}
class AFFTest_CustomRepeatableFieldValues extends AdminPageFramework {
public function setUp() {
@michaeluno
michaeluno / admin-page-framework-demo-supress-options.php
Last active September 25, 2020 18:15
Demonstrates how to suppress the options in Admin Page Framework. ( this requires v3.1.0 or above)
<?php
/*
* Plugin Name: Admin Page Framework Demo - Suppress Options
* Description: Demonstrates how to suppress the options in Admin Page Framework.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.1.0
* Requirement: Admin Page Framework v3.1.0 or higher.
*/
@michaeluno
michaeluno / admin-page-framework-demo-default-options.php
Last active September 25, 2020 18:10
Demonstrates how to set default options with the options_{instantiated class name} hook in Admin Page Framework
<?php
/*
* Plugin Name: Admin Page Framework Demo - Default Option Values
* Description: Demonstrates how to set default options with the options_{instantiated class name} hook in Admin Page Framework
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.0.1
* Requirement: Admin Page Framework v3.1.0 or higher.
*/
@michaeluno
michaeluno / admin-page-framework-demo-tabbed-sections-in-meta-boxes.php
Created October 18, 2014 10:35
Demonstrates how to add tabbed sections in meta boxes with Admin Page Framewrok.
<?php
/*
Plugin Name: Admin Page Framework Demo - Tabbed Sections in Meta Boxes
Plugin URI: http://en.michaeluno.jp/admin-page-framework
Description: Demonstrates how to add tabbed sections in meta boxes with Admin Page Framework.
Author: Michael Uno
Author URI: http://michaeluno.jp
Version: 1.0.0
Requirements: Admin Page Framework
*/
@michaeluno
michaeluno / admin-page-framework-demo-repeatable-tabbed-sections-inmeta-boxes.php
Created October 18, 2014 10:36
Demonstrates how to add repeatable tabbed sections in meta boxes with Admin Page Framework.
<?php
/*
Plugin Name: Admin Page Framework Demo - Repeatable Tabbed Sections in Meta Boxes
Plugin URI: http://en.michaeluno.jp/admin-page-framework
Description: Demonstrates how to add repeatable tabbed sections in meta boxes with Admin Page Framework.
Author: Michael Uno
Author URI: http://michaeluno.jp
Version: 1.0.0
Requirements: Admin Page Framework
*/
@michaeluno
michaeluno / admin-page-framework-test-featured-image-conflict.php
Last active August 29, 2015 14:08
This is a test plugin that tests if a image field type in a custom post meta box of Admin Page Framework causes a conflict with the featured image's image uploader.
@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 ) {