Forum Replies Created

Viewing 15 posts - 1,381 through 1,395 (of 2,964 total)
  • Author
    Posts
  • in reply to: teeny editor nests data in divs (0.9.9.4) #4782
    Steve
    Keymaster

    @mcmaster– I can’t reproduce. Can you provide step by step instructions or a screencast?

    in reply to: label misplaced in add-more (0.9.9.4) #4781
    Steve
    Keymaster

    Piklist uses a 12 column grid. So each row of fields should equal 12. Try this:

    piklist( 'field', array(
      'type' => 'group',
      'field' => 'home_news',
      'label' => 'Featured News',
      'description' => 'Information for the home page news feature.',
      'template' => 'field',
      'fields' => array(
        array(
          'type' => 'text',
          'field' => 'section_title',
          'columns' => 8, // First row: 8 columns
          'label' => 'News Section Title',
          'value' => "What's New",
        ),
        array(
          'type' => 'number',
          'field' => 'section_quantity',
          'label' => 'Number of Posts',
          'description' => 'How many recent posts should we display?',
          'columns' => 4, // First row: 4 columns. Row will end here because 12 columns have been reached.
          'value' => 2,
          'validate' => array(
            array(
              'type' => 'range',
              'options' => array(
                'min' => 1,
                'max' => 4,
              ),
            ),
          ),
        ),
        array(
          'type' => 'text',
          'field' => 'section_link_text',
          'label' => 'Text for Link to News Page',
          'value' => 'View All News',
          'columns' => 12, // Second row starts here
          'validate' => array(
            array(
              'type' => 'safe_text',
            ),
          ),
        ),
      ),
    ));
    
    in reply to: Grouped widgets #4780
    Steve
    Keymaster

    @jimmyjazz– Piklist currently groups all widgets in the same plugin or theme. No way around this yet. Agreed, it doesn’t make much sense for a single widget. On our list of things to look at after 1.0

    in reply to: file upload input box overlays description #4779
    Steve
    Keymaster

    Thanks, Donna. We’ll look into it.

    in reply to: Description doesn't show up in HTML field #4778
    Steve
    Keymaster

    We’re looking into this.

    in reply to: Plugins screen bug with Piklist 0.9.9.4 #4777
    Steve
    Keymaster

    @devonanderson– We’ve been trying to reproduce but can’t. Can you verify that you have the table wp_termmeta in your db? This came up with another user.

    in reply to: Cannot output inline styles within editors #4769
    Steve
    Keymaster

    This week. Working on a few more things

    in reply to: Numbering order based on drag and drop #4767
    Steve
    Keymaster

    @rcantor– The json api has a filter, json_api_encode, that you can use to manipulate the data before the output.

    Try this:

    add_filter('json_api_encode', 'my_json_api_encode');
    function my_json_api_encode($data)
    {
      // Are we on a single post
      if (is_single())
      {
        // Get the sources_group field
        $sources_group = get_metadata('post', $data['post']->id, 'sources_group', true);
          
        if ($sources_group)
        {
          foreach ($sources_group as $index => &$group)
          {
            // Add the index to the objecdt
            $group['order'] = $index;
          }
      
          // Add updated object back to the json
          $data['post']->sources_group = $sources_group;
        }
      }
    
      return $data;
    }
    

    It should render like this:

    "sources_group":[
    	{
    		"source_title":"title 1"
    		,"source_text":"text 1"
    		,"source_url":"http:\/\/piklist.com"
                    ,"order":0
    	}
    	,
    	{
    		"source_title":"title 2"
    		,"source_text":"text 2"
    		,"source_url":"http:\/\/google.com"
                    ,"order":1
    	}
    ]
    

    Let me know if that works for you.

    in reply to: How to divide settings page with h3 sections #4765
    Steve
    Keymaster

    My pleasure… closing ticket.

    in reply to: How to divide settings page with h3 sections #4763
    Steve
    Keymaster

    @kplaneta– Piklist uses the WordPress settings api, which will reject anything that’s not a field. Then Piklist will render that markup on top. You can use the Piklist HTML field to render out what you want.

    piklist('field', array(
        'type' => 'html'
        ,'label' => '<h3>My title</h3>
      ));
    in reply to: Creating conditional field for something not equal to 'none' #4760
    Steve
    Keymaster

    @rcantor– I’m not sure I’m 100% clear on your request, so I hope this makes sense.

    After the user selects featured_post_id, they would need to save the page. Then you can use get_posts() to pull in the data you need.

    in reply to: Admin assets conflict #4759
    Steve
    Keymaster

    Thanks. This will be updated in 0.9.9.5.

    in reply to: Resolved Forum Topics Hard to Read #4757
    Steve
    Keymaster

    Always happy to make our site more readable. 😉

    Closing this ticket.

    in reply to: Numbering order based on drag and drop #4747
    Steve
    Keymaster

    WordPress stores this data in a serialized array. You can unserialize two ways:
    1) Use the standard WordPress function get_post_meta:
    $sources_group = get_post_meta($post->ID, 'sources_group', true);

    2) Unserialize with the standard PHP function, unserialize.

    Does that make sense?

    in reply to: Numbering order based on drag and drop #4744
    Steve
    Keymaster

    @rcantor– You can save the data in one array by setting a field for the entire group.

      'type' => 'group'
      ,'label' => __('Sources')
      ,'field => 'my_sources'
    

    Now all data will be saved in the field, my_sources, as an array.

    Does that help?

Viewing 15 posts - 1,381 through 1,395 (of 2,964 total)