<?php
|
/*
|
Plugin Name: JakeVan Extension
|
Plugin URI: https://jakevan.ca/
|
Description: An Extension of JakeVan Base, for jakevan.
|
Author: Jake Vanderwerf
|
Version: 1.0.0
|
Author URI: https://jakevan.ca/
|
Textdomain: ajv
|
*/
|
|
//PLUGIN STRUCTURE
|
// /content/
|
// art.php
|
// design.php
|
// development.php
|
// setup.php
|
// strategy.php
|
// writing.php
|
// /dashboard/
|
// setup.php
|
// /files/
|
// fileManagement.php
|
// /forms/
|
// setup.php
|
// /login/
|
// setup.php
|
// /taxonomies/
|
// city.php
|
// form.php
|
// media.php
|
// progress.php
|
// setup.php
|
// style.php
|
// target.php
|
// theme.php
|
// /users/
|
// client.php
|
// setup.php
|
// ajakevan.php <-- main plugin file
|
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
|
use JVBase\managers\CacheManager;
|
|
add_filter('jvb_base', function () {
|
return 'ajv_';
|
});
|
|
|
const AJV_DIR = WP_PLUGIN_DIR . '/ajakevan';
|
define('AJV_URL', plugin_dir_url(__FILE__));
|
|
require(AJV_DIR . '/content/setup.php');
|
//require(AJV_DIR . '/dashboard/setup.php');
|
//require(AJV_DIR . '/forms/setup.php');
|
require(AJV_DIR . '/login/setup.php');
|
require(AJV_DIR . '/taxonomies/setup.php');
|
//require(AJV_DIR . '/users/setup.php');
|
//require(AJV_DIR . '/files/fileManagement.php');
|
|
|
/**
|
* Defines base options like:
|
* - directory & Membership
|
* - dashboard
|
* - membership settings (JVB_MEMBERSHIP)
|
* - post types (JVB_CONTENT)
|
* - taxonomies (JVB_TAXONOMY)
|
* - User Roles (JVB_USER)
|
* - enthusiast = (bool) short form for a subscriber-like user that can collect content for reference
|
* - forum = (bool) create a forum
|
* - member_only = (bool) if forum and this is true, creates a member-only forum in the custom dashboard
|
*
|
* as well as central filters for
|
* - rewrite rules
|
* - archive title
|
*/
|
add_filter('jvb_site', 'ajv_setup_site');
|
function ajv_setup_site():array
|
{
|
return [
|
'icons' => 'light',
|
'is_directory' => false, //as in, a membership directory
|
'has_membership' => false,
|
'has_map' => true,
|
'dashboard' => true,
|
'support' => true,
|
'feed_block' => true,
|
'email_notifications' => true,
|
'integrations' => [
|
'bluesky' => true,
|
'cloudflare' => true,
|
'facebook' => false,
|
'maps' => true,
|
'gmb' => true,
|
'helcim' => false,
|
'instagram' => false,
|
'square' => true,
|
'umami' => true,
|
],
|
'is_restaurant' => false,
|
'limit_hours' => false,
|
'enthusiast' => true,
|
'favourites' => true, //optional flag to allow enthusiasts, but not favourites
|
];
|
}
|
/**
|
* JVB_MEMBERSHIP defines the structure of the directory
|
* Options include:
|
* - membership_expires = useful if members pay a yearly membership fee
|
* - hide_expired = removes users once membership expired; only used if membership_expires is true
|
* - clip_expired = keeps users once membership expires, but limits the information shown; only used if membership_expires is true
|
* - membership_approval = verified users can approve other users
|
* - term_approval = (bool) verified users can create new terms, but needs approval
|
* - member_only = (array) if empty, open to any registered user. otherwise an array of registered user roles
|
*/
|
//add_filter('jvb_membership', 'ajv_setup_membership');
|
//function ajv_setup_membership():array
|
//{
|
// return [
|
// 'member_content' => true,
|
// 'can_invite' => ['artist' => ['artist']],
|
// 'member_verified' => true,
|
// 'notifications' => true,
|
// 'forum' => true,
|
// 'member_only' => [ 'artist' ],
|
// 'member_expires' => false,
|
// 'hide_expired' => false,
|
// 'clip_expired' => false,
|
// 'term_approval' => true,
|
// 'can_approve' => [ 'artist' ]
|
// ];
|
//}
|
//
|
//add_filter('jvbLoadingQuips', 'ajv_loading_quips');
|
//function ajv_loading_quips(array $quips):array
|
//{
|
// return [];
|
//}
|