Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create custom-aa-categories-on-the-fly.html #137

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions _extensions/all-access/custom-aa-categories-on-the-fly.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: snippet
title: Customize AA categories on-the-fly.
description: This plugin allows the categories for an All Access Pass to be modified on-the-fly, without needing to run any tool or reset any customer data.
collection: extensions
category: all-access
---

<?php
/*
* Plugin Name: EDD All Access - Customize AA categories on-the-fly.
* Description: This plugin allows the categories for an All Access Pass to be modified on-the-fly, without needing to run any tool or reset any customer data.
* Author: Phil Johnston
* Version: 1.0
*/

function my_custom_aa_categories( $included_categories, $all_access_pass_object ) {

$download_id = $all_access_pass_object->download_id;
$price_id = $all_access_pass_object->price_id;

if ( 123 === $download_id ) {
$included_categories = array( 1, 2, 3 );
}

return $included_categories;
}
add_filter( 'edd_all_access_included_categories', 'my_custom_aa_categories' );