-
Notifications
You must be signed in to change notification settings - Fork 2
tp TouchPointWP TouchPointWP
Main plugin class.
- Class name: TouchPointWP
- Namespace: \tp\TouchPointWP
const VERSION = "0.0.95"
const TOKEN = "TouchPointWP"
const API_ENDPOINT = "touchpoint-api"
const API_ENDPOINT_APP_EVENTS = "app-events"
const API_ENDPOINT_INVOLVEMENT = "inv"
const API_ENDPOINT_GLOBAL = "global"
const API_ENDPOINT_PERSON = "person"
const API_ENDPOINT_MEETING = "mtg"
const API_ENDPOINT_ADMIN = "admin"
const API_ENDPOINT_STATS = "stats"
const API_ENDPOINT_AUTH = "auth"
const API_ENDPOINT_REPORT = "report"
const API_ENDPOINT_ADMIN_SCRIPTZIP = "admin/scriptzip"
const API_ENDPOINT_CLEANUP = "cleanup"
const API_ENDPOINT_GEOLOCATE = "geolocate"
const SHORTCODE_PREFIX = "TP-"
const HOOK_PREFIX = "tp_"
const INIT_ACTION_HOOK = "tp_init"
const SETTINGS_PREFIX = "tp_"
const TABLE_PREFIX = "tp_"
const TABLE_IP_GEO = self::TABLE_PREFIX . "ipGeo"
const TABLE_STATS = self::TABLE_PREFIX . "stats"
const CACHE_TTL = 8
const TTL_IP_GEO = 5
const CACHE_PUBLIC = 0
const CACHE_PRIVATE = 10
const CACHE_NONE = 20
const INVOLVEMENT_META_KEY = \tp\TouchPointWP\TouchPointWP::SETTINGS_PREFIX . "invId"
const MAX_API_CALLS = 20
public joiner = " ◦ "
- Visibility: public
public mixed settings = null
Settings object
- Visibility: public
public mixed file
The main plugin file.
- Visibility: public
public mixed dir
The main plugin directory.
- Visibility: public
public mixed assets_dir
The plugin assets directory.
- Visibility: public
public mixed assets_url
The plugin assets URL, with trailing slash.
- Visibility: public
public mixed script_ext
Suffix for JavaScripts.
- Visibility: public
public mixed debug
- Visibility: public
bool tp\TouchPointWP\TouchPointWP::isApi()
Indicates that the current request is being processed through the API.
- Visibility: public
- This method is static.
- bool -
mixed tp\TouchPointWP\TouchPointWP::cronAdd15Minutes(mixed schedules)
- Visibility: public
- This method is static.
- schedules mixed
- mixed -
string tp\TouchPointWP\TouchPointWP::capitalPyScript(string|mixed text)
Find and replace links to /pyscript with their more functional brother, /PyScript. That small typo makes bad things happen.
- Visibility: public
- This method is static.
- text string|mixed - The text to be modified. (should be a string, but this is WordPress, so maybe not.)
- string - The modified text.
mixed tp\TouchPointWP\TouchPointWP::admin()
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::scheduleCleanup()
- Visibility: public
- This method is static.
- mixed
mixed tp\TouchPointWP\TouchPointWP::setCaching(int level)
- Visibility: public
- This method is static.
- level int
- mixed
mixed tp\TouchPointWP\TouchPointWP::doCacheHeaders(int cacheLevel)
Spit out headers that prevent caching. Useful for API calls.
- Visibility: public
- This method is static.
- cacheLevel int
- mixed
mixed tp\TouchPointWP\TouchPointWP::postHeadersAndFiltering()
- Visibility: public
- This method is static.
- mixed
string tp\TouchPointWP\TouchPointWP::TouchPointIcon()
Get TouchPoint icon as an SVG that can printed inline.
- Visibility: public
- This method is static.
- string -
bool tp\TouchPointWP\TouchPointWP::parseRequest(bool continue, \WP wp, array|string extraVars)
- Visibility: public
- continue bool - Whether to parse the request
- wp WP - Current WordPress environment instance
- extraVars array|string - Passed query variables
- bool - Whether other request parsing functions should be allowed to function.
bool tp\TouchPointWP\TouchPointWP::currentUserIsAdmin()
Whether the current user is an admin.
- Visibility: public
- This method is static.
- bool -
void tp\TouchPointWP\TouchPointWP::printDynamicFooterScripts()
Print Dynamic Instantiation scripts.
- Visibility: public
void tp\TouchPointWP\TouchPointWP::adminPrintStyleOverrides()
Force some styling overrides into admin views.
- Visibility: public
string tp\TouchPointWP\TouchPointWP::getJsLocalizationDir()
- Visibility: public
- string -
mixed tp\TouchPointWP\TouchPointWP::loadLocalizations()
Load plugin textdomain
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::isTenth()
- Visibility: public
- This method is static.
- mixed
mixed tp\TouchPointWP\TouchPointWP::migrate(mixed force)
Compare the version numbers to determine if a migration is needed.
- Visibility: public
- force mixed
- mixed
\tp\TouchPointWP\TouchPointWP tp\TouchPointWP\TouchPointWP::load(mixed file)
Load the settings, connect the references, and check that there aren't pending migrations.
- Visibility: public
- This method is static.
- file mixed
- \tp\TouchPointWP\TouchPointWP -
void tp\TouchPointWP\TouchPointWP::init()
Initialize the plugin.
- Visibility: public
- This method is static.
void tp\TouchPointWP\TouchPointWP::renderBaseInlineScript()
Prints the inline 'base' script. This is meant to be called in the wp_head and admin_head, and should only be called once on a page, but that is not automatically validated.
- Visibility: public
- This method is static.
mixed tp\TouchPointWP\TouchPointWP::registerScriptsAndStyles()
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::requireScript(?string name)
Enqueue TouchPoint Scripts. Also, always adds Base if it hasn't been added yet.
- Visibility: public
- This method is static.
- name ?string
- mixed
mixed tp\TouchPointWP\TouchPointWP::requireStyle(?string name)
Enqueue TouchPoint Styles.
- Visibility: public
- This method is static.
- name ?string
- mixed
string tp\TouchPointWP\TouchPointWP::filterByTag(?string tag, ?string handle)
Adds async/defer attributes to enqueued / registered scripts. If -defer or -async is present in the script's handle, the respective attribute is added.
DOES apply to ALL scripts, not just those in the template.
- Visibility: public
- tag ?string - The script tag.
- handle ?string - The script handle.
- string - The HTML string.
mixed tp\TouchPointWP\TouchPointWP::ajaxGeolocate()
- Visibility: public
- mixed
\tp\TouchPointWP\Geo|false tp\TouchPointWP\TouchPointWP::geolocate(bool useApi, bool includeRaw)
- Visibility: public
- useApi bool - Set false to only use cached data, and not the IP API.
- includeRaw bool
- \tp\TouchPointWP\Geo|false - An object with 'lat', 'lng', and 'human' attributes, if a location could be identified. Or, false if not available.
\tp\TouchPointWP\Geo|false tp\TouchPointWP\TouchPointWP::reverseGeocode(float lat, float lng, bool includeIpLoc)
Get Reverse Geocode information based on a provided lat/lng.
- Visibility: public
- lat float - Latitude
- lng float - Longitude
- includeIpLoc bool - Whether to use IP geolocation as a fallback data source.
- \tp\TouchPointWP\Geo|false - An object with a 'human' attribute, if a location could be identified. Or, false if not available.
int|false tp\TouchPointWP\TouchPointWP::getDivisionTermIdByDivId(int divId)
- Visibility: public
- This method is static.
- divId int
- int|false - Returns the term ID number or false (or 0) if the division is not found, or not enabled.
\tp\TouchPointWP\TouchPointWP tp\TouchPointWP\TouchPointWP::instance(mixed file)
Main TouchPointWP Instance
Ensures only one instance of TouchPointWP is loaded or can be loaded.
- Visibility: public
- This method is static.
- file mixed
- \tp\TouchPointWP\TouchPointWP - instance
mixed tp\TouchPointWP\TouchPointWP::__clone()
Don't clone.
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::__wakeup()
Don't deserialize.
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::activation()
Activation. Runs on activation.
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::deactivation()
Deactivation. Runs on deactivation.
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::uninstall()
Runs on uninstallation.
- Visibility: public
- This method is static.
- mixed
bool tp\TouchPointWP\TouchPointWP::useTribeCalendarPro()
Indicates that Tribe Calendar Pro is enabled.
- Visibility: public
- This method is static.
- bool -
bool tp\TouchPointWP\TouchPointWP::useTribeCalendar()
Indicates that Tribe Calendar is enabled.
- Visibility: public
- This method is static.
- bool -
bool tp\TouchPointWP\TouchPointWP::useTribeOrMeetingCalendars()
Indicates that a calendar function is available, especially for the 2.0 mobile app option.
- Visibility: public
- This method is static.
- bool -
\WP_Term[] tp\TouchPointWP\TouchPointWP::orderHierarchicalTerms(\WP_Term[] terms, bool noChildlessParents)
Sort a list of hierarchical terms into a list in which each parent is immediately followed by its children.
- Visibility: public
- This method is static.
- terms WP_Term[]* noChildlessParents bool
- \WP_Term[] -
?string tp\TouchPointWP\TouchPointWP::host()
- Visibility: public
- ?string - The URL of the TouchPoint instance. Null if not set.
array tp\TouchPointWP\TouchPointWP::getMemberTypesForDivisions(string[] divisions)
Get the member types currently in use for the named divisions.
- Visibility: public
- divisions string[]
- array -
string[] tp\TouchPointWP\TouchPointWP::getDivisionsAsKVArray()
Format the list of divisions into an array with form-name-friendly IDs as the key.
- Visibility: public
- string[] -
mixed tp\TouchPointWP\TouchPointWP::getDivisions()
Returns an array of objects that correspond to divisions. Each Division has a name and an id. The name is both the Program and Division.
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::getResCodes()
Returns an array of objects that correspond to resident codes. Each ResCode has a name, a code, and an id.
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::getCampuses()
Returns an array of objects that correspond to campuses. Each Campus has a name, a code, and an id.
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::getGenders()
Returns an array of objects that correspond to the genders. Each Gender has a name and an id.
- Visibility: public
- mixed
mixed tp\TouchPointWP\TouchPointWP::getKeywords()
Returns an array of objects that correspond to keywords. Each Keyword has a name and an id.
- Visibility: public
- mixed
string[] tp\TouchPointWP\TouchPointWP::getKeywordsAsKVArray()
Format the list of divisions into an array with form-name-friendly IDs as the key.
- Visibility: public
- string[] -
array tp\TouchPointWP\TouchPointWP::getPersonEvFields(array|null matches)
Returns an array of objects that correspond to Person Extra Value Fields. Each has a name and a type.
- Visibility: public
- matches array|null - Provide an array of items that should be matched. If provided, only matches are returned.
- array -
string[] tp\TouchPointWP\TouchPointWP::getPersonEvFieldsAsKVArray(string|null type, bool addNone)
Format the list of Person Extra Value Fields into an array with form-name-friendly IDs as the key.
- Visibility: public
- type string|null - To limit the list to a particular data type, provide the name of the datatype. Needs to match the type in TouchPoint.
- addNone bool - Set true to add a "none" option to the list.
- string[] -
array tp\TouchPointWP\TouchPointWP::getFamilyEvFields(array|null matches)
Returns an array of objects that correspond to Family Extra Value Fields. Each has a name and a type.
- Visibility: public
- matches array|null - Provide an array of items that should be matched. If provided, only matches are returned.
- array -
string[] tp\TouchPointWP\TouchPointWP::getFamilyEvFieldsAsKVArray(string|null type, bool addNone)
Format the list of Family Extra Value Fields into an array with form-name-friendly IDs as the key.
- Visibility: public
- type string|null - To limit the list to a particular data type, provide the name of the datatype. Needs to match the type in TouchPoint.
- addNone bool - Set true to add a "none" option to the list.
- string[] -
\tp\TouchPointWP\Person|null tp\TouchPointWP\TouchPointWP::currentUserPerson()
Get the person that corresponds to the current user, if the current user is authenticated, and the user is associated with a PeopleId.
- Visibility: public
- This method is static.
- \tp\TouchPointWP\Person|null -
string[][] tp\TouchPointWP\TouchPointWP::getSavedSearches(?int peopleId, mixed includeValue)
Get a list of saved searches pertinent to the current user. These are grouped by type: User's searches, Public, and Flags.
Because these are user-specific and relatively volatile, they are NOT cached in WordPress.
- Visibility: public
- peopleId ?int* includeValue mixed
- string[][] -
array tp\TouchPointWP\TouchPointWP::flattenArrayToKV(array array, string kField, string vField, string kPrefix)
- Visibility: public
- This method is static.
- array array* kField string* vField string* kPrefix string
- array -
false|object tp\TouchPointWP\TouchPointWP::updatePersonEvFields()
Update the Person Extra Values if they're stale.
- Visibility: public
- false|object - False on failure
false|object tp\TouchPointWP\TouchPointWP::updateFamilyEvFields()
Update the Person Extra Values if they're stale.
- Visibility: public
- false|object - False on failure.
\stdClass|array tp\TouchPointWP\TouchPointWP::apiGet(string command, ?array parameters, int timeout, mixed verbose)
- Visibility: public
- command string - The thing to get
- parameters ?array - URL parameters to be added.
- timeout int - Amount of time in sec to wait before timing out.
- verbose mixed
- \stdClass|array - An array with headers, body, and other keys Data is generally in json_decode($response['body'])->data
\stdClass|array tp\TouchPointWP\TouchPointWP::apiPost(string command, ?mixed data, int timeout)
- Visibility: public
- command string - The thing to post
- data ?mixed - Data to post
- timeout int - Amount of time in sec to wait before timing out.
- \stdClass|array - An object that corresponds to the Data python object in TouchPoint.
array tp\TouchPointWP\TouchPointWP::extGet(string url, ?array parameters)
- Visibility: public
- url string - The destination of the request.
- parameters ?array - URL parameters to be added.
- array - An array with headers, body, and other keys.
\stdClass tp\TouchPointWP\TouchPointWP::doPersonQuery(array q, bool verbose, int timeout)
Submit a person query to TouchPoint with a structured array with the parameters.
- Visibility: public
- q array* verbose bool* timeout int
- \stdClass - The people objects are contained within ->people.
mixed tp\TouchPointWP\TouchPointWP::queueUpdateDeployedScripts()
Cause a script update on next load.
- Visibility: public
- This method is static.
- mixed
void tp\TouchPointWP\TouchPointWP::updateDeployedScripts(bool force)
- Visibility: public
- force bool
mixed tp\TouchPointWP\TouchPointWP::queueFlushRewriteRules()
Cause a flushing of rewrite rules on next load.
- Visibility: public
- This method is static.
- mixed
mixed tp\TouchPointWP\TouchPointWP::flushRewriteRules(bool force)
Execute a flushing of the rewrite rules, if either absolutely necessary ($force = true) or enqueued by queuing function.
- Visibility: public
- force bool
- mixed
mixed tp\TouchPointWP\TouchPointWP::enqueuePartialsStyle()
This function enqueues the stylesheet for the default templates, to avoid registering the style on sites where custom templates exist.
- Visibility: public
- This method is static.
- mixed
mixed tp\TouchPointWP\TouchPointWP::enqueueActionsStyle(string action)
This function enqueues the stylesheet for actions (swal, basically).
- Visibility: public
- This method is static.
- action string - This string identifies which action is being used. This should be passed to the filter so the filter can make an informed decision about whether to exclude the stylesheet.
- mixed
array tp\TouchPointWP\TouchPointWP::newQueryObject()
Create a basic parameter array for doPersonQuery
- Visibility: public
- This method is static.
- array -
mixed tp\TouchPointWP\TouchPointWP::validateThatTpWpUserExists()
- Visibility: public
- mixed
void tp\TouchPointWP\TouchPointWP::setTpWpUserAsCurrent()
Make the TPWP user the active one, so permissions are not dependent on whoever happens to be running things at the moment.
- Visibility: public
void tp\TouchPointWP\TouchPointWP::unsetTpWpUserAsCurrent()
Restore the actual user to the user position.
- Visibility: public
Documentation generated November 24, 2024 11:00pm.
- Simple RSVP
- People Lists
- Involvements
- Outreach Partners
- SQL & Python Reports
- Events Calendar from Meetings (Beta)
- Events Calendar Plugin Integration (Deprecated)
- tp
- tp\TouchPointWP
- api
- Auth
- CalendarGrid
- EventsCalendar
- ExtraValueHandler
- Geo
- hasGeo
- hierarchical
- Involvement
- Involvement_PostTypeSettings
- InvolvementMembership
- Location
- Meeting
- module
- Partner
- Person
- PostTypeCapable
- RegistrationType
- Report
- Rsvp
- scheduled
- Stats
- storedAsPost
- Taxonomies
- TouchPointWP
- TouchPointWP_AdminAPI
- TouchPointWP_Exception
- TouchPointWP_Settings
- TouchPointWP_Widget
- TouchPointWP_WPError
- updatesViaCron
- Utilities
- tp\TouchPointWP