• Resolved jemigirl

    (@jemigirl)


    Hi Greg,

    I would like to know if I can add a category from the enhanced media library to an image uploaded with the classifieds plugins automatically. My goal is to be able to quickly filter images that were uploaded through the plugin in the media library using Enhanced Media Library categories.

    Tbanks,
    Julie

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

    (@gwin)

    Hi, currently this is not really possible i am afraid, at least not without modifying the original WPAdverts source code.

    In the next release i will introduce an additional filter in the file upload and then it will be possible to automatically set a category for uploaded files.

    I created a ticket for this issue at GitHub https://github.com/simpliko/wpadverts/issues/62

    Thread Starter jemigirl

    (@jemigirl)

    That’s great. We will probably be purchasing the full version soon and look forward to getting the updates. Is there also a way that we can make it required to choose a category when an ad is created?

    Thanks!
    Julie

    Plugin Author Greg Winiarski

    (@gwin)

    Yes, it is possible, you can do it either using Custom Fields extension or by adding the code below in your theme functions.php file

    
    add_filter( "adverts_form_load", "_adverts_add_category_required" );
    function _adverts_add_category_required( $form ) {
      if( $form['name'] != "advert" ) {
        return $form;
      }
      foreach( $form["field"] as $key => $field ) {
        if( $field["name"] == "advert_category" ) {
            $form["field"][$key]["is_required"] = true;
            $form["field"][$key]["validator"][] = array( "name" => "is_required" );
        }
      }
      return $form;
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘enhanced media library’ is closed to new replies.