Forum Replies Created

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • in reply to: Include a file within Piklist #1953
    egnsh98
    Member

    I still haven’t been able to figure this out. I’ve done some research but nothing seems to be relevant to Piklist. Has anyone else experienced this?

    in reply to: Settings Array #1951
    egnsh98
    Member

    You are right, it was much easier. This is resolved now.

    in reply to: Add more / group fields in WordPress 3.5.1 #1950
    egnsh98
    Member

    Okay thanks, I hope to be updating the site soon anyways..

    in reply to: Settings Array #1910
    egnsh98
    Member

    Okay thanks. Would I be better off going my initial route when I first opened this topic, or can I still use the piklist functions to help breakdown the array? I have trouble wrapping my head around some of this stuff.

    in reply to: Settings Array #1908
    egnsh98
    Member

    Steve,

    I’ve managed to get the values outputting on the screen for test purposes as I had wanted. Only issue is the values are being output in the add_more template file, not in the main class file that I am working with. How should I access those variables, will I need to create getters and setters to move that data between files or is there a better way?

    The structure for this data in my main class file looks something like this:

    // Get the schedule group information
    $schedule_group = $options['sched_group'];
    
    // 1. Display the data using the file schedule_template.php.
    // 2. Assign your $sched_cat parameter (from above) to 'data'.
    // 3. Loop through 'data'.
    
    piklist('schedule_template', array('data' => $schedule_group, 'loop' => 'data'));
    
    $sched_category_id = $data['sched_cat'];
    $sched_timestamp = $data['sched_time'];
    $sched_format = $data['sched_format'];
    
    var_dump ( $sched_category_id . $sched_timestamp . $sched_format );

    Regards.

    in reply to: Settings Array #1907
    egnsh98
    Member

    Should have checked that out first. Thanks a lot for the reference, I’ll have a look over it now 🙂

    in reply to: Include a file within Piklist #1903
    egnsh98
    Member

    Thanks Steve!

    We are definitely moving in the right direction. Currently I need to click “Save Settings” twice for the fields to be registered in the database. In addition the WordPress “Settings saved.” notification appears twice, not sure if this is related though, just an observation.

    Regards.

    in reply to: Warning: Illegal offset type in isset or empty #1901
    egnsh98
    Member

    Removing the scope parameter did the trick! I guess I was just a little confused because from the Documentation I read this:

    http://piklist.com/user-guide/tutorials/display-taxonomies-as-a-dropdown-or-radio-buttons/

    Notice we set the scope here. In most cases Piklist will automatically determine the scope. But when using taxonomies you will need to set ‘scope’ => ‘taxonomy’

    I just found that a little misleading. Thanks for clearing this up though 🙂

    Cheers!

    in reply to: Fields within an HTML table #1886
    egnsh98
    Member

    Okay I am a little closer to my ideal solution. After further digging I am using Field Groups and add_more fields to have the Piklist fields appear in a row layout, but I am still stuck on having each Piklist field row appear as a table row in an HTML table. In addition all the fields I add to my page, regardless of where the are in the code, are appearing at the very end of all my other content. Also is there a way to remove the fields from the default structure? (I want the field group to be full width with no description to the left).

    in reply to: Include a file within Piklist #1884
    egnsh98
    Member

    As requested, I have emailed a copy of the code.

    Thanks!

    in reply to: Include a file within Piklist #1882
    egnsh98
    Member

    After investigating further, even manually typing a string into the value parameter of the hidden field registers nothing in the database. This is leaning me towards thinking the syntax of my hidden field is wrong? The hidden field does not exist on a post, user, or taxonomy, but on a custom admin page that I have created and registered with WordPress.

    in reply to: Include a file within Piklist #1881
    egnsh98
    Member

    Sure I can do that, but I have one question first. If I am understanding the hidden field correctly, any value passed to the ‘value’ parameter of the field will be registered in the options database table?

    in reply to: Include a file within Piklist #1877
    egnsh98
    Member

    I’m not sure how changing my functions to static would help. The getter and setter functions I have in my other class reference $this so changing to static would place that out of context. If I understand correctly, when I save the settings the value of the hidden field would be $user and it would get stored into the database? Because that is what I am trying to achieve.

    Within /parts/settings/twitter.php if I echo the value of $user before the hidden field it prints out what I would expect, but when I check the options in the database the value of the hidden field is 0, and not the value of $user

    in reply to: Include a file within Piklist #1862
    egnsh98
    Member

    Here it is. And as I said, $user has a value if I echo it, but does not get passed into the value parameter of the hidden field.

    <?php
    /*
    Title: Twitter
    Setting: twitter_settings
    Tab: Twitter Settings
    Order: 200
    */		
    	
    	// Consumer Key
    	piklist('field', array(
    		'type' => 'text'
    		,'field' => 'consumer_key'
    		,'label' => __('Consumer Key')
    		,'value' => __('Consumer Key')
    		,'help' => __('Enter the Consumer Key found in your Twitter Apps settings')
    		,'capability' => 'manage_options'
    		,'position' => 'wrap'
    		,'serialize' => 'false'
    		,'attributes' => array(
    			'title' => 'Twitter API Application Consumer Key'
    			,'alt' => 'Twitter API Application Consumer Key'
    			,'tabindex' => '1'
    			,'onfocus' => "if(this.value == 'Consumer Key') { this.value = ''; }"
    			,'columns' => '12'
    		)
    	));
    	
    	// Consumer Secret
    	piklist('field', array(
    		'type' => 'text'
    		,'field' => 'consumer_secret'
    		,'label' => __('Consumer Secret')
    		,'value' => __('Consumer Secret')
    		,'help' => __('Enter the Consumer Secret found in your Twitter Apps settings')
    		,'capability' => 'manage_options'
    		,'position' => 'wrap'
    		,'serialize' => 'false'
    		,'attributes' => array(
    			'title' => 'Twitter API Application Consumer Secret'
    			,'alt' => 'Twitter API Application Consumer Secret'
    			,'tabindex' => '2'
    			,'onfocus' => "if(this.value == 'Consumer Secret') { this.value = ''; }"
    			,'columns' => '12'
    		)
    	));
    	
    	// Access Token
    	piklist('field', array(
    		'type' => 'text'
    		,'field' => 'oauth_token'
    		,'label' => __('Access Token')
    		,'value' => __('Access Token')
    		,'help' => __('Enter the Access Token found in your Twitter Apps settings')
    		,'capability' => 'manage_options'
    		,'position' => 'wrap'
    		,'serialize' => 'false'
    		,'attributes' => array(
    			'title' => 'Twitter API Application Access Token'
    			,'alt' => 'Twitter API Application Access Token'
    			,'tabindex' => '1'
    			,'onfocus' => "if(this.value == 'Access Token') { this.value = ''; }"
    			,'columns' => '12'
    		)
    	));
    	
    	// Access Token Secret
    	piklist('field', array(
    		'type' => 'text'
    		,'field' => 'oauth_token_secret'
    		,'label' => __('Access Token Secret')
    		,'value' => __('Access Token Secret')
    		,'help' => __('Enter the Access Token Secret found in your Twitter Apps settings')
    		,'capability' => 'manage_options'
    		,'position' => 'wrap'
    		,'serialize' => 'false'
    		,'attributes' => array(
    			'title' => 'Twitter API Application Access Token Secret'
    			,'alt' => 'Twitter API Application Access Token Secret'
    			,'tabindex' => '1'
    			,'onfocus' => "if(this.value == 'Access Token Secret') { this.value = ''; }"
    			,'columns' => '12'
    		)
    	));
    
    	// Get the user's profile information
    	$instance = Main::get_instance();
    	
    	$user = $instance->get_user();
    
    	// Twitter Name
    	piklist('field', array(
    		'type' => 'hidden'
    		,'field' => 'twitter_name'
    		,'value' => $user
    	));
      
    ?>
    in reply to: Include a file within Piklist #1854
    egnsh98
    Member

    I’ve got the getter methods working now, and when I print them out in /parts/settings/twitter.php, they display, but don’t seem to be getting picked up by the hidden field. Should I be setting the $user variable on a different parameter?

Viewing 15 posts - 1 through 15 (of 17 total)