Installing the plugin

Installing the plugin is very simple as you normally do.

  1. Go to your WordPress plugins area, click Add New
  2. Locate your plugins Zip file and click install.

If you are using FTP to transfer your files to your server. Then just unzip the plugin and upload wp-user-frontend-pro directory to your /wp-content/plugins/ directory.


Quick Setting Up the Plugin

Usage

Creating Post forms:

Creating post forms is easy.

  1. Go to the first menu Forms from the top level menu in the sidebar User Frontend.
  2. You can create new forms just you would create posts in WordPress.
  3. Give your form a name and click on Form Elements on the right sidebar.
  4. The form elements will be appeared to the Form Editor tab with some options.

Form Elements:

  1. Required: If you want to make this input area a required field, select yes or no if you don’t.
  2. Field Label: Give your element a name. e.g. If it’s a post title, may be give the name Post Title
  3. Help Text: If you want to give some help assistance to your user about this input type, type some texts. May be add some texts about what do you expect from the user as a input.
  4. CSS Class Name: If you want to add a CSS class to your form element, you can add a name. This class name will be added to the <li> of the input element.
  5. Placeholder Text: A nice new feature of HTML5, you can give your users a assistive text about the input field.
  6. Default Value: If you want the form input should be auto populated with default value, you can add that here.
  7. Size: The width of a input text element.

Showing forms in a page:

After you create a form, you get a shortcode like this: [wpuf_form id="2541"], inserting this shortcode to a page will show the form

Registration Forms

You can create as many registration forms as you want and assign them in to different user roles.

Creating Registration Form

Creating Registration forms is easy.

  1. Go to the User Frontend Menu Then Registration Forms from the sidebar
  2. You can create new forms just you would create posts in WordPress.
  3. Give your form a name and click on Form Elements on the right sidebar.
  4. The form elements will be appeared to the Form Editor tab with some options.
  5. From settings Options you can –
      • Assign New User Roles
      • Can redirect to any custom page or same page with successful message

    WP User Frontend PRO Registration

Showing Registration Form

    1. By using short-code you can show your registration form into any page or post
    2. You will get different short-codes for each registration forms separately.

registration short-codes

More that one Registration Forms in same page ?

User Dashboard

A user can see all his posts in his dashboard. To show the dashboard, create a page, for example Dashboard and insert the shortcode [wpuf_dashboard]. All the post post type will be shown for the logged in user.

If you want to display a specific post type, you need to mention that. For example, if you want list event instead of post, you can use [wpuf_dashboard post_type="event"].

To configure how many posts will be displayed in a page, you can configure the settings at Settings > Dashboard > Posts per page. There are other settings also for dashboard.

  • You can show the user bio in dashboard
  • Show the count of posts.
  • Show featured image and set the size to display.

Post Editing

A user can edit his/her posts from frontend. To setup the options, follow the instructions:

  1. Create a page, for example: Edit.
  2. Insert the shortcode [wpuf_edit] in the page.
  3. Go to plugin Settings > General Options > Edit Page. Select the page your just created which contains the shortcode [wpuf_edit]

Showing Meta Fields

Individual Meta:

If you want to show individual post meta values in your post, you can use the shortcode [wpuf-meta name="your_meta_key"]. There are some combinations for this shortcode. You can show your files, images, map and multicolumn repeatable field.

  • Simple Fields (text, textarea, select, checkbox, etc.): [wpuf-meta name="meta_key_name"]
  • Google Map: [wpuf-meta name="meta_key_name" type="map"]
    • You can pass other parameters here. Like, height, width and zoom. Example: [wpuf-meta name="meta_key_name" type="map" height="250" width="450" zoom="12"]
  • Uploaded Image: [wpuf-meta name="meta_key_name" type="image"]
  • Uploaded File: [wpuf-meta name="meta_key_name" type="file"]
  • Multicolumn Repat: [wpuf-meta name="meta_key_name" type="repeat"]

Global Option:

There is also an global option display all the meta fields in your posts. Turning on the “Settings > General Options > Custom Fields in post” option will show all your posts custom fields in every post.

Showing fields in the theme:

There are situations where you will not find these solutions useful based on your requirement. Thats the time when you need to customise your theme. If you want to show the custom fields in your post post type, then most of the time single.php from your theme shows the post. If you have a custom post type product, then single-product.php is responsible to show that post, if you don’t find that file in your theme, then single.php is handling that job. If you want to display a custom field address, then this code will show that. You can show text, textarea, dropdown, date, radio etc. type custom fields with the single line code below:

<?php echo get_post_meta( $post->ID, 'address', true ); ?>

