Skip to:
Content
Pages
Categories
Search
Top
Bottom

problem using another plugin's class…

  • Avatar of Grosbouff
    grosbouff
    Participant

    @grosbouff

    I would like to adapt a WP plugin for BuddyPress. My BP plugin uses the WP plugin; which is contained inside a class “mapress”.

    The WP plugin fires it like this : $mappress = new mapress().

    But in my BP plugin, if I set $bp_mappress = new mapress();

    I got an error : Class ‘mappress’ not found.

    Why is the class not found ?

    Thanks !

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did you activate the plugin, and are you using it in the root blog?

    Avatar of Detective
    Detective
    Participant

    @detective

    Maybe your BP plugin is loaded before the WP plugin, and therefore the mapress class is undeclared. Perhaps it’s best for you to do the following:

    function init_my_plugin() { global $bp_mapress; $bp_mapress = new mapress; }
    add_action( 'plugins_loaded', 'init_my_plugin' );

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

You must be logged in to reply to this topic.