WordPress.org

Forums

Achievements for WordPress
[resolved] Just no getting it! (4 posts)

  1. rboord
    Member
    Posted 1 year ago #

    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/

  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

    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.

  3. rboord
    Member
    Posted 1 year ago #

    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.

  4. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Achievements for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic