{"id":9150109,"date":"2017-05-19T18:53:33","date_gmt":"2017-05-19T18:53:33","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/fix-for-undefined-function-array_column\/"},"modified":"2017-05-19T18:53:33","modified_gmt":"2017-05-19T18:53:33","slug":"fix-for-undefined-function-array_column","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/fix-for-undefined-function-array_column\/","title":{"rendered":"Fix for undefined function array_column"},"content":{"rendered":"<p>Hi, if you have newer versions of php installed on your server you will notice that plugin doesn\u00b4t work. That because &#8220;array_column&#8221; function was deprecated. You must code your own function for that. The next code is a solution for that problem. Paste it on the top of mail2users.php file (behind first coments): <\/p>\n<p>if (! function_exists(&#8216;array_column&#8217;)) {<br \/>\n    function array_column(array $input, $columnKey, $indexKey = null) {<br \/>\n        $array = array();<br \/>\n        foreach ($input as $value) {<br \/>\n            if ( !array_key_exists($columnKey, $value)) {<br \/>\n                trigger_error(&#8220;Key \\&#8221;$columnKey\\&#8221; does not exist in array&#8221;);<br \/>\n                return false;<br \/>\n            }<br \/>\n            if (is_null($indexKey)) {<br \/>\n                $array[] = $value[$columnKey];<br \/>\n            }<br \/>\n            else {<br \/>\n                if ( !array_key_exists($indexKey, $value)) {<br \/>\n                    trigger_error(&#8220;Key \\&#8221;$indexKey\\&#8221; does not exist in array&#8221;);<br \/>\n                    return false;<br \/>\n                }<br \/>\n                if ( ! is_scalar($value[$indexKey])) {<br \/>\n                    trigger_error(&#8220;Key \\&#8221;$indexKey\\&#8221; does not contain scalar value&#8221;);<br \/>\n                    return false;<br \/>\n                }<br \/>\n                $array[$value[$indexKey]] = $value[$columnKey];<br \/>\n            }<br \/>\n        }<br \/>\n        return $array;<br \/>\n    }<br \/>\n}<\/p>\n","protected":false},"template":"","class_list":["post-9150109","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9150109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9150109\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9150109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}