Documentation > Collection List Shortcode

Collection List Shortcode

Displays a list of collections

You can show a list if collection by using the [picu_list_collections] shortcode.

List of Attributes

status
Filter by collection status. Accepts a comma-separated list of collection status. Allowed values: open, closed and delivered. Shows all colleciton, if the filter is not used.

[picu_list_collections status="open,closed"]Code language: JSON / JSON with Comments (json)

ids
Filter by collection ID. Accepts a comma-separated list of ids.

[picu_list_collections id="123,456"]Code language: JSON / JSON with Comments (json)

email
Filter by email address, which the collection was sent to. Accepts one email address.

[picu_list_collections email="info@picu.io"]Code language: JSON / JSON with Comments (json)

current_user
Filter by the email address of the currently logged in user.
Note: This will overwrite the email attribute.

[picu_list_collections current_user]Code language: JSON / JSON with Comments (json)

The example above will show all collections, which were sent to the currently logged in user, matched by the user’s email address.


For the developers among you, we also added a filter picu_list_collections_args, which let’s you change/add your own arguments to the underlying query. In the following example we want to order the collections by title (by default they are sorted by date):

function my_picu_list_collection_args( $args ) {

	$args['orderby'] = 'title';

	return $args;
}

add_filter( 'picu_list_collections_args', 'my_picu_list_collection_args' );Code language: PHP (php)

This works with all the parameters used by WP_Query and opens up a whole range of possibilities.

We have a second filter, picu_collection_list in place with which you can completely customize the collection list.

Have a look at this example snippet that allows you to use a random image from the respective collection as a thumbnail.


And finally, there is also a blog post describing how to implement a very basic client area.

Need help?

If you couldn’t find what you were looking for and need more assistance, please get in touch with us directly and we’re happy to help.