Image or File: If you have a image or file type custom field, then you can show them like this code below. Here we are showing the image thumbnail and linking the image to the full size image.

$images = get_post_meta( $post->ID, 'mey_key_name' );

if ( $images ) {
    foreach ( $images as $attachment_id ) {
        $thumb = wp_get_attachment_image( $attachment_id, 'thumbnail' );
        $full_size = wp_get_attachment_url( $attachment_id );

        printf( '<a href="%s">%s</a>', $full_size, $thumb );
    }
}

Google Map: If you have a custom field named location, you can show the map with this code:

<?php echo wpuf_shortcode_map( 'location', $post->ID ); ?>

Single Column Repeat: If you have a single column repeatable field with meta key repeat, we can show them in an unordered list like this:

$repeat_field = get_post_meta( $post->ID, 'repeat', true );

if ( $repeat_field ) {
    $values = explode( '| ', $repeat_field );

    echo '<ul>';
    foreach ($values as $value) {
        echo "<li>Value: $value</li>";
    }
    echo '</ul>';
}

Multi Column Repat: If you have a multi column repeatable field with meta key multi_repeat and column Name and Email, we can show them in an unordered list like this:

$repeat_field = get_post_meta( $post->ID, 'multi_repeat' );

if ( $repeat_field ) {
    echo '<ul>';
    foreach ($repeat_field as $field) {
        $values = explode( '| ', $field );
        echo "<li>Name: {$values[0]}, E-Mail: {$values[1]}</li>";
    }
    echo '</ul>';
}

Guest Post

Users can now post in your site without registering themeselves. You can enable guest posting by going a forms “Post Settings > Enable Guest Post“.

Auto user registration

Users can submit post without registration, but you can auto register themselves by enabling “Require Name and Email address“. That way, users will need to provide their Name and E-mail address. Upon providing their details, they will be auto registered in your site as a user. Their email address will be used to generate username, if a user already exists with the same username, a random number will be appended to their username. If a user already exists with the same e-mail address, the post will assign to that existing user.

Subscription & Payment

Post subscription and payment system is a module where you can add paid posting system with WP User Frontend. You can introduce two types of payment system. Pay per post and subscription pack based.

Pay Per Post:

With this you can introduce pay per post feature where users pay to publish their posts each post. When pay per post is enabled from “Settings > Payments > Charge for posting“, users see a notice right before the post creation form in frontend about payment. When the submits a post, the post status gets pending and he is redirected to the payment page (to setup the payment page, create a Page Payment and select the page at “Settings > Payments > Payment Page“. No shortcode is needed). Currently by default PayPal is only supported gateway. Upon selecting PayPal, he is redirected to PayPal for payment. After successful payment he is redirected back to the site and the post gets published.

Subscription Pack:

There is an another option for charged posting. With this feature, you can create unlimited subscription pack. In each pack, you can configure the number of posts, validity date and the cost.

When a user buys a subscription package, he gets to create some posts (e.g. 10) in X days (e.g: 30 days). If he crosses the number of posts or the validity date, he can’t post again. You can force the user to buy a pack before posting “Settings > Payments > Force pack purchase“.

To show the subscription packs in a page, you can use the shortcode: [wpuf_sub_pack]. To show the user subscription info: [wpuf_sub_info]. The info will show the user about his pack left post cound and expiration date of his pack

Payment Gateway:

Currently only PayPal basic gateway is supported. The plugin is extension aware, that means other gateways can be integrated.

Developer Documentation

There are some actions and filters provided for developers to extend the functionalities.

1. Action Hook Field

There is an element on the Form Elements called Action Hook. This is a great addition for developers to extend the form as they want. It’s a placeholder for creating their own hook where they could bind their functions and generate their own dynamic element.

Usage:

add_action('HOOK_NAME', 'your_function_name', 10, 3 );
function your_function_name( $form_id, $post_id, $form_settings ) {
    // do what ever you want
}

Parameters:

  • $form_id : (integer) The ID of the form
  • $post_id : NULL or (integer) the ID of the post. When creating a new post, the parameter becomes NULL. When editing a post, you get the edited post ID as the parameter
  • $form_settings : (array) An array of form settings

Example:

Here we have added a new action hook field called my_brand_new_hook and saving our field informations in a meta key named your_meta_key. We are adding the field into the form with the your_function_name function and updating the form value with update_my_brand_new_hook

/**
 * Add the input field to the form
 *
 * @param int $form_id
 * @param null|int $post_id
 * @param array $form_settings
 */
