How to retrieve form data?


I want to save the value of input data and retrieve it.
I’m new to creating WordPress plugin and I don’t know how to get the value from the form. I have seen some plugin development tutorials but I’m unable to develop it properly.
Here is my code:

Plugin Name:  My Custorm Form
Plugin URI:
Description:  New plugin
Version:      0.1
Author:       RB

function my_plugin_settings()
    add_menu_page( 'My Plugin',
                    'myCust Form',
add_action('admin_menu', 'my_plugin_settings');

function my_plugin_options()
add_action('admin_init', 'my_plugin_options');

function my_plugin_settings_page()
    echo "<h1>My Plugin Settings</h1>";
    <div class="wrap">
        <form  action="options.php" method="post">
        <?php settings_fields('my-form-group'); ?>
            <b>Enter a name to display:</b><br/>
            <input type="text" name="default-image-url" value="" >

            <?php submit_button(); ?>
RajB009 6 years 2017-11-28T11:25:41-05:00 0 Answers 86 views 0

Leave an answer