• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

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 » Plugins » User List » User List Documentation » Filter Hooks » wpmem_ul_list_args

wpmem_ul_list_args

Description

This filter allows you to pass arguments to the user list function wpmem_do_member_list to override default values that are used in the building process. The wpmem_do_member_list function uses the wp_parse_args function to merge arguments passed through this filter with the following defaults:

$defaults = array(

    // HTML wrappers.
    'list_before'       => '<div id="wpmem-ul-list">',
    'list_after'        => '</div>',
    'heading_before'    => '<h2>',
    'heading_after'     => '</h2>',
    'user_even_before'  => '<div class="wpmem-ul-user">',
    'user_even_after'   => '</div>',
    'user_odd_before'   => '<div class="wpmem-ul-user-odd">',
    'user_odd_after'    => '</div>',
    'user_label_before' => '',
    'user_label_after'  => '',
    'user_field_before' => '',
    'user_field_after'  => '',
    'avatar_before'     => '<div class="avatar">',
    'avatar_after'      => '</div>',
    'field_tag'         => 'div',
    'empty_list_before' => '<div align="center" id="wpmem_msg"><p>',
    'empty_list_after'  => '</p></div>',

    // Other
    'member_since_label'  => __( 'Member since: ', 'wp-members-ul' ),
    'member_since_format' => "F j, Y, g:i a",
    'empty_list_text'     => __( 'No members found', 'wp-members-ul' ),

);

Parameters

$args
(array) (required) An array of arguments that are to override form $defaults.

$list_id
(string) (optional) Identifies which list instance is being displayed.

Usage

Like all of the “_args” filters, this filter merges the returned value with the defaults. No argument is actually passed to the filter, so it can only be used once.  Subsequent uses of the same _args filter will override previous uses of the same filter.  So keep all changes in one filter function.

Date format for “Member Since” field

The plugin default format is “F j, Y, g:i a”. This displays as “October 26, 2018, 2:27 pm”.

You can use PHP date formats for changing the format to whatever style you want for the list. See https://www.php.net/manual/en/function.date.php

For example, returning “d m Y” would render as “26 Oct 2018” or “F Y” would be October 2018″. Use “Y” to display just a 4 digit year. See the PHP documenation link above for more ideas.

Alternatively, if you would like to use your WP date format (Settings > General > Date Format), you can just return get_option( ‘date_format’ ).

This example uses the existing WP date format:

add_filter( 'wpmem_ul_list_args', function() {
    // Returns the date format set in Settings > General > Date Format
    $args['member_since_format'] = get_option( 'date_format' );
    return $args;
});

This example uses a PHP date format:

add_filter( 'wpmem_ul_list_args', function() {
    // Returns the PHP date format for "October 26, 2018"
    $args['member_since_format'] = "F j, Y";
    return $args;
});

Changelog

Introduced in version 1.2
$list_id parameter added in 1.9.0

Source

wpmem_ul_list_args is located in wp-members-user-list.php

WP-Members User List

Plugin Info

Current Stable Version: 2.1.6
Minimum WordPress Version: 5.0
Tested up to WordPress Version: 6.8
Last Updated: 2025-05-14

Documentation

    • Installation
    • Settings
    • Display the List
    • Profile Page
    • Stylesheets
    • Filter Hooks
    • Tips and Tricks
    • Manage License
    • Change Log

Get the Plugin

  • Purchase the Plugin
  • Get the Pro Bundle

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