Title: undefined function d4p_bbpress_version()
Last modified: August 20, 2016

---

# undefined function d4p_bbpress_version()

 *  Resolved [graphicgeek](https://wordpress.org/support/users/graphicgeek/)
 * (@graphicgeek)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/)
 * I installed the plugin, and it seems to work on the front end, but I cannot access
   the settings. When I go to the settings page I get this:
 * Fatal error: Call to undefined function d4p_bbpress_version() in …/wp-content/
   plugins/gd-bbpress-attachments/code/shared.php on line 24
 * I’ve tried deleting and reinstalling, but no luck.
    Any ideas?
 * [http://wordpress.org/extend/plugins/gd-bbpress-attachments/](http://wordpress.org/extend/plugins/gd-bbpress-attachments/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [ricardocorbetta](https://wordpress.org/support/users/ricardocorbetta/)
 * (@ricardocorbetta)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277079)
 * The same happen to me. Anyone have another alternative?
 *  [lykos](https://wordpress.org/support/users/lykos/)
 * (@lykos)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277088)
 * I am experiencing the exact same issue and suspect it may have to do with WordPress
   3.5? Just a hunch.
 *  [ThemeCatcher](https://wordpress.org/support/users/themecatcher/)
 * (@themecatcher)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277089)
 * Add this code to an empty line in the file gd-bbpress-attachments/code/shared.
   php
 *     ```
       if (!function_exists('d4p_bbpress_version')) {
           /**
            * Get version of the bbPress.
            *
            * @param string $ret what version format to return: code or version
            * @return mixed version value
           */
           function d4p_bbpress_version($ret = 'code') {
               if (function_exists('bbpress')) {
                   $bbp = bbpress();
               } else {
                   global $bbp;
               }
   
               if (isset($bbp->version)) {
                   if ($ret == 'code') {
                       return substr(str_replace('.', '', $bbp->version), 0, 2);
                   } else {
                       return $bbp->version;
                   }
               }
   
               return null;
           }
       }
       ```
   
 *  [chetan0412](https://wordpress.org/support/users/chetan0412/)
 * (@chetan0412)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277093)
 * heeyyyy
 * thanks ThemeCatcher
 * now its working….
 *  [kraigg](https://wordpress.org/support/users/kraigg/)
 * (@kraigg)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277112)
 * I’ve added the code above to the /code/share.php file, but now I receive the 
   following error:
    “Fatal error: Call to undefined function d4p_bbpress_get_user_roles()
   in …/wp-content/plugins/gd-bbpress-attachments/code/admin.php on line 128.”
 * I’m still not able to get into the settings page. Is there a way to fix this?
 *  [Casyi](https://wordpress.org/support/users/casyi/)
 * (@casyi)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277116)
 * I’m getting the same error as the user above. Please help us out? I’d like to
   use this plugin.
 *  [Christopher Harris](https://wordpress.org/support/users/revrevwine/)
 * (@revrevwine)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277127)
 * [@themecatcher](https://wordpress.org/support/users/themecatcher/)
 * Thanks. I was having the same problem and your code saved the day!
 *  [Kevin Ryman](https://wordpress.org/support/users/kevinryman/)
 * (@kevinryman)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277139)
 * [@themecatcher](https://wordpress.org/support/users/themecatcher/)
 * Thanks for the quick fix, it works for me!
 *  [Maruti Mohanty](https://wordpress.org/support/users/marutim/)
 * (@marutim)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277140)
 * I too now get the fatal error PHP Fatal error: Call to undefined function bbp_get_dynamic_roles()
   in …/wp-content/plugins/gd-bbpress-attachments/code/shared.php on line 57
 * and the reason is the function bbp_get_dynamic_roles() is missing from the GD
   bbPress Attachments plugin..
 * Any Help will be highly appreciated.
 *  Plugin Author [Milan Petrovic](https://wordpress.org/support/users/gdragon/)
 * (@gdragon)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277142)
 * Fixed all now. Sorry for the problem.
 *  [Kevin Ryman](https://wordpress.org/support/users/kevinryman/)
 * (@kevinryman)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277143)
 * **Thank you, Milan!** I just updated the plugin on my site, _I appreciate it!_
 *  [kraigg](https://wordpress.org/support/users/kraigg/)
 * (@kraigg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277144)
 * Thank you Milan, the new update has fixed the problem!
 *  [Maruti Mohanty](https://wordpress.org/support/users/marutim/)
 * (@marutim)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277145)
 * Thanks [@milan](https://wordpress.org/support/users/milan/) it worked 🙂

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘undefined function d4p_bbpress_version()’ is closed to new replies.

 * ![](https://ps.w.org/gd-bbpress-attachments/assets/icon.svg?rev=2889154)
 * [GD bbPress Attachments](https://wordpress.org/plugins/gd-bbpress-attachments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gd-bbpress-attachments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gd-bbpress-attachments/)
 * [Active Topics](https://wordpress.org/support/plugin/gd-bbpress-attachments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gd-bbpress-attachments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gd-bbpress-attachments/reviews/)

 * 13 replies
 * 11 participants
 * Last reply from: [Maruti Mohanty](https://wordpress.org/support/users/marutim/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/undefined-function-d4p_bbpress_version/#post-3277145)
 * Status: resolved