• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Search for "short code"

Search Results for: short code

WP-Members User List

The WP-Members User List plugin allows you to display lists of users on your site. Default parameters can be set in the plugin settings, but custom list parameters can be passed through the shortcode which allows you to set up multiple lists with different parameters.

Features

The User List plugin allows you to create user directories and lists that can be used in a variety of different ways. It can be used for searchable user directories but it can also be used to display groups of users for other purposes.  It is initiated by shortcode and each shortcode instance can have different settings, so you are not limited to just the defaults that you create in the plugin’s settings. There is a (very) basic demo on the WP-Members Demo Site.

The output is also very flexible when using CSS. The demo also has some list instances that have completely custom output (the descriptions of how to implement those customizations are available on the support site).

Note that you do need to have WP-Members installed and activated, but you do not need to be using content restriction.

Get the Plugin

User List is a premium plugin available in the store.

Best Value: this plugin is included in the WP-Members Pro Bundle package.

  • Sale! Pro Bundle

    Pro Bundle

    From $125.00 / year
    Select options This product has multiple variants. The options may be chosen on the product page
  • User List

    User List

    From $49.00 / year
    Select options This product has multiple variants. The options may be chosen on the product page

Documentation

  • Installation
  • Settings
  • Display the List
  • Profile Page
  • Front-end Editing
  • Stylesheets
  • Filter Hooks
  • Tips and Tricks
  • Change Log
  • Manage license
  •  

    Display form rows in columns

    Chad Butler · Oct 19, 2018 ·

    This tutorial will address the common question, “How do I layout the form in columns?”

    Let me say that this tutorial is one of those that is a “guideline,” not an exact science. That is due to the number of different variables that cannot be controlled.  So for best chance of success, I recommend that you start with the basic process exactly as in the example. Try to reproduce that first so that you understand what it is doing before moving on to something complicated.

    The following is a discussion of the the exact code snippets that I used in this demo (which also uses the code snippets for assigning placeholders to the fields and removing labels).

    Continue Reading →

    wpmem_user_has_access()

    Description

    Checks if a user has access to a given membership product.

    Parameters

    $membership
    (mixed) (required) The meta key of the membership being checked, or an array of membership meta keys.

    $user_id
    (integer) (optional) The user ID to check. If no user ID is passed, it will check for the currently logged in user.

    Return Value

    boolean (true|false) Returns true if the user has access, otherwise false.

    Example

    /**
     * This example checks if the currently logged in user has
     * access to the "my-membership" restriction. The 
     * result will be a true|false boolean.
     */
    $has_access = wpmem_user_has_access( 'my-membership' );
     
     
    /**
     * This example is similar to the above, but it checks a
     * specific user by user ID contained in $user_id.
     */
    $has_access = wpmem_user_has_access( 'my-membership', $user_id ); 

    Notes

    If checking multiple memberships, pass an array of the membership meta keys (slugs).  If the user has current access to any of the memberships, the function will return true.

    Changelog

    Introduced in version 3.2.0
    Version 3.2.3 reversed the order of arguments.

    Source

    wpmem_user_has_access() is located in /includes/api/api-users.php.

    wpmem_set_user_product()

    Description

    Sets user access for a given product. (As of plugin version 3.4.2, use wpmem_set_user_membership() instead)

    Parameters

    $product
    (string) (required) The meta key of the product to set access for.

    $user_id
    (integer) (optional) The user ID to assign access to. If no user ID is passed, it will set the product for the currently logged in user.

    $date
    (string|date|boolean) (optional) The user’s expiration date for the product in either MySQL date format (YYYY-MM-DD 00:00:00) or simply YYYY-MM-DD. Default value is false and the expiration will be set from the current date.

    Return Value

    boolean (true|false) Returns true if setting the product was successful.

    Examples

    // Basic usage of how the function is applied:
    wpmem_set_user_product( $product_meta, $user_id, $date );
    
    
    /*
     * The practical example below will set a default
     * membership for a user when they register. In this
     * example, it will set access for 'my_basic_product'.
     * In a real world application, get the slug for the
     * membership you want to set at registration from the
     * Membership > All Products table.
     *
     * The example uses the 'wpmem_post_register_data'
     * action to apply the membership at registration.
     * @see: https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_post_register_data/ 
     */
    add_action( 'wpmem_post_register_data', 'my_set_basic_product' );
    function my_set_basic_product( $fields ) {
        
        // Defaults.
        $product_meta = 'my_basic_product';
        $user_id = $fields['ID'];
        
        // Set product access.
        wpmem_set_user_product( $product_meta, $user_id );
    }

    Changelog

    • Introduced in version 3.2.3
    • Added $date argument in version 3.2.6
    • As of version 3.4.2, use wpmem_set_user_membership() instead.

    Source

    wpmem_set_user_product() is located in /includes/api/api-users.php.

    Memberships

    Membershipsgive you the ability to define access to posts, pages, and other content based on whether the user has been assigned a specific membership.

    In WP-Members, “memberships” can fit a variety of applications based on your need.  In general, you can think of it as a defining tag that you can use to assign a user access to content.  If the user has a specific membership product they can access content set to require that membership product.

    Defining Memberships

    Memberships can be created and defined in the “Memberships” menu item.  You’ll need to have memberships enabled on the plugin’s main Options tab for this menu item to display.

    Creating a new membership is much like creating a post.  Just click the “Add New” button at the top.

    For a new membership, just enter a title.  The slug will be created automatically from the title.

    For additional documentation and detailed information on available properties, see Membership Properties.

    For documentation on how to set up “levels,” see Membership Levels.

    To edit a membership, click the title in the memberships table.  Selecting a membership will bring you to the membership editor screen (see the screenshot for Add New Product – it is the same screen when editing).

    Note that you cannot change the slug of a membership.

    Assigning Memberships to Content

    To set a post, page, or other content to require a membership to access, you can do this in the post editor.  In the upper right were the WP-Members post restriction meta box is, you will see the option to “Limit access to:” followed by a selector for memberships.  You can list a single membership or you can list multiple memberships.  In the case of multiple assigned memberships, the user will need to have a current and valid membership for one of the assigned memberships.

    Managing User Access

    You can manually enable or disable a user’s membership access in the user’s profile. In the Product Access section, select to “Enable” or “Disable” the desired membership and update the profile.

    To automate access and/or to integrate with registration or other plugins, there are two API functions for adding or removing memberships for a user:

    • wpmem_set_user_product()
    • wpmem_remove_user_product()

    WP-Members will automatically check to see if a user has access to content when that user tries to access.  However, for custom applications and integrations, the following API function can be used to check if a user has access or not:

    • wpmem_user_has_access()

    Selling Memberships

    Memberships are flexible. They are defined as a Custom Post Type (CPT) so you can integrate and customize how to assign access to users.

    You can easily sell memberships through WooCommerce using the new WP-Members Memberships for WooCommerce extension. This extension will allow you to link a WP-Members membership in a WooCommerce product.  If a membership is linked to a WooCommerce product, when the user purchases that product, the user will have that membership assigned to them and will then be able to access content set to require that membership.

    Tutorials and Code Snippets [Support Subscribers]

    • Custom shortcode to display a list of posts available for a given product
    • Allow users to choose a membership product at registration
    • « Go to Previous Page
    • Page 1
    • Interim pages omitted …
    • Page 23
    • Page 24
    • Page 25
    • Page 26
    • Page 27
    • Interim pages omitted …
    • Page 52
    • Go to Next Page »

    Ready to get started?

    Join Today!

    © 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

    • butlerblog.com
    • WP-Members Support Subscription
    • Terms of Service
    • Privacy Policy
    • Refund Policy