Forum Replies Created
-
AuthorPosts
-
mcmasterMemberI am running v1.9.3, but I had modified a line in an attempt to turn off the error. I apologize for the confusion. I just downloaded a fresh copy of 1.9.3 and verified that the problem still exists.
Line 488 is:
remove_action($filter, $tag, $priority, $wp_filter[$filter][$priority][$tag]['accepted_args']);In some cases, $priority is not set. I turned off the error messages by changing line 486 to add a check for $priority:
if(!empty($filter) && isset($priority) )But I don’t know whether that’s fixing the problem or merely camouflaging the error.
Let me know if you’d like access to a test site that’s still logging this error.
Donna
mcmasterMemberYes, I think it would be ideal for creating what ACF refers to as Flexible Content. (Actually, @kevin is the one who gave me that idea a while back.) See also this discussion on wpchat: https://wpchat.com/t/pros-cons-of-piklist-vs-acf/1196/6
mcmasterMemberOne more note: this occurs when the tag is ‘feed_links’ and again for ‘feed_links_extra’.
mcmasterMemberI just ran into the same error with WP Helpers 1.9.3. I am starting two new websites, and I ran through my configuration on the two in parallel. They are still running on Twenty-Fifteen theme. Did almost identical settings in WP-Helpers. And now one of them is displaying the following error (actually 6 lines as the 3 lines below are repeated) every time I go into the List view for Posts or Pages. The other one is not displaying the error.
Notice: Undefined variable: priority in /Users/donna/Sites/pclf/wp-content/plugins/wp-helpers/wp-helpers.php on line 488 Notice: Undefined variable: priority in /Users/donna/Sites/pclf/wp-content/plugins/wp-helpers/wp-helpers.php on line 488 Notice: Undefined index: in /Users/donna/Sites/pclf/wp-content/plugins/wp-helpers/wp-helpers.php on line 488Line 488 in WP Helpers 1.9.3 is:
if ( !isset( $wp_filter[$filter][$priority] ) ) {The value of $filter is
wp_head. This is the value of$wp_filter[$filter]:[wp_head] => Array ( [1] => Array ( [_wp_render_title_tag] => Array ( [function] => _wp_render_title_tag [accepted_args] => 1 ) [wp_enqueue_scripts] => Array ( [function] => wp_enqueue_scripts [accepted_args] => 1 ) [noindex] => Array ( [function] => noindex [accepted_args] => 1 ) [wp_post_preview_js] => Array ( [function] => wp_post_preview_js [accepted_args] => 1 ) ) [10] => Array ( [locale_stylesheet] => Array ( [function] => locale_stylesheet [accepted_args] => 1 ) [rel_canonical] => Array ( [function] => rel_canonical [accepted_args] => 1 ) [wp_shortlink_wp_head] => Array ( [function] => wp_shortlink_wp_head [accepted_args] => 0 ) [piklist_admin::admin_head] => Array ( [function] => Array ( [0] => piklist_admin [1] => admin_head ) [accepted_args] => 1 ) [piklist_theme::version_in_header] => Array ( [function] => Array ( [0] => piklist_theme [1] => version_in_header ) [accepted_args] => 1 ) [000000005c99777b000000014e3d5fbarecent_comments_style] => Array ( [function] => Array ( [0] => WP_Widget_Recent_Comments Object ( [id_base] => recent-comments [name] => Recent Comments [widget_options] => Array ( [classname] => widget_recent_comments [description] => Your site’s most recent comments. ) [control_options] => Array ( [id_base] => recent-comments ) [number] => [id] => [updated] => [option_name] => widget_recent-comments [alt_option_name] => widget_recent_comments ) [1] => recent_comments_style ) [accepted_args] => 1 ) [twentyfifteen_header_style] => Array ( [function] => twentyfifteen_header_style [accepted_args] => 1 ) [_custom_background_cb] => Array ( [function] => _custom_background_cb [accepted_args] => 1 ) [wp_admin_bar_header] => Array ( [function] => wp_admin_bar_header [accepted_args] => 1 ) [_admin_bar_bump_cb] => Array ( [function] => _admin_bar_bump_cb [accepted_args] => 1 ) ) [7] => Array ( [print_emoji_detection_script] => Array ( [function] => print_emoji_detection_script [accepted_args] => 1 ) ) [8] => Array ( [wp_print_styles] => Array ( [function] => wp_print_styles [accepted_args] => 1 ) ) [9] => Array ( [wp_print_head_scripts] => Array ( [function] => wp_print_head_scripts [accepted_args] => 1 ) ) [99] => Array ( [wp_site_icon] => Array ( [function] => wp_site_icon [accepted_args] => 1 ) ) [0] => Array ( [piklist_theme::register_assets_head] => Array ( [function] => Array ( [0] => piklist_theme [1] => register_assets_head ) [accepted_args] => 1 ) [twentyfifteen_javascript_detection] => Array ( [function] => twentyfifteen_javascript_detection [accepted_args] => 1 ) ) )I see here https://piklist.com/support/topic/notices-on-a-custom-post-type/ that you requested the wp-helpers configuration. Let me know if something like that for the two sites (with errors and without) would be useful.
Cheers,
Donna
mcmasterMemberFYI the content is being saved in the post_content field as:
[mcw-feature title="Test" image="451" content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed diam eget risus varius blandit sit amet non magna. Etiam porta sem malesuada magna mollis euismod. Lorem ipsum dolor sit amet, consectetur adipiscing elit." link="/foo/" _index="0"]
mcmasterMember@kevin, the flexible content configuration is working almost perfectly.
The “almost” is because for some reason when it displays the inputs for one of the repeatable options, it displays the wrong label.
Still, it’s close enough to show my client in the morning, and I know she’ll be pleased.
Here’s the full metabox file in case someone else would find it useful. I’m attaching an image that shows the label problem.
<?php /* Title: Flexible Panels Post Type: post Order: 90 Collapse: false */ piklist('field', array( 'type' => 'group', 'field' => 'flex_panels', 'label' => 'Flexible Panels', 'add_more' => true, 'template' => 'field', 'fields' => array( // first select the type of panel; this will determine which fields to add array( 'type' => 'select', 'field' => 'choose_panel', 'label' => 'Choose panel type', 'choices' => array( 'grid_3' => 'Three-column grid', 'columns_2' => 'Two columns', 'boxed_rows' => 'Boxed rows', 'wide_content' => 'Wide content', 'looking_forward' => 'Looking forward', ), 'value' => 'grid_3', ), // Headline field is in all panels array( 'type' => 'text', 'field' => 'headline', 'label' => 'Headline', 'columns' => 12, ), // Introduction field is in all but "Looking forward" array( 'type' => 'editor', 'field' => 'intro', 'label' => 'Introduction', 'columns' => 12, 'options' => array ( 'media_buttons' => true, 'teeny' => true, ), 'conditions' => array( array( 'field' => 'flex_panels:choose_panel', 'value' => array( 'wide_content', 'grid_3', 'boxed_rows', 'columns_2' ), ), ), ), // "Looking forward" has a single Image field array( 'type' => 'file', 'field' => 'image', 'label' => 'Image', 'help' => 'Add or upload one image.', 'options' => array( 'modal_title' => 'Add Image', 'button' => 'Add Image', ), 'conditions' => array( array( 'field' => 'flex_panels:choose_panel', 'value' => array( 'looking_forward' ), ), ), ), // "Wide content" allows either two or three images array( 'type' => 'file', 'field' => 'images', 'label' => 'Images', 'help' => 'Add or upload 2 or 3 images, which will be displayed in a row.', 'options' => array( 'modal_title' => 'Add Image', 'button' => 'Add Image', ), 'conditions' => array( array( 'field' => 'flex_panels:choose_panel', 'value' => array( 'wide_content' ), ), ), ), // Main content field is in "Wide content" and "Looking forward" array( 'type' => 'editor', 'field' => 'content', 'label' => 'Content', 'columns' => 12, 'options' => array ( 'media_buttons' => true, 'teeny' => true, ), 'conditions' => array( array( 'field' => 'flex_panels:choose_panel', 'value' => array( 'wide_content', 'looking_forward' ), ), ), ), // "looking forward" also has a bottom content area array( 'type' => 'editor', 'field' => 'content_bottom', 'label' => 'Content bottom', 'columns' => 12, 'options' => array ( 'media_buttons' => false, 'teeny' => true, ), 'conditions' => array( array( 'field' => 'flex_panels:choose_panel', 'value' => array( 'looking_forward' ), ), ), ), // Boxes include headline, image and text // for "Boxed rows," each box is displayed horizontally on a full-width row; // for "3-column grid," the boxes are roughly square shaped and are displayed // three across. array( 'type' => 'group', 'field' => 'boxes', 'label' => 'Boxes', 'help' => 'Enter content for as many boxes as you want. They will be displayed three across for 3-column grid, or one across for boxed rows.', 'columns' => 12, 'add_more' => true, 'fields' => array( array( 'type' => 'text', 'field' => 'box_title', 'label' => 'Box Title', 'columns' => 12, ), array( 'type' => 'file', 'field' => 'box_image', 'label' => 'Box Image', 'description' => 'Add or upload one image.', 'options' => array( 'modal_title' => 'Add Image', 'button' => 'Add Image', ), ), array( 'type' => 'editor', 'field' => 'box_body', 'label' => 'Box Body', 'columns' => 12, 'options' => array ( 'media_buttons' => false, 'teeny' => true, ), ), ), 'conditions' => array( array( 'field' => 'flex_panels:choose_panel', 'value' => array( 'boxed_rows', 'grid_3' ), ), ), ), // Column content includes optional column title and body // Two columns exactly, please. array( 'type' => 'group', 'field' => 'columns', 'label' => 'Columns', 'help' => 'Enter content for each of the two columns.', 'columns' => 12, 'add_more' => true, 'fields' => array( array( 'type' => 'text', 'field' => 'column_title', 'label' => 'Column Title', 'columns' => 12, ), array( 'type' => 'editor', 'field' => 'column_body', 'label' => 'Column Body', 'columns' => 12, 'options' => array ( 'media_buttons' => false, 'teeny' => true, ), ), ), 'conditions' => array( array( 'field' => 'flex_panels:choose_panel', 'value' => array( 'columns_2' ), ), ), ), ), ));Attachments:
You must be logged in to view attached files.
mcmasterMember@Steve: yes, I have a plugin
mcw-piklist-customwith several add-ons that I enable the same way that Piklist Demos is enabled. This is in the main file for one of the add-ons:plugins/mcw-piklist-custom/add-ons/mcw-post-custom/mcw-post-custom.phpDonna
mcmasterMemberIf I filter on
piklist_add_part, my function is never called.When I filter on
piklist_part_add, the function is called but the$part_dataarray is always empty.
mcmasterMemberGood news: I tried some other search terms and found this thread, which explains how to reference a nested field: https://piklist.com/support/topic/new-conditional-bug-yaaay/. I modified my code to use
flex_panels:choose_panelas the conditional selector, and now the conditional aspect works great. Awesome!Now for the bad news. There is still no add-more button. 🙁
I also disabled ACF just in case that was interfering, but no change.
Attachments:
You must be logged in to view attached files.
mcmasterMemberForgot to mention that the “add-more” buttons don’t show up, either. Here’s a screen shot. The fields are always the same regardless of the selection.
Attachments:
You must be logged in to view attached files.
mcmasterMemberOkay, I’m probably doing something hopelessly dumb, but I can’t seem to get this to work. I set up the filter and function based on the wp-helpers excerpt example:
add_filter( 'piklist_part_add', 'mcw_check_categories', 9999, 2 ); function mcw_check_categories ( $part_data, $folder ) { if ( empty( $part_data ) ) { return $part_data; } // get post ID to test against category terms if ( isset( $_REQUEST['post'] ) ) { $post_id = $_REQUEST['post']; } elseif ( isset( $_REQUEST['post_ID'] ) ) { $post_id = $_REQUEST['post_ID']; } else { return $part_data; } if ( in_category( array( 'podcasts', 'music-service-videos' ), $post_id ) ) { if ( $folder == 'meta-boxes' ) { if ( !empty( $part_data['type'] ) && $part_data['type'] == 'post_credits' ) { $part_data['type'] = 'post'; } } } return $part_data; }It did nothing. I put in some error logging to figure out where it was breaking, and $part_data is always an empty array. I set the filter priority to 9999, which is the same as in wp-helpers.
Any suggestions?
Thanks so much!
Donnap.s. the good news is that I am becoming ever more familiar with the innards of Piklist. 😉
mcmasterMemberThanks, @Steve, apologies for not researching better first.
mcmasterMemberThis reply has been marked as private. -
AuthorPosts