Recent Custom Posts Conflict

When I attempt to use this plugin’s widget I get the following error message:

Fatal error: Call to undefined function preg_filter() in /home/tad84/public_html/wp-content/plugins/recent-custom-post-type/recent-custom-post-type.php on line 191

It also freezes the widgets, so when I go back in to edit them, nothing works. I can’t edit any widgets or change any of them out. I tried disabling all of my plugins and changing themes to see if there was a conflict, but it still did the same thing.

  • Arnold
    • El Macho WP

    Problem is your version of PHP is less than 5.3. You can either update you PHP oryou could add this routine to your functions.php to give a substitute routine.

    if (!function_exists('preg_filter')) {

    function preg_filter($pattern, $replace, $subject, $limit = -1 , &$count = null) {

    if(!is_array($subject)) {
    $noArray = 1 ;
    $subject = array($subject);

    $preg = preg_replace($pattern, $replace, $subject, $limit, &$count);

    $diff = array_diff($preg, $subject);

    if($noArray == 1) $diff = implode($diff) ;

    return $diff ;



  • PC
    • WPMU DEV Initiate


    Greetings and thanks for being a great community member.

    We haven’t heard from you on this one for long and I am doing a regular followup to see if there is still something we can assist you on this thread.

    Just to manage the support issues more efficiently, I am marking this thread as resolved for now however this is not being done to avoid your questions in any ways.

    Please feel free to mark this is “Not resolved” in case you have further questions and we would be back on it.

    Thanks a lot for being with WPMU DEV.



Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.