WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Just no getting it!

[Resolved] Just no getting it!

  • Hi! I’m a web designer, not so much a developer, but I can dabble a bit.

    I’ve followed the tutorials from yourself and other users on how to hook into custom events that trigger awards.

    My real issue is not with your app, but rather that I can’t get my custom action to work.

    Class Function:

    $this->actions = array(
    'ralcorInvite-run' => __( 'A player invites a fan.', 'dpa' ),
    );

    Where the action is:

    foreach ( $friends as $key => $friend )
    $mail = wp_mail( $email, invfr_tokens_replacement( $subject, $_POST, $key ), invfr_tokens_replacement( $message, $_POST, $key ), invfr_tokens_replacement( $headers, $_POST, $key ) );
    
    do_action('ralcorInvite-run');
    if( $mail )
    echo 'sent';
    }

    Everything from the plugin I’m trying to nest the action into is working, but is not triggering the action, and not awarding the achievement. It’s not tied to any actual function, it’s just trying to do the action.

    Apologies, as PHP is not easy for me.

    Any help would be appreciated. Thank you very much.

    http://wordpress.org/plugins/achievements/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Paul Gibbs

    @djpaul

    BuddyPress Lead Developer

    Hi rboord,

    Can you share your entire file where you’ve built the custom extension? Maybe upload to pastebin.com or similar. Need to understand how and what’s being loaded.

    Hey! I figured it out!

    I was using do_action without having any functions to support the call. Making a dummy loop of add/do actions made it work properly.

    So, like I said, it wasn’t your plugin, it was my shotty attempt at customizing it that was the problem.

    Thank you, this app is excellent.

    Plugin Author Paul Gibbs

    @djpaul

    BuddyPress Lead Developer

    Glad you got things working to your satisfaction! Thanks for using the plugin 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Just no getting it!’ is closed to new replies.