Support » Plugin: User Submitted Posts » Random url number, instead of sequential

Viewing 1 replies (of 1 total)
  • Plugin Author Jeff Starr

    (@specialk)

    By default, the plugin uses built-in WP functions to create a post slug based on the submitted post title. If the title is hidden on the form, then “User Submitted Posts” will be used by default. The concern here is that WP automatically appends a number to the post slug to keep it unique. Here is a possible workaround:

    Replace this line (in user-submitted-posts.php):

    $title = 'User Submitted Post';

    ..with this:

    $title = 'User Submitted Post' . ' ' . rand();

    This is applying your suggestion to append your own random string, so that the default post titles are unique, so no need for WP to append a number. You can customize the random string as needed:

    http://php.net/manual/en/function.rand.php

Viewing 1 replies (of 1 total)
  • The topic ‘Random url number, instead of sequential’ is closed to new replies.