Click here to Skip to main content
15,035,723 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Im not entirely sure way but the default values for a custom form aren't displaying. Any ideas?

Is it something to do with locating templates?

XML
$blav_options = array(
    'first_name' => 'Photographers First Name',
    'surname' => 'Photographers Surname',
    'city' => 'City',
);

function blavou_setup_address() {
    global $blav_options_address;
    if ( ! isset( $_REQUEST['updated'] ) )
        $_REQUEST['updated'] = false;
    ?>
    <?php if ( isset( $_GET['settings-updated'] ) ) {
        echo "<div class='updated'><p>Settings Saved. <a href='?page=blav-setup-social'>Continue Setup</a>.</p></div>";
    } ?>
    <?php locate_template( 'admin/templates/blav-setup-address.php', TRUE, TRUE ); ?>
    <?php
}


<div id="blav-wrapper">
<div class="blav-nav-wrapper">
    <h5 class="standard-title">Photographers Address</h5>
    <form method="post" action="options.php" class="standard-form">
    <?php $settings = get_option( 'blav_options_address', $blav_options_address ); ?>
    <?php settings_fields( 'blav_theme_options_address' );?>
        <input type="text" name="blav_options_address[street]" value="<?php esc_attr_e($settings['street']); ?>"/>
        <input type="text" name="blav_options_address[county]" value="<?php esc_attr_e($settings['county']); ?>"/>
        <input type="text" name="blav_options_address[postcode]" value="<?php esc_attr_e($settings['postcode']); ?>"/>
        <input type="submit" value="Save"></input>
    </form>
</div><!--end blav nav wrapper-->
</div><!--end blav-wrapper-->
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900