Custom Fields
Re-Envisioned
Support MB Frontend Submission Using hooks data inside MB_Frontend_Post

  • Creator
    Topic
  • #7088
    flowdee
    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #7093
    Anh 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
    flowdee
    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 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using hooks data inside MB_Frontend_Post’ is closed to new replies.