开发者 | macbookandrew |
---|---|
更新时间 | 2018年12月30日 03:42 |
捐献地址: | 去捐款 |
PHP版本: | 4.0 及以上 |
WordPress版本: | 4.5.2 |
版权: | GPL2 |
版权网址: | 版权信息 |
[wlm_all_authorized_levels]
to show all authorized levels for the logged-in user.Yes; use [wlm_all_authorized_levels group_by_level="true"]
to group by pages by each level and (by default) show each level’s header.
Yes; use [wlm_all_authorized_levels show_header="false"]
to hide the header of each level (only works with group_by_level
).
Yes; get the IDs of those pages from the WordPress admin page and then add them to the shortcode separated by commas, like this: [wlm_all_authorized_levels pages_to_ignore="151,20"]
.
You can also use the wlm_authorized_pages_array
filter to modify the array; see below for an example.
Yes, you can include specific pages using the pages_to_include
attribute like this: [wlm_all_authorized_levels pages_to_include="151,20"]
.
You can also use the wlm_authorized_pages_array
filter to modify the array:
`
add_filter( 'wlm_authorized_pages_array', 'tweak_wlm_pages' );
function tweak_wlm_pages( $array ) {
// add a page
$array[] = $page_ID_to_add;
// remove a page
if ( $false !== ( $key = array_search( $page_ID_to_remove, $array ) ) ) {
unset( $array[$key] );
}
// return the modified array
return $array;
}
`
Not yet, but there are filters for every part of the output; here’s a list of the available filters:
wlm_authorized_post_types
: array of post types included in the WP_Query; defaults to array( 'page' )
wlm_all_levels_container_open
: wraps everything; defaults to <div class="wishlist-member-levels">
wlm_all_levels_container_close
: defaults to </div>
wlm_all_levels_level_wrapper_open
: wraps the entire list of items; defaults to <ul>
wlm_all_levels_level_wrapper_close
: defaults to </ul>
wlm_all_levels_item_wrapper_open
: wraps each item; defaults to <li
(no closing bracket)wlm_all_levels_item_wrapper_close
: defaults to </li>
wlm_all_levels_item_wrapper_class
: defaults to empty; space-separated list of classes to add to each itemwlm_all_levels_item_link
: defalts to <a href="' . get_permalink() . '">' . get_the_title() . '</a>
; the post ID is available as a parameter to your callback functionwlm_no_authorized_levels_message
: defaults to <p>Sorry, you are not authorized to access any content. Please <a href="' . admin_url() . '">log in</a>, check your subscription status, or contact us for more information.</p>
; shown when a user is not authorized for any WishList levelswlm_no_authorized_content_message
: defaults to <p>Sorry, you are not authorized to access any content. Please <a href="' . admin_url() . '">log in</a>, check your subscription status, or contact us for more information.</p>
; shown when there are no pages availablegroup_by_level="true"
attribute