Allow Users To Post Ads [adverts_add]

Posted in: Getting Started

Usually you will want to allow your visitors to post ads, without accessing wp-admin panel, you can do so using [adverts_add] shortcode.

In order to do that go to wp-admin / Pages panel click Add New button or select one of existing pages and inside its content add [adverts_add] code and publish or save it.

Now click “view page” link, the page content should look similarly as on the screenshot below:

adverts-add

Shortcode Parameters

  • name: string (default “default”) – this is mainly for future use, the name basically should identify shortcode.
  • moderate: int (default 0) – setting value for this parameter to 1 will enable moderation, this means that all ads posted will not be published until administrator will approve them
  • requires: string (default null) – required capability post an Ad, for example, if you want any registered user to post Ads set the value to “read” (since 1.1.5).
  • requires_error: string (default null) – custom error message displayed when user does not have required capability (since 1.1.5).

Example Usage

Add classified form with moderation enabled.

[adverts_add moderate="1"]

Allow only users with Editor or higher to post Ads

[adverts_add requires="edit_pages" requires_error="Only Editors can post Ads."]