function your_function_name( $form_id, $post_id, $form_settings ) {
    $value = '';

    if ( $post_id ) {
        $value = get_post_meta( $post_id, 'your_meta_key', true );
    }
    ?>

    <div class="wpuf-label">
        <label>A demo field</label>
    </div>

    <div class="wpuf-fields">
        <input type="text" name="my_custom_field" value="<?php echo esc_attr( $value ); ?>">
    </div>
    <?php
}

add_action( 'my_brand_new_hook', 'your_function_name', 10, 3 );

/**
 * Update the custom field when the form submits
 *
 * @param type $post_id
 */
function update_my_brand_new_hook( $post_id ) {
    if ( isset( $_POST['my_custom_field'] ) ) {
        update_post_meta( $post_id, 'your_meta_key', $_POST['my_custom_field'] );
    }
}

add_action( 'wpuf_add_post_after_insert', 'update_my_brand_new_hook' );
add_action( 'wpuf_edit_post_after_update', 'update_my_brand_new_hook' );

2. Actions

WP User Frontend comes with some actions by default.

Post Add


  • wpuf_add_post_form_top
    • Called at top of the form. 2 parameters: $form_id (integer), $form_settings (array)
  • wpuf_add_post_form_bottom
    • Called at bottom of the form. Accepts 2 parameters. $form_id (integer), $form_settings (array)
  • wpuf_add_post_after_insert
    • Runs after inserting a post and updating the meta tags. Accepts 4 parameters. $post_id (integer), $form_id (integer), $form_settings (array), $form_vars (array);

Post Edit


  • wpuf_edit_post_form_top
    • Called at top of the form. 2 parameters: $form_id (integer), $form_settings (array)
  • wpuf_edit_post_form_bottom
    • Called at bottom of the form. Accepts 2 parameters. $form_id (integer), $form_settings (array)
  • wpuf_edit_post_after_update
    • Runs after updating a post and updating the meta tags. Accepts 4 parameters. $post_id (integer), $form_id (integer), $form_settings (array), $form_vars (array);

Dashboard


  • wpuf_dashboard_top
    • Called at top of the dashboard listing. Accpets 2 parameters. $user_id, $post_type
  • wpuf_dashboard_nopost
    • Called when no post found. Accpets 2 parameters. $user_id, $post_type;
  • wpuf_dashboard_bottom
    • Called at bottom of the dashboard listing. Accpets 2 parameters. $user_id, $post_type

User Profile Update


  • wpuf_update_profile
    • Runs after profile update. Accepts 3 parameters: $user_id(int), $form_id(int), $form_settings(array)

User Registration


  • wpuf_after_register
    • Runs after a user registration. Accepts 4 parameters: $user_id(int), $userdata(array), $form_id(int), $form_settings(array)

Admin Panel


  • wpuf_admin_menu
  • wpuf_post_form_tab
  • wpuf_post_form_tab_content
  • wpuf_profile_form_tab
  • wpuf_profile_form_tab_content
  • wpuf_form_buttons_post
  • wpuf_form_buttons_custom
  • wpuf_form_buttons_other
  • wpuf_form_buttons_user

3. Filters

Add/Edit Post


  • wpuf_add_post_args: Runs before inserting a new post via wp_insert_post(). Params: $postarr (array), $form_id (integer), $form_settings (array), $form_vars (array)
  • wpuf_update_post_args: Runs before updating a post via wp_update_post(). Params: $postarr (array), $form_id (integer), $form_settings (array), $form_vars (array)
  • wpuf_add_post_redirect: Runs when the new post is created, custom fields are updated and the ajax request is sending back the post redirection parameters. Params: $response (array), $post_id (integer), $form_id (integer), $form_settings (array)
  • wpuf_edit_post_redirect: Runs when the post is updated, custom fields are updated and the ajax request is sending back the post redirection parameters. Params: $response (array), $post_id (integer), $form_id (integer), $form_settings (array)

Post Permission


  • wpuf_can_post: Control if a user can submit a post. yes permits the user to create a new post, no prevents a user from creating a post.
  • wpuf_addpost_notice: You can return a string to show a notice to the top of post creation form.

Profile


  • wpuf_update_profile_vars: Runs the filter just before updating the user profile via wp_update_user() function. Params: $userdata (array), $form_id (integer), $form_settings (array)
  • wpuf_update_profile_resp: Runs when the user profile is updated and the ajax request is sending back the redirection parameters. Params: $response (array), $user_id (integer), $form_id (integer), $form_settings (array)

Dashboard

  • wpuf_no_image: return the URL of an image if the featured image of a post is not found.

User Registration


  • wpuf_register_user_args
    • Runs just before updating the user profile via wp_update_user after register. Accepts 1 parameter: $userdata(array)

