Skip to content

Instantly share code, notes, and snippets.

@codearachnid
Created December 15, 2014 16:54
Show Gist options
  • Save codearachnid/b3b7e1b311ecdbea02eb to your computer and use it in GitHub Desktop.
Save codearachnid/b3b7e1b311ecdbea02eb to your computer and use it in GitHub Desktop.
A test plugin for determining the issue with APF revealer file using the minified lib
<?php
/* Plugin Name: Admin Page Framework Test - Revealer */
if ( ! class_exists( 'AdminPageFramework' ) ) {
$_sFrameworkPath = dirname( dirname( __FILE__ ) ) . '/plugins/admin-page-framework/library/admin-page-framework.min.php';
if ( file_exists( $_sFrameworkPath ) ) {
include( $_sFrameworkPath );
} else {
trigger_error( 'Admin Page Framework: The framework path could not be located.', E_USER_NOTICE );
return;
}
}
class APFTest_Revealer extends AdminPageFramework {
public function setUp() {
// wire up the revealer fields
if( class_exists('RevealerCustomFieldType') )
new RevealerCustomFieldType( __CLASS__ );
$this->setRootMenuPage( __( 'Revealer Test' ) );
$this->addSubMenuItems(
array(
'title' => __( 'revealer Page Test' ),
'page_slug' => 'revealerPageTest'
)
);
$this->addSettingSections(
'revealerPageTest',
array(
'section_id' => 'revealerPageTestSection',
'section_tab_slug' => 'settings_tabbed_sections',
'title' => __( 'Section' )
)
);
}
public function load_APFTest_Revealer( $oAdminPage ) {
$this->addSettingFields(
'revealerPageTestSection',
array(
'field_id' => 'revealerFieldChecks',
'type' => 'revealer',
'is_multiple' => true,
'select_type' => 'radio',
'title' => __( 'Title' ),
'description' => __( 'Description' ),
'label' => array(
'YES' => __( 'YES', 'legull' ),
'NO' => __( 'NO', 'legull' )
),
)
);
}
}
new APFTest_Revealer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment