Change Post Title Label for Particular Frontend Form?

Support MB Frontend Submission Change Post Title Label for Particular Frontend Form?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9442
    thomastran40thomastran40
    Participant

    How do I get this to work for a particular front-end form only? It currently works as it should but I believe all forms will have this filter.

    add_filter( 'rwmb_frontend_post_title', function( $field ) {
            $field['required'] = true;
            $field['name'] = 'Website Name:';
            return $field;
    } );

    I was thinking the following conditional would work but it comes up empty.

    if ( 'websites' === $config['id'] ) {
    }
    #9447
    Truong GiangTruong Giang
    Participant

    Hi there,

    I didn't get fully your problem. Can you describe more detail again?
    Thanks.

    #9476
    thomastran40thomastran40
    Participant

    This changes the particular post title label name on the form which defaults to "Title"

    I figured it out with the following.

    add_filter( 'rwmb_frontend_post_title', function( $field ) {
    if ( is_page( "Add a Website" ) ) {
        $field['required'] = true;
        $field['name'] = 'Website Name:';
        return $field;
    }
    } );  
    
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Change Post Title Label for Particular Frontend Form?’ is closed to new replies.