Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myplugin_register_settings() {
- add_option( 'myplugin_option_name', 'This is my option value.');
- register_setting( 'myplugin_options_group', 'myplugin_option_name', 'myplugin_callback' );
- }
- add_action( 'admin_init', 'myplugin_register_settings' );
- function myplugin_register_options_page() {
- add_options_page('Page Title', 'Plugin Menu', 'manage_options', 'myplugin', 'myplugin_options_page');
- }
- add_action('admin_menu', 'myplugin_register_options_page');
- function myplugin_options_page()
- {
- ?>
- <div>
- <?php screen_icon(); ?>
- <h2>ID Settings</h2>
- <form method="post" action="options.php">
- <?php settings_fields( 'myplugin_options_group' ); ?>
- <h3>Set Store ID</h3>
- <p>Please enter the store id given to you by the publisher</p>
- <table>
- <tr valign="top">
- <th scope="row"><label for="myplugin_option_name">StoreID</label></th>
- <td><input type="text" id="myplugin_option_name" name="myplugin_option_name" value="<?php echo get_option('myplugin_option_name'); ?>" /></td>
- </tr>
- </table>
- <?php submit_button(); ?>
- </form>
- </div>
- <?php
- }
- global $product;
- $category = 'excludecat';
- if ( has_term( $category, 'product_cat', $product->id ) )
- }
- add_action( 'woocommerce_product_meta_start', 'myplugin_value' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement