• Resolved swcomm

    (@swcomm)


    Hi – Have started seeing this warning in my logs:

    PHP Warning: Undefined array key 1 in network-posts-extended/network-posts-extended.php on line 327

    PHP8, WP 6.1.1, current version of Network Posts Extended, and I’m using a shortcode that sorts my posts by a lastname ACF field in asc alpha order and it looks like line 327 pertains to ACF. Advice? Thanks much.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author johnzenausa

    (@johnzenausa)

    will look in to it. Thanks

    Plugin Author johnzenausa

    (@johnzenausa)

    Can you please paste the shortcode you are using here?

    Thread Starter swcomm

    (@swcomm)

    Sure – using two shortcodes. First one below is on a page using Beaver Builder – not sure if that’s relevant tho!

    [netsposts include_blog='4' include_post='7647,7648,7649,7650' shortcode_id='current' hide_source='true' taxonomy='hall-of-fame, 2022' taxonomy_type='category' must_include_categories='true' thumbnail='true' order_by_acf='lastname' use_layout='inline' wrap_title_start='<h5>' wrap_title_end='</h5>' include_link_title='true' read_more_text='Full Bio &amp; Video ']
    [netsposts include_blog='4' shortcode_id='hofgallery' hide_source='true' taxonomy='hall-of-fame'  hide_excerpt='true'  list='40' limit='200' paginate='true' mid_size='1' end_size='1' thumbnail='true' order_by_acf='lastname' use_layout='inline' wrap_title_start='<h6>' wrap_title_end='</h6>' include_link_title='true' read_more_text=' ']
    Plugin Author johnzenausa

    (@johnzenausa)

    @swcomm

    With the parameter order_by_acf='lastname'

    please add asc or desc to it so it looks like this:

    order_by_acf='lastname asc' or order_by_acf='lastname desc' and see if that gets rid of the PHP 8 error.

    Thread Starter swcomm

    (@swcomm)

    Thank you, looks like that did resolve the warning. I didn’t use a sort order in the shortcode because the sort is using asc, so didn’t think I’d need it.

    Plugin Author johnzenausa

    (@johnzenausa)

    It has to do with WordPress 8. Just add asc or desc on all ordering and it should be fine.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP Warning’ is closed to new replies.