Forum Replies Created

Viewing 15 posts - 2,491 through 2,505 (of 2,964 total)
  • Author
    Posts
  • Steve
    Keymaster

    @kattagami– Piklist actually has a filter to help you do this: piklist_empty_post_title. I just tested it and there is a small bug which I fixed, and will be in the next version of Piklist. Try this:

    1) Open class-piklist-cpt.php and find the wp_insert_post_data function. Change the IF statement to this:
    if (($data['post_status'] != 'auto-draft') && (($data['post_title'] == 'Auto Draft') || empty($data['post_title']))). That fixes the bug.

    2) Here’s your function:

    function set_cpt_organizer_title($data, $post_array)
    {
      if ($post_array['post_type'] == 'organizer')
      { 
        if((isset($post_array['_post_meta']['firstname'][0])) || isset($post_array['_post_meta']['lastname'][0]))
        {
          $full_name = $post_array['_post_meta']['firstname'][0] . ' ' . $post_array['_post_meta']['lastname'][0];
          return $full_name;
        }
        else
        {
          return $post_array['post_title'];
        }
      }
      else
      {
        return $post_array['post_title'];
      }
    
    }
    add_filter('piklist_empty_post_title', 'set_cpt_organizer_title', 10, 2);

    3) The WordPress $post_array array returns all the data from your post including meta, so you don’t need to use get_post_meta.

    Let me know if this works. If there are no issues we’ll document it and write a tutorial.

    in reply to: Piklist in Pages #1686
    Steve
    Keymaster

    @jason– Thanks for the tip!

    in reply to: Post-Relate question/bug #1679
    Steve
    Keymaster

    @pupppet– Showing/hiding seems to be a bug with the relate field. Supporting multiple scopes is interesting. I just tested multiple scopes like this 'scope' => array('post','page') and it seemed to work, but throws a bunch of warnings since most Piklist functions are not expecting an array. We’re going to have to think through if, and how, we want to support this.

    in reply to: DatePicker-Field – save as timestamp? #1678
    Steve
    Keymaster

    @sewid– Piklist currently does not support this, so you may need to go old school 😉

    Try hooking into save_post, pull the “pretty” date field, convert it and save another field with the unix timestamp. Then sort on that field.

    This thread on WordPress.org has some good ideas and sample code.

    Let us know if this works for you.

    in reply to: Text field in radio option #1677
    Steve
    Keymaster

    @jason– I believe you want Nested fields, and there’s an example in Piklist Demos:
    add new demo > lists > radio fields > nested fields.

    in reply to: Number field, min attribute removes attribute #1676
    Steve
    Keymaster

    @jason– Nice find and great fix. I just included it in the next version of Piklist.

    Question: where did you make the pull request to?

    in reply to: wp-helpers 'breaks' after plugin install #1675
    Steve
    Keymaster

    @phila– Piklist still has a few kinks to work out with Windows installs. We’ll take a look at this one.

    in reply to: Set Editor to HTML Display #1671
    Steve
    Keymaster

    Even easier. The editor field supports this. Pass false to the tinymce parameter >

    in reply to: Set Editor to HTML Display #1670
    Steve
    Keymaster

    Try this: add_filter('user_can_richedit', '__return_false', 11);

    in reply to: Grouped file field type broken #1667
    Steve
    Keymaster

    @pupppet– There is bug with the image upload field and add-mores. We are working on a fix.

    in reply to: Grouped file field type broken #1663
    Steve
    Keymaster

    @pupppet– Please provide a code snippet.

    in reply to: Piklist Content Types and Taxonomies #1657
    Steve
    Keymaster

    @jmendel– These will be separate plugins when released. We’re still fine tuning them.

    in reply to: Getting Error When Modifying Post Date/Time #1656
    Steve
    Keymaster

    We just released v0.9.3.2 which contains this fix so it’s safe for you to update.

    in reply to: Unable to remove add_more fields in post edit #1648
    Steve
    Keymaster

    @jason– You can use CSS to size the box. You can even add your own css classes to the field:

    "attributes" => array(
      "class" => "my-class"
    )
    in reply to: Piklist Overwriting CPT Metadata #1646
    Steve
    Keymaster

    Can you post some code for us to review?

Viewing 15 posts - 2,491 through 2,505 (of 2,964 total)