Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'admin_init', function() {
- register_setting( 'my-awesome-plugin-settings', 'map_option_1' );
- register_setting( 'my-awesome-plugin-settings', 'map_option_2' );
- register_setting( 'my-awesome-plugin-settings', 'map_option_3' );
- register_setting( 'my-awesome-plugin-settings', 'map_option_4' );
- register_setting( 'my-awesome-plugin-settings', 'map_option_5' );
- register_setting( 'my-awesome-plugin-settings', 'map_option_6' );
- });
- function sort_post_plugin() {
- ?>
- <div class="wrap">
- <form action="options.php" method="post">
- <?php
- settings_fields( 'my-awesome-plugin-settings' );
- do_settings_sections( 'my-awesome-plugin-settings' );
- ?>
- <div class="title-set"><h1>SORT POST SETTINGS</h1></div>
- <table class="mytable">
- <tr>
- <th>Posty Type</th>
- <td><input type="text" placeholder="Post Type" name="map_option_1" value="<?php echo esc_attr( get_option('map_option_1') ); ?>" size="50" /></td>
- </tr>
- <tr>
- <th>Meta Key</th>
- <td><input type="text" placeholder="Meta Key" name="map_option_2" value="<?php echo esc_attr( get_option('map_option_2') ); ?>" size="50" /></td>
- </tr>
- <tr>
- <th>Sorts</th>
- <td><input type="checkbox" placeholder="Meta Key" name="map_option_3" />Name<br>
- <input type="checkbox" id="cb_name" name="map_option_4">Price<br><input type="text" name="metakey" id="metakey" placeholder="Meta Key"></td>
- </tr>
- <tr>
- <td><?php submit_button(); ?></td>
- </tr>
- </table>
- </form>
- </div>
- <?php
- }
- ?>
- <td><input type="checkbox" placeholder="Meta Key" name="map_option_3"
- <?php // check whether map_option_3 was saved
- if(isset(get_option('map_option_3'))) { ?>checked="checked"<?php } ?>
- />Name<br>
- <input type="checkbox" id="cb_name" name="map_option_4"
- <?php // check whether map_option_4 was saved
- if(isset(get_option('map_option_4'))) { ?>checked="checked"<?php } ?>
- />Price<br><input type="text" name="metakey" id="metakey" placeholder="Meta Key"></td>
Add Comment
Please, Sign In to add comment