Support » Plugin: Gwolle Guestbook » Change form elements / publish e-mail address

  • fknisel

    (@fknisel)


    I want to change the description of some form elements (like “e-mail” or “name”) in my guestbook. How is this possible?

    Another question: Is it possible to publish automatically the e-mail specified in the entry? Because it’s necessary to contact other users, this would be very nice for a online swap meet.

    (Please simple implementations if possible.)

    The page I need help with: [log in to see the link]

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

    (@mpol)

    The first point is probably doable. But please take note that the formatting of the entry is built upon Name being Name :).
    There are filters included in this plugin, but your best bet might be the Say What plugin:
    https://wordpress.org/plugins/say-what/

    Alternatively you could look at the commercial add-on and use the option for meta fields.

    About email addresses, that has been asked before.
    You can add this code to the functions.php of your theme or you can add it to your own plugin if you want.

    function my_gwolle_gb_author_name_html( $author_name_html ) {
            // $author_name_html is a string
            $author_name = gwolle_gb_sanitize_output( trim( $entry->get_author_name() ) );
    
            // Registered User gets italic font-style
            $author_id = $entry->get_author_id();
            $is_moderator = gwolle_gb_is_moderator( $author_id );
            if ( $is_moderator ) {
                            $author_name_html = '<i>' . $author_name . '</i>';
            } else {
                            $author_name_html = $author_name;
            }
    
            // Link to author email.
            $author_email = trim( $entry->get_author_email() );
            if ($author_email) {
                            $author_name_html = '<a href="mailto:' . $author_email . '"
                                            title="Email ' . $author_name . '">' . $author_name_html . '</a>';
            }
    
            return $author_name_html;
    
    }
    add_filter( 'gwolle_gb_author_name_html', 'my_gwolle_gb_author_name_html', 10, 2 );

    Does that suffice, or do you want it in another way?

Viewing 1 replies (of 1 total)
  • The topic ‘Change form elements / publish e-mail address’ is closed to new replies.