Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Marcel Pol

    (@mpol)

    Hi, I am sorry, but I am not planning on adding this feature. There is an edit link on the frontend, that leads to the editor.
    I don’t think admin_replies are used that much that I want to add a second form to the frontend.

    Thread Starter porumbesku

    (@porumbesku)

    Ok , Thank you anyway for your answer !

    Thread Starter porumbesku

    (@porumbesku)

    Hello again ! I have one more question or maybe request …
    Can you pls tell me how can i edit the plugin or maybe adding a function , that after you edit a post as an admin and the plugin redirects you to the wp Edit guest book entry , wen you are done and click to save the edited entry – to automatically redirect you back to the guestbook page , not remaining in the wp entry editor ?
    Thank you in advance !

    Plugin Author Marcel Pol

    (@mpol)

    Hi, in current development verion two hooks were added.
    However, for your purpose only the frontend hook will work. The admin hook saves the guestbook entry after sending headers to the browser, so a redirect is impossible there.

    function my_gwolle_gb_save_entry_admin( $entry ) {
    	$book_id = (int) $entry->get_book_id();
    	if ( $book_id == 0 ) {
    		$book_id = 1;
    	}
    	$post_id = gwolle_gb_get_postid( $book_id );
    	if ( $post_id ) {
    		// this redirect doesn't work, since the headers were already sent.
    		wp_redirect( get_permalink( $post_id ) );
    		exit;
    	}
    }
    add_action( 'gwolle_gb_save_entry_admin', 'my_gwolle_gb_save_entry_admin' );
    
    function my_gwolle_gb_save_entry_frontend( $entry ) {
    	if ( current_user_can( 'moderate_comments' ) ) {
    		wp_redirect( admin_url('admin.php?page=' . GWOLLE_GB_FOLDER . '/editor.php&entry_id=' . $entry->get_id() ) );
    		exit;
    	}
    }
    add_action( 'gwolle_gb_save_entry_frontend', 'my_gwolle_gb_save_entry_frontend' );

    Thread Starter porumbesku

    (@porumbesku)

    Hi . Thanks for answer !
    But where i need to put this code ?

    Plugin Author Marcel Pol

    (@mpol)

    You can add it to functions.php of your theme, or put it in your own plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Reply Button on guetbook page’ is closed to new replies.