Support Forum ยป User Profile

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Dynamic population editable by post author only #10701
    Orice Media SRLOrice Media SRL
    Participant

    I managed to do it the following way.
    Create a page template with the following code inside it.

    <?php
    get_header();
    
    $post_id = isset( $_GET['id'] ) ? absint( $_GET['id'] ) : 0;
    
    if( $post_id ){
        $post = get_post( $post_id );
        if( ( 'your_post_type' == $post->post_type && get_current_user_id() == $post->post_author ) || current_user_can( 'manage_options' ) ){
            echo do_shortcode( '[mb_frontend_form post_id="' . $post_id . '"]' );
        } // endif; is current user
    } // endif; we have a post id
    
    get_footer();

    Hope it helps someone.

    in reply to: Dynamic population editable by post author only #10700
    Orice Media SRLOrice Media SRL
    Participant

    I have tried it with this filter, but the headers are already sent so I can't do a redirect in case the user isn't the author of the post. What hook could I use?

    in reply to: Unable to exclude metabox field with MB Include Exclude #10697
    Orice Media SRLOrice Media SRL
    Participant

    Thank you, but I found another way to do it. By creating 2 boxes, one for frontend and the other for backend only.

Viewing 3 posts - 1 through 3 (of 3 total)