Tagged: conditional, group
- This topic has 4 replies, 2 voices, and was last updated 6 years, 3 months ago by
Steve.
Viewing 4 reply threads
-
AuthorPosts
-
-
October 16, 2015 at 2:44 pm #4610
shayneolMemberHello,
I sent an email yesterday with my code for this issue, but I just figured out what really is going wrong. If I have a conditional attached to a group, I receive the below error message. For example, if I want to show the contents of a group when a specific option from a select field is chosen, I receive an error message on the page. If the content to show/hide is not within a group, everything works fine.Error: Warning: array_push() expects parameter 1 to be array, string given in …/wp-content/plugins/piklist/includes/class-piklist-form.php on line 2534
My Code:
// Post Type piklist('field', array( 'type' => 'select' ,'field' => 'post_type' ,'label' => 'Post Type' ,'value' => 'choose' ,'columns' => 12 ,'choices' => array( 'choose' => '--CHOOSE POST TYPE--' ,'teacher' => 'Teacher Page' ,'standards' => 'Standards' ,'lesson_long' => 'Creativity Lesson' ,'lesson_short' => 'Skill Builder Lesson' ,'glossary' => 'Glossary' ) )); // STANDARDS FIELDS piklist('field', array( 'type' => 'group' ,'field' => 'standards' ,'template' => 'field' ,'add_more' => true ,'label' => 'Add Section' ,'description' => 'To add more SECTIONS, the "+" button. Click and drag to rearrange the order.' ,'conditions' => array( array( 'field' => 'post_type' ,'value' => 'standards' ) ) ,'fields' => array( array( 'type' => 'text' ,'field' => 'section_title' ,'label' => 'Section Title' ,'columns' => 12 ,'attributes' => array( 'class' => 'large-text' ) ) ,array( 'type' => 'text' ,'field' => 'section_anchor' ,'label' => 'Section Anchor ID' ,'columns' => 12 ,'attributes' => array( 'class' => 'large-text' ) ) ,array( 'type' => 'editor' ,'field' => 'section_content' ,'label' => 'Section Content' ,'options' => array( 'wpautop' => true ,'media_buttons' => true ,'shortcode_buttons' => true ,'tabindex' => '' ,'editor_css' => '' ,'editor_class' => '' ,'teeny' => false ,'dfw' => false ,'tinymce' => array( 'resize' => false ,'wp_autoresize_on' => true ) ,'quicktags' => true ,'drag_drop_upload' => true ) ) ) ));Thanks,
Shayne -
October 17, 2015 at 12:43 am #4615
-
October 17, 2015 at 1:34 am #4616
shayneolMemberAwesome. Thanks Steve!
-
October 20, 2015 at 7:14 pm #4641
shayneolMemberV.9.9.4 seems to have resolved this issue. Thanks guys again for your hard work.
-
October 21, 2015 at 3:15 am #4646
SteveKeymasterGreat. Closing ticket
-
-
AuthorPosts
Viewing 4 reply threads
- The topic ‘Conditional Attached to Group Giving Error Message (v0.9.9.3)’ is closed to new replies.