Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

awhite2 on "When I call information saved in an options page only one letter shows up."

$
0
0

I've created an options page and I'm now trying to call one of the inputs in my theme. It's currently only showing the first letter, though.

The input section for the field is

add_settings_field(
	    'station_name',
	    'Station Name',
	    array($this, 'create_an_id_field'),
	    'station-setting-admin',
	    'setting_section_id'
	);
    }

    public function check_ID($input){
        if(!empty($input['station_name'])){
	    $mid = $input['station_name'];			

	}else{
	    $mid = '';
	}
	return $mid;
    }

    public function print_section_info(){
	print 'Enter your settings below:';
    }

    public function create_an_id_field(){
        ?><input type="text" id="stationname" name="array_key[station_name]" value="<?=get_option('station_name');?>" />

and the I'm referencing it by:

<?php $station_info = get_option('array_key');?>

			    <h2><a href="mystation.com" title="Station"><?php echo $station_info['station_name']; ?></a>

I tested by inputing WXYZ in my options page and it saves. But, then I only get the letter W on the link.


Viewing all articles
Browse latest Browse all 8245

Trending Articles