Forum Replies Created

Viewing 15 posts - 2,401 through 2,415 (of 2,964 total)
  • Author
    Posts
  • in reply to: Groups in Settings #1921
    Steve
    Keymaster

    @jason– I’m going to email you some code.

    in reply to: Limit the files on file upload field? #1917
    Steve
    Keymaster

    @darlantc– Not yet… but soon.

    in reply to: Bug on File Upload Field #1916
    Steve
    Keymaster

    @darlantc– Totally understand. We will look into it.

    in reply to: Groups in Settings #1913
    Steve
    Keymaster

    @jason– Ok, we have a few things here.

    First I would change your code to the following, which moved the label for your second field to the actual value of the choice:

    piklist('field', array(
      'type'    => 'group',
      'field'   => 'taxonomies',
      'label'   => 'Taxonomies',
      'add_more'=> true,
      'fields'  => array(
        array(
          'type'      => 'text',
          'field'     => 'name',
          'label'     => 'Name',
          'required'  => true,
          'columns'   => 12
        ),
        array(
          'type'      => 'checkbox',
          'field'     => 'hierarchical',
          'required'  => true,
          'columns'   => 12,
          'choices'   => array(
            'true' => 'Hierarchical *'
          )
        )
      )
    ));
    

    Second, we have a new version of Piklist coming out that fixes all the alignment errors.

    in reply to: Settings Array #1911
    Steve
    Keymaster

    Since it’s only a single level add-more it might be easier to just loop through it the way you originally suggested.

    in reply to: Settings Array #1909
    Steve
    Keymaster

    Working with multi-dimensional arrays is never fun, that’s why we made it easy to output data. However, if you want to access the variables and work with them you are going to have to create your own methods.

    The array is structure so all the data is in order. All key [1] is related to the same add-more for example.

    in reply to: Settings Array #1906
    Steve
    Keymaster

    Due to the nature of the Add-mores and how powerful they are, we had to use an unconventional array structure. But don’t worry, Piklist helps you get the data out.

    Check out the docs on Add-More’s. It’s explained in detail.

    Let us know if you still need help.

    in reply to: Warning: Illegal offset type in isset or empty #1902
    Steve
    Keymaster

    @egnsh98– Thank you for pointing that out. I updated the Tutorial and hopefully it’s clearer. Scope is one of the most misunderstood parts of Piklst… and also one of the most powerful.

    in reply to: Warning: Illegal offset type in isset or empty #1900
    Steve
    Keymaster

    @egnsh98– You are on a Settings page, but have set: scope' => 'taxonomy'

    Scope does a lot of things, one of them is where you want to save the data. I’m guessing you want to save sched_group as a setting not to a taxonomy.

    In most cases you should never have to set scope. By default you should just leave it out and let Piklist automagically figure out what to do.

    in reply to: displaying images upload field problem!!! #1898
    Steve
    Keymaster

    @civilz– I believe this is not working because you are on a settings page and setting: 'scope' => 'post_meta'.

    Let Piklist determine the scope automagically:

    piklist('field', array(
        'type' => 'file'
        ,'field' => 'logo_upload_file'
        ,'label' => 'logo upload'
        ,'description' => 'Size Only : 97 x 338 px'
        ,'options' => array(
          'basic' => true
        )
      ));
    
    in reply to: Dynamic Post Metabox #1895
    Steve
    Keymaster

    @jason– Well, you just ruined one of our surprises for the next release. 😉

    We will be adding a filter to the comment blocks so you can do exactly what you just asked for.

    1) First, you will need to manually add the filter yourself until 0.9.4 is released. Open class-piklist-cpt.php. And find this line:
    $types = empty($data['type']) ? get_post_types() : explode(',', $data['type']);
    2) Add this code right before that line:
    $data = apply_filters('piklist_add_meta_box', $data, $post);
    3) Now you can filter the $data array that pulls in the comment block.

    EXAMPLE:

    add_filter('piklist_add_meta_box','my_comment_block_filter', 10, 2);
    function my_comment_block_filter($data, $post)
    {
      // filter $data array here
     
      return $data;
    }
    

    Let us know if you have questions on how to use this.

    in reply to: display theme setting in wp query_posts #1893
    Steve
    Keymaster

    @civilz– $count shouldn’t be in quotes, and you don’t have to echo it. You might want to try the format below for query_posts. It is more clear and readable.

    One other thing, $count = $theme_options['count_nabz'] is probably an array. You can see this by typing print_r($count);

    So the full code should be:

    $theme_options = get_option('my_theme_settings'); 
    $count = $theme_options['count_nabz'];
    $count = $count[0];
    
    $args = array(
      'cat' => 2,
      'posts_per_page'=> $count
    );
    
    query_posts( $args );
    in reply to: displaying images upload field problem!!! #1892
    Steve
    Keymaster

    @civilz

    1) Since this is a setting, let’s grab all your settings: $settings = get_option('my_settings'); . Replace my_settings with whatever is in the comment block of your settings file.
    2) Now let’s find the image ID for the field logo_upload_file: $image_id = $settings['logo_upload_file'];
    3) WordPress gave us back an array, but we are only interested in the first key=>value pair: $image_id = $image_id[0];
    4) Now that we have the image ID for the attachment, lets use a standard WordPress function to display the associated image: <a href="#"><img class="head-logo" src="<?php echo wp_get_attachment_url($image_id);?>"></a>

    FULL CODE

    $settings = get_option('my_settings');
    $image_id = $settings['logo_upload_file'];
    $image_id = $image_id[0];

    <a href="#"><img class="head-logo" src="<?php echo wp_get_attachment_url($image_id);?>"></a>

    Let me know if you still have any issues.

    in reply to: Fields within an HTML table #1888
    Steve
    Keymaster

    @egnsh98– You can use the “field” template to remove the label: 'template' => 'field'.

    As for the HTML table, please post some code or line drawings.

    in reply to: Include a file within Piklist #1887
    Steve
    Keymaster

    @egnsh98– After looking at your code I think there may be a better way to do it. We suggest using the Piklist Filter <a href="http://piklist.com/user-guide/docs/piklist_pre_update_option/">piklist_pre_update_option</a>. This filter will allow you to manipulate the data entered into the settings page BEFORE the page is saved.

    You probably want to do something like this:

    add_filter('piklist_pre_update_option','my_update_option',10,3);
    function my_update_option($settings, $new, $old)
    {
      $field_one = $settings['field_one'];
    
      $new_field_one = my_function($field_one);  
    
     
      if (isset($_REQUEST['autotweet_settings']))
      {
        $settings['field_one'] = 'new_field_one';
      }
     
      return $settings;
     
    }
    

    Let me know if that works for you.

Viewing 15 posts - 2,401 through 2,415 (of 2,964 total)