Using hooks data inside MB_Frontend_Post

Support MB Frontend Submission Using hooks data inside MB_Frontend_Post

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7088
    flowdeeflowdee
    Participant

    Hey Anh Tran,

    you're providing several hooks inside the MB_Frontend_Post class which are basically fine. But I've got the following problem:

    With this hooks you're passing $data (the instance of the class itself), but due to the fact that all functions and variables are private, I can't access theme when applying filter/action.

    In my current case, I want use rwmb_frontend_after_save_post in order to redirect to the post after updating it. Therefore I could make us of the var $post_id which holds the ID, but as I said, it's not accessible:

    PHP Fatal error: Uncaught Error: Cannot access private property MB_Frontend_Post::$post_id

    I there a trick I'm not aware of?

    Thanks,
    Florian

    #7093
    Anh TranAnh Tran
    Keymaster

    Hi Florian,

    Thanks for your comment. I didn’t think about this, just thougth $this is enough. I’ve just released new version 1.0.2 with these properties public. Please update.

    #7096
    flowdeeflowdee
    Participant

    Thanks, this helps!

    PS: I think the more perfect way would be to add getter methods, but it's fine for me too.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Using hooks data inside MB_Frontend_Post’ is closed to new replies.