Created
February 14, 2014 05:43
-
-
Save michaeluno/8996361 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Plugin Name: Admin Page Framework - Test Multiple Same Field ID */ | |
if ( ! class_exists( 'AdminPageFramework' ) ) { | |
include_once( dirname( dirname( __FILE__ ) ) . '/admin-page-framework/development/admin-page-framework.php' ); | |
// include_once( dirname( __FILE__ ) . '/library/admin-page-framework.min.php' ); | |
} | |
class APF_TestMultipleSameFieldID extends AdminPageFramework { | |
function setUp() { | |
$this->setRootMenuPage( 'Test' ); // where to belong | |
$this->addSubMenuItem( | |
array( | |
'title' => 'Test Multiple Same Field ID', // page and menu title | |
'page_slug' => 'test_multiple_same_field_id' // page slug | |
) | |
); | |
$this->addSettingSections( | |
array( | |
'section_id' => 'section_a', | |
'page_slug' => 'test_multiple_same_field_id', | |
), | |
array( | |
'section_id' => 'section_b', | |
'page_slug' => 'test_multiple_same_field_id', | |
) | |
); | |
$this->addSettingFields( | |
array( | |
'section_id' => 'section_a', | |
'field_id' => 'field_id_a', | |
'title' => __( 'Field ID A', 'admin-page-framework-demo' ), | |
'type' => 'text', | |
), | |
array( | |
'section_id' => 'section_b', | |
'field_id' => 'field_id_a', | |
'title' => __( 'Field ID A', 'admin-page-framework-demo' ), | |
'type' => 'text', | |
), | |
array( | |
'field_id' => 'submit', | |
'type' => 'submit', | |
) | |
); | |
} | |
function do_test_multiple_same_field_id() { // do_{page slug} | |
echo "<h3>Save Values</h3>"; | |
echo "<blockquote style='background-color:#FFF; padding: 20px;'>"; | |
$this->oDebug->dumpArray( get_option( get_class( $this ), array() ) ); | |
echo "</blockquote>"; | |
} | |
} | |
new APF_TestMultipleSameFieldID; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment