Support » Plugin: WP Sort Order » parameter 2 to be array

  • Resolved jotooga

    (@jotooga)


    After installing the plugin . I get an error on top of the dashbord page as follows
    parameter 2 to be array, string given in /home/tooga/public_html/wp-content/plugins/wp-sort-order/inc/hooks.php on line 873“<br/>
    Below copy of Hooks.php file starting on line 869 taken from my cpanel:<br/>
    **********************************************************
    868-$wpso_objects = isset( $wpso_options[‘objects’] ) ? $wpso_options[‘objects’] : array();
    869-
    870-
    871- global $wpdb;
    872-
    873- if(!$post->menu_order && in_array( $post->post_type, $wpso_objects )){
    874- $sql = ‘SELECT MAX(menu_order) FROM ‘.$wpdb->posts.’
    875- WHERE post_type = “‘.$post->post_type.'” ‘;
    $max = $wpdb->get_var($sql);
    if($max>0){
    wp_update_post(array(
    ‘ID’=>$post->ID,
    ‘menu_order’=>$max+1
    ));

    }
    }

    }

    add_action(‘admin_footer’, ‘wpso_admin_scripts’, 100);
    function wpso_admin_scripts(){
    global $wpso_allowed_pages;
    ************************************************
    Can u kindly help with the change of coding since I do not have enough knowledge on php.
    Many thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Fahad Mahmood

    (@fahadmahmood)

    @jotooga don’t worry, i will check it and resolve this notice/warning in next release. Don’t worry, it’s an error which will disturb your website.

    Came here to post the same thing–getting this warning in the debug.log:

    PHP Warning: in_array() expects parameter 2 to be array, string given in .../wp-content/plugins/wp-sort-order/inc/hooks.php on line 873

    Even if it doesn’t impact the functionality of the plugin, if this could be fixed so it doesn’t fill up the debug.log with the warnings, that would be appreciated.

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    @hastibe it has been corrected, you will get it in next release. Thank you for this contribution.

    Great–thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘parameter 2 to be array’ is closed to new replies.