Settings


  • wpuf_settings_sections: Sections of settings
  • wpuf_options_payment: Payment tabs settings options
  • wpuf_options_dashboard: Dashboard tabs settings options
  • wpuf_options_others: Other tabs settings options
  • wpuf_settings_fields: All the settings options

Payment Gateways


  • wpuf_payment_gateways: Returns all the registered payment gateways.

How To

Plugin Integration

Pronamic Google Maps

If you like Pronamic Google Maps and want to use along with WP User Frontend PRO, then there is a solution. You can still use the WP User Frontend’s Google Map custom field and using the function below, that would also update the pronamic plugins google map latitude and longitude and will work seamlessly.

function wpuf_pronamic_location( $post_id ) {
    $custom_field = 'address';

    if ( !class_exists('Pronamic_Google_Maps_Post') ) {
        return;
    }

    if ( isset( $_POST[$custom_field] ) ) {
        $address = $_POST[$custom_field];

        list( $def_lat, $def_long ) = explode( ',', $address );

        if ( $def_lat ) {
            update_post_meta( $post_id, Pronamic_Google_Maps_Post::META_KEY_LATITUDE, $def_lat );
        }

        if ( $def_long ) {
            update_post_meta( $post_id, Pronamic_Google_Maps_Post::META_KEY_LONGITUDE, $def_long );
        }

        if ( $def_lat && $def_long ) {
            update_post_meta( $post_id, Pronamic_Google_Maps_Post::META_KEY_ACTIVE, true );
        }
    }
}

add_action( 'wpuf_add_post_after_insert', 'wpuf_pronamic_location' );
add_action( 'wpuf_edit_post_after_update', 'wpuf_pronamic_location' );

Good Writer Checkify

function gwc_add_post( $form_id, $post_id ) {

    if (!$post_id) {
        $post = new stdClass;
        $post->ID = 0;
        $post->post_title = '';
        $post = new WP_Post( $post );
    } else {
        $post = get_post( $post_id );
    }

    Good_Writer_Checkify_Options::gwc_print_div_carousel( $post );
}

add_action( 'wpuf_add_post_form_bottom', 'gwc_add_post', 10, 2 );
add_action( 'wpuf_edit_post_form_bottom', 'gwc_add_post', 10, 2 );

FAQ

Q. I get the message: “I don’t know how to edit this post, I don’t have the form ID”

Ans: When you create a post with the new version of WP User Frontend, a form ID is being attached to that post. It’s needed because you might have 10 forms and it doesn’t know which form should be used to edit that post.

For this problem with older posts, one thing you need to do. If you go the those posts edit screen in backend, you’ll see a meta box “WPUF Form”, select the form that should be used to edit the form.

Q. Where does the user registration and profile information saves?

Ans: It’s just the standard user meta fields. They are saved with meta_key you provide. You can pull the informations by this: <?php echo get_user_meta( $user_id, 'meta_key', true ); ?>

Q. How do I show the images/files in my theme?

Ans: Just use this snippet:

$images = get_post_meta( $post->ID, 'mey_key_name' );

if ($images) {
    foreach ($images as $attachment_id) {
        $thumb = wp_get_attachment_image( $attachment_id, 'thumbnail' );
        $full_size = wp_get_attachment_url( $attachment_id );

        printf( '<a href="%s">%s</a>', $full_size, $thumb );
    }
}

Q. What if I buy the personal package and use it on unlimited site?

Ans: You can do that, we’ll not restrict you to use it on several sites. But depending on the package you purchase, you are given a license code. The license code is neccessary for to receive auto updates and support. If you use it on multiple sites, you’ll not receive any further updates and support.

Q. Whats the facility of the developer package?

Ans: Using the developer package, you can use it on unlimited sites, priority support and free add-ons.

Q. Whats the license of WP User Frontend PRO?

Ans: We are using the same licensing policy as WordPress offers, GPLv2 (or later).

Q. What happens after 1 year period?

Ans: You are buying the plugin with 1 year free support and updates. After 1 year, depending on your purchased package, to get update and support again, you’ve to renew your license each year. The renewal fee for personal package is $29, business: $49 and developer license is $79.

How to update plugin

To get update automatically like regular WordPress plugin, you have to insert your License key and email address under User Frontend -> Updates

Check image bellow:
Screen Shot 2013-05-24 at 9.43.02 PM

Now you will get notifications for plugin updates whenever next version released and you can update your plugin by one click.

Changelog

= version 2.2.3 =

