Forum Replies Created

Viewing 15 posts - 61 through 75 (of 2,964 total)
  • Author
    Posts
  • in reply to: Problem with “Group” field #10878
    Steve
    Keymaster

    It looks like you copied the address_group field directly from the demos. It has a function called “piklist_demo_get_states()” in it, that you didn’t copy over. You can either remove that entire field, or replace piklist_demo_get_states() with an array of choices like:

    ,'choices' => array(
        'nj' => 'NJ',
        'nj' => 'NY'
     )
    in reply to: Problem with “Group” field #10876
    Steve
    Keymaster

    I tested this field and it works for me. Please enable wp_debug so WordPress can log the error message: https://wordpress.org/support/article/debugging-in-wordpress/

    in reply to: Get value of select field #10875
    Steve
    Keymaster

    @guit4eva– Since Piklist is file driven, and not database driven, you can’t really get the values by default. However, we’ve run into this in the past as well for our clients, and here are two solutions:

    1) Name the keys the values you want to display:

    piklist('field', array(
        'type' => 'select',
        'field' => 'establishment_no_bedrooms',
        'label' => 'Number of Bedrooms',
        'choices' => array(
            '1' => '1',
            '2' => '2',
            '3' => '3',
            '4' => '4',
            '5' => '5',
            '6' => '6',
            '7+' => '7+',
        ),
    ));

    Obviously, that’s the easiest.

    2. List your choices in a separate function.

    One of the things that makes Piklist so great, is that you can use functions to generate field options and reuse them. In another file (not your Piklist parts file), like functions.php do something like:

    function establishment_no_bedrooms_list($choice = null) {
    
      $choices = array (
        '1_bedroom' => '1',
        '2_bedroom' => '2',
        '3_bedroom' => '3',
        '4_bedroom' => '4',
        '5_bedroom' => '5',
        '6_bedroom' => '6',
        '7_bedroom' => '7+',
      );
    
     If ($choice === null {
    
      return $choices;
    
    } else {
    
      return $choices[$choice];
    
    }

    That function says, if you don’t pass a choice return the choices. If you do pass a choice, return the value.

    Then in your Piklist parts file reference the function.

    piklist('field', array(
        'type' => 'select',
        'field' => 'establishment_no_bedrooms',
        'label' => 'Number of Bedrooms',
        'choices' => establishment_no_bedrooms_list()
        ),
    ));

    and in your theme:
    echo establishment_no_bedrooms_list( get_post_meta($post->ID, 'establishment_no_bedrooms', true ) );

    IMPORTANT: This is untested and may require some tweaking.

    Steve
    Keymaster

    Absolutely! When creating fields with Piklist, make sure name the field the same name as the custom field in your database. Piklist will recognize it.

    in reply to: Making a conditional field required #10854
    Steve
    Keymaster

    Thank you for using it!

    in reply to: Making a conditional field required #10852
    Steve
    Keymaster

    @rafi– We’re still working on Piklist v2.0, which will be as revolutionary as Piklist 1.0 was, and will address issues like this.

    in reply to: Making a conditional field required #10851
    Steve
    Keymaster

    @rafi– We’re still working on Piklist v2.0, which will be as revolutionary as Piklist 1.0 was, and will address issues like this.

    in reply to: PHP 7.4 error #10844
    Steve
    Keymaster

    Thanks. We’re working on a fix.

    in reply to: PHP 7.4 error #10842
    Steve
    Keymaster

    @sjoseph– thanks for reporting. We’ll take a look.

    in reply to: Repeatable TinyMCE error #10788
    Steve
    Keymaster

    @cobaltmg– I was able to reproduce the message. Unfortunately, this is not such an easy fix and probably won’t be available until Piklist 2.0 which we are currently working on.

    in reply to: Piklist logo animation and WCAG conformance #10787
    Steve
    Keymaster

    Thank you for bringing this to our attention. We just updated the animated logo, shortened the length and removed the loop. https://wordpress.org/plugins/piklist/

    in reply to: Repeatable TinyMCE error #10781
    Steve
    Keymaster

    Which version of WordPress are you running? I’m going to try and reproduce.

    in reply to: Repeatable TinyMCE error #10778
    Steve
    Keymaster

    Have you tried removing some of these options and see if that fixes it?

    ,'tinymce' => array(
              'extended_valid_elements' => 'span[!class],code[!class],a[!href|target=_blank],*[style=]'
              ,'invalid_styles' => 'display,color'
              ,'invalid_elements' => '*[style]'
              ,'block_formats' => 'Paragraph=p;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6'
              ,'paste_auto_cleanup_on_paste' => true
              ,'paste_remove_spans' => true
              ,'paste_remove_styles' => true
              ,'toolbar1' => 'bold italic underline bullist numlist link unlink cut copy paste undo redo'
              ,'toolbar2' => 'formatselect strikethrough indent outdent pastetext removeformat charmap searchreplace'
            )
    in reply to: Repeatable TinyMCE error #10772
    Steve
    Keymaster

    Please post all the code in your parts file. I’d like to see if I can reproduce.

    in reply to: Repeatable TinyMCE error #10770
    Steve
    Keymaster

    @cobaltmg– Are you using WordPress 5.X? If so, are you using the Classic Editor plugin?

    Classic Editor

Viewing 15 posts - 61 through 75 (of 2,964 total)