LLMS_Membership::get_associated_posts( string $post_type = null )
Retrieve a list of posts associated with the membership
Description Description
An associated post is:
- A post, page, or custom post type which supports
llms-membership-restrictions
and has restrictions enabled to this membership - A course that exists in the memberships list of auto-enroll courses
- A course that has at least one access plan with members-only availability linked to this membership
Parameters Parameters
- $post_type
-
(Optional) If supplied, returns only associations of this post type, otherwise returns an associative array of all associations.
Default value: null
Return Return
(array[]|int[]) An array of arrays of post IDs. The array keys are the post type and the array values are arrays of integers. If $post_type
is supplied returns an array of associated post ids as integers.
Source Source
File: includes/models/model.llms.membership.php
Changelog Changelog
Version | Description |
---|---|
4.15.0 | Minor restructuring to only query post type data when it's needed. |
3.38.1 | Introduced. |