date: 12 July, 2014

 * [fix] paypal live endpoint url fix
 * [fix] data saving problem caused many issue. removed `esc_sql`
 * [fix] form duplication fix
 * [fix] Email confirmation bug fix
 * [improve] login message filter before login form added
 * [new] Show/hide admin bar based on dashboard access permission

= version 2.2.2 =

date: 5 July, 2014

* [fix] Fixed conditional logic on taxonomies
* [fix] Checkbox and radio value fix
* [fix] Slashing quote problem

= version 2.2.1 =

date: 2 July, 2014

* [fix] Dashboard post editing was broken
* [fix] "No Image" on dashboard link was broken
* [fix] Plugin upgrade routine on plugins_loaded


= version 2.2 =

date: 1 July, 2014

* [new] Conditional logic
* [new] Recurring subscription
* [new] Login form using shortcode
* [new] Coupon on subscription
* [new] Email confirmation
* [new] Export/import feature
* [new] Auto page and form creator
* [new] Disable subscription on forms
* [new] Author email, author bio and attachment url on post email notification
* [new] User registration using subscription packs
* [new] Pay per post feature for guests
* [improve] Subscription feature
* [improve] Form builder UI


= version 2.1.10 =

date: 24 May, 2014

 * [fix] Password meter fix
 * [fix] Insert Photo 3.9 compatibility fix on tinyMCE
 * [fix] Multiple duplicated form elements on the editor
 * [fix] Password repeat bug fix when no repeat field is there

= version 2.1.9 =

date: 9 January, 2014

 * [fix] PayPal payment problem fixed.
 * [updated] New version of Settings API class

= version 2.1.8 =

date: 18 September, 2013

 * [new] associate uploaded images to post area
 * [new] tags autocomplete 
 * [new] default post form assignment
 * [new] taxonomy exclude/include/child_of feature
 * [new] free subscription option
 * [new] new edit post status "No Change"
 * [new] delete transaction option
 * [new] signup page override redirection
 * [new] insert photo: image size selection
 * [new] insert photo: type of image selection
 * [new] "pending" post edit enable/disable option

= version 2.1.6 =

date: 22 June, 2013

* [fix] rich textarea post draft bug fix
* [fix] checkbox help text was left out
* [fix] help text for radio field
* [improve] map short code updated and separated to user and post map functions
* [new] non hierarchical taxonomy update support
* [new] theme my login custom email notification action hook fire
* [new] wp cli compatibility
* [new] hidden custom field
* [new] custom taxonomy text input field type added

= version 2.1.5 =

date: 22 May, 2013

* [fix] Comment form fix in dashboard
* [fix] Google map fix in admin edit post area
* [fix] insufficient arguments in admin profile area
* [fix] feature image delete bug in edit post area
* [improve] multisite license notice fix
* [new] dashboard unauthorized message
* [new] not logged in message in user profile form
* [improve] updated language file


= version 2.1.4 =

date: 27 April, 2013

* [bugfix] edit post permission checking
* [bugfix] WYSIWYG Text cut off after using "&"
* [improve] user avatar image url changed from relative to full url. fixes multisite bug
* [improve] `wpuf_can_post` filter gets more parameters
* [improve] repeatable fields separator changed from comma(,) to pipe(|)
* [improve] featured image in dashboard is now linked to posts
* [new] google map autocomplete address feature
* [new] file links added in admin panel post edit custom fields area
* [new] payment gateway bank added
* [new] validation filter added on new/edit post: `wpuf_update_post_validate`, `wpuf_add_post_validate`
* [new] private post status added on dashboard query
* [new] dashboard table hooks added: wpuf_dashboard_head_col, wpuf_dashboard_row_col
* [new] post draft option added. posts now can set to draft for later usage
* [new] default post category option
* [new] dashboard query filter added: `wpuf_dashboard_query`
* [new] teeny rich textarea added

= version 2.1.3 =

date: 18 April, 2013

* [bugfix] comment issue fixed
* [bugfix] date issue fixed
* [bugfix] post author changed
* [new] taxonomy ORDER option
* [new] taxonomy ORDER BY option.
* [new] post format support
* [new] user registration filter
* [new] user registration after filter
* [update] file upload size changed to KiloByte

= version 2.1.2 =

date: 5 April, 2013

* [bugfix] post edit area captcha fix
* [bugifx] Featured default image path fix
* [new] Show post status filter added
* [new] Dashboard query filter added
* [improve] *From* typo fix in editor
* [improve] It won't slow down your site now.

= version 2.1.1 =

date: 23 March, 2013

* [bugfix] License check bug fix

= version 2.1 =

date: 22 March, 2013

* Subscription feature put back
* Auto update feature