This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // only copy this line if needed | |
| /** | |
| * Remove post types from the membership plan restriction options | |
| * Example: remove Sensei Messages from post types that can be restricted | |
| * | |
| * @param array $blacklist the array of post types to exclude from restriction options | |
| * @return array $blacklist the updated array of post types to exclude | |
| */ | |
| function sv_wc_memberships_add_post_type_to_blacklist( $blacklist ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // only copy this line if needed | |
| /** | |
| * Add custom user membership statuses | |
| * | |
| * @param array $statuses the array of membership statuses | |
| * @return array $statuses the updated status array | |
| */ | |
| function sv_wc_memberships_add_membership_statuses( $statuses ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // only copy this line if needed | |
| /** | |
| * Membership access is already granted when orders are processing or completed | |
| * Add membership access for custom order statuses as well | |
| * | |
| * Example: grant membership access for "Shipped" and "Invoice Paid" orders during purchase cycle as well | |
| * Use the appropriate action for your custom order status | |
| */ | |
| function sv_wc_memberships_grant_access_for_custom_order_statuses() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // only copy this line if needed | |
| /** | |
| * Removes membership access for processing orders | |
| * so access is only granted at when orders are complete | |
| */ | |
| function sv_wc_memberships_remove_processing_access() { | |
| // make sure Memberships is active first | |
| if ( function_exists( 'wc_memberships' ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // only copy if needed | |
| /** | |
| * Display a FontAwesome lock icon next to the post title if a member does not have access | |
| * with WooCommerce Memberships. | |
| * | |
| * REQUIRES FontAwesome to be loaded already | |
| * | |
| * @param string $post_title the post title | |
| * @param int $post_id the WordPress post ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // only copy this line if needed | |
| /** | |
| * Rename the section links for the "Member Area" | |
| * Can rename any section links using the section ID | |
| * | |
| * @param array $sections the array of section link IDs and text | |
| * @return array $sections the updated array of section links | |
| */ | |
| function sv_wc_memberships_rename_member_area_sections( $sections ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // only copy this line if needed | |
| /** | |
| * Remove the "End Date" column from the My Memberships table | |
| * | |
| * @param array $columns the columns in the "My Memberships" table | |
| * @return array $columns the updated array of columns | |
| */ | |
| function sv_wc_memberships_remove_end_date_column( $columns ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // only copy this line if needed | |
| /** | |
| * Change the "content delayed" message displayed to members who will have access, but not yet | |
| * Example: change the delayed content message for the "Projects" post type | |
| * | |
| * @param string $message the message html | |
| * @param string[] $args { | |
| * @type string $context whether the message appears in the context of a notice or elsewhere | |
| * @type \WP_Post $post the post object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Allow Order editing for custom statuses | |
| * | |
| * @param bool $editable if the order is editable | |
| * @param \WC_order $order | |
| * @return bool if the order is editable for this status | |
| */ | |
| function sv_wc_order_status_manager_order_is_editable( $editable, $order ) { |
NewerOlder