Jetpack::get_user_option_meta_box_order_dashboard PHP Method

get_user_option_meta_box_order_dashboard() public method

    function get_user_option_meta_box_order_dashboard($sorted)
    {
        if (!is_array($sorted)) {
            return $sorted;
        }
        foreach ($sorted as $box_context => $ids) {
            if (false === strpos($ids, 'dashboard_stats')) {
                // If the old id isn't anywhere in the ids, don't bother exploding and fail out.
                continue;
            }
            $ids_array = explode(',', $ids);
            $key = array_search('dashboard_stats', $ids_array);
            if (false !== $key) {
                // If we've found that exact value in the option (and not `google_dashboard_stats` for example)
                $ids_array[$key] = 'jetpack_summary_widget';
                $sorted[$box_context] = implode(',', $ids_array);
                // We've found it, stop searching, and just return.
                break;
            }
        }
        return $sorted;
    }
Jetpack