Support » Plugin: WPAdverts - Classifieds Plugin » Custom Slugs Snippet – Dead?

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

    (@gwin)

    Hi, it should work the same way as previously since the adverts_post_type filter is still there.

    Two changes you might want to apply is to change the function customize_adverts_post_type() to look like this

    
    function customize_adverts_post_type( $args, $type = null ) {
       if($type != "advert" ) {
           return $args;
       }
    
       if(!isset($args["rewrite"])) {
          $args["rewrite"] = array();
       }
       
       $args["rewrite"]["slug"] = "classified";
       return $args;
    }
    

    and line

    
    add_action("adverts_post_type", "customize_adverts_post_type");
    

    to

    
    add_action("adverts_post_type", "customize_adverts_post_type", 10, 2);
    

    Pare81, if you’re using Custom-Fields Plugin that could be causing the conflict.

    https://wordpress.org/support/topic/custom-slugs-php-custom-fields-conflict/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Slugs Snippet – Dead?’ is closed to new replies.