• Resolved ajuliano

    (@ajuliano)


    Hi,

    I am trying to have the account checkbox checked by default.

    I tried this, but that’s not working. Is there a way to make it work?

    add_filter( "adverts_form_load", "customize_adverts_add", 10, 2 );
    
    function customize_adverts_add( $form ) {
      if( $form['name'] != "advert" ) {
        return $form;
      }
    
      foreach( $form["field"] as $key => $field ) {
        if( $field["name"] == "_adverts_account" ) {
           $form["field"][$key]["attr"] = array( 'checked' => 'checked' );  
        }
      }
    
      return $form;
    }

    Thank you!

Viewing 1 replies (of 1 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi, i am afraid it is not really possible to change the Account checkbox state right now, at least not without modifying original WPAdverts source code.
    `

Viewing 1 replies (of 1 total)
  • The topic ‘Make _adverts_account checked by default’ is closed to new replies.