[customer-area-menu /]
This one is pretty simple, it simply outputs the navigation menu wherever you want it. This shortcode does not accept any parameter.
Available since WP Customer Area 6.1
[customer-area-protected-content /]
Query the database and print protected content belonging to or authored by a user. This shortcode will be very helpful if you have the Protected content types addon and want to add a page in your private area where you can list the content owned by the current user for that post type.
Available since WP Customer Area 6.1
Parameters
name | default | description |
---|---|---|
type (*) |
– | The post type corresponding to the actual items stored by WordPress in the database. This parameter is required. |
show |
owned | Which items will be displayed: either owned, which gets all items assigned to the current user, or authored, which gets all items which have been created by the current user. |
layout |
default | The layout to use to display the items (see below for more details). Currently, two layouts are implemented: default which displays items like on the dashboard and list which displays items in a simple HTML list. You can however use any layout name provided that you implement the corresponding template files. |
max_items |
-1 | The maximum number of items to get. You can set to -1 if you want to show all items, or any positive number to show at most this many items. |
taxonomy |
empty | The name of the taxonomy that should be used to filter content. For example, use cuar_private_file_category if you want to filter the private files according to the category they belong to. |
terms |
empty | The terms of the taxonomy to use for filtering. By default you should specify term IDs. You can enter multiple terms by separating them with a coma (eg. 12,15,18 ). Required if you specify a taxonomy parameter. |
terms_field |
term_id | By default, you specify the terms using their ID. If you prefer though, you can specify term slugs. Then you should set this parameter to slug . |
terms_operator |
IN | By default content will be filtered as IN the specified term list. If you want, you can instead list the content which is NOT IN the specified terms. |
Examples
1. List at most 2 private pages with the list layout owned by the current user
[customer-area-protected-content type="cuar_private_page" max_items="2" show="owned" layout="list" /]
2. List all the private pages owned by the current user and not classified in the categories having ID 12 or 25
[customer-area-protected-content type="cuar_private_page" taxonomy="cuar_private_page_category" terms="12,25" terms_operator="NOT IN" /]
Some more details about layouts
You can either use the layouts available in WP Customer Area, or you can as well use any layout name you wish and implement the corresponding template files.
The shortcode will make use of four template files which will:
- Define how we loop through the items
- Output something before the items
- Output something after the items
- Define how an item is printed
Those four template files will be named after the layout parameter and/or the post type. Of course, you can (should) enable template debugging information to see which template files are requested so that you know which ones you should override.