Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_settings_section('tdg_settings_cart', 'Cart Options', 'tdg_cart_summary', 'tdg_cart_settings');
- // Cart explanation (text)
- add_settings_field('tdg_setting_cart_explanation', 'Cart explanation', 'tdg_setting_cart_explanation', 'tdg_cart_settings', 'tdg_settings_cart', array());
- // Cart page (id or slug)
- add_settings_field('tdg_setting_cart_page', 'Cart Page', 'tdg_setting_cart_page', 'tdg_cart_settings', 'tdg_settings_cart', array());
- // This is simply the function that outputs the page summary as called in add_settings_section()
- function tdg_cart_summary() { ?>
- <p><?php _e( 'Manage the various cart options available for this theme', 'tdg' ); ?></p>
- <?php }
- // Footer Disclaimer Setting
- function tdg_setting_cart_explanation() {
- $tdg_options = get_option( 'theme_tdg_options' ); ?>
- <textarea name="theme_tdg_options[tdg_cart_explanation]" rows="10" cols="100" /><?php echo esc_textarea($tdg_options['tdg_cart_explanation']); ?></textarea>
- <div class="description">
- <p><?php _e('Explain how the cart works on this website. You can use the following html tags:', 'tdg'); ?></p>
- <p><code><?php echo allowed_tags(); ?></code></p>
- </div>
- <?php }
- // Contact Page Link Setting
- function tdg_setting_cart_page() {
- $tdg_options = get_option( 'theme_tdg_options' );
- if( tdg_use_permalink() ) : // if permalinks are enabled ?>
- <input type="text" name="theme_tdg_options[tdg_cart_page]" value="<?php echo $tdg_options['tdg_cart_page']; ?>" />
- <span class="description"><?php _e('Do not enter the full address, just the page slug', 'tdg'); ?></span>
- <?php else : // permalink are disabled ?>
- <input type="text" name="theme_tdg_options[tdg_cart_page]" value="<?php echo $tdg_options['tdg_cart_page']; ?>" />
- <span class="description"><?php _e('enter the page id for your cart page, something like <code>http://example.com/?page_id=774</code> where 774 is the id of the page', 'tdg'); ?></span>
- <?php endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment