I'm using the Wordpress Plugin Boilerplate to make a plugin and I'm having some trouble outputting a form for users to input configuration options for the said plugin.
I have the following methods for a class
public function admin_add_menu()
{
add_menu_page(
'Paypal Me Order',
'Paypal Me',
'manage_options',
'paypal_me_order',
array($this, 'admin_display'),
'dashicons-fa-cc-paypal',
20
);
}
function admin_init()
{
register_setting( 'paypal_me_order-group', 'paypal_me_order-option', array( $this , 'sanitize') );
add_settings_section( 'paypal_me_order-section', 'Paypal Me Settings', array( $this, 'admin_section' ), 'paypal_me_order' );
add_settings_field( 'paypal_me_order-link', 'Paypal Me Link', array( $this, 'admn_link_field' ), 'paypal_me_order', 'paypal_me_order-section' );
}
function admin_display (){
include plugin_dir_path(__FILE__) . 'partials/paypal_me_order-admin-display.php';
}
public function admin_section($args)
{
include plugin_dir_path(__FILE__) . 'partials/paypal_me_order-admin-section-display.php';
}
public function admin_link_field( $args) {
include plugin_dir_path(__FILE__) . 'partials/paypal_me_order-link-field.php';
}
Inside admin_display()
<form action="options.php" method="POST">
<?php settings_fields('paypal_me_order-group'); ?>
<?php do_settings_sections('paypal_me_order-section'); ?>
<?php submit_button(); ?>
</form>
I get the top level menu and the Page shows up but not the "section" or the "fields"
What am I doing wrong here? Why is it not working?
UPDATE
I am able to get the page to display but I cannot get the input field to print.