automattic / jetpack-partner
Support functions for Jetpack hosting partners.
Installs: 23 480
Dependents: 2
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 1
Type:jetpack-library
Requires
- automattic/jetpack-connection: ^1.57.5
- automattic/jetpack-status: ^1.18.4
Requires (Dev)
- automattic/jetpack-changelogger: ^3.3.9
- automattic/wordbless: @dev
- brain/monkey: 2.6.1
- yoast/phpunit-polyfills: 1.1.0
Suggests
- automattic/jetpack-autoloader: Allow for better interoperability with other plugins that use this package.
- dev-trunk / 1.7.x-dev
- v1.7.25
- v1.7.24
- v1.7.23
- v1.7.22
- v1.7.21
- v1.7.20
- v1.7.19
- v1.7.18
- v1.7.17
- v1.7.16
- v1.7.15
- v1.7.14
- v1.7.13
- v1.7.12
- v1.7.11
- v1.7.10
- v1.7.9
- v1.7.8
- v1.7.7
- v1.7.6
- v1.7.5
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- 1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- dev-prerelease
- dev-fix/slack-workflow-branch-detection
- dev-fix/release-branch-typo
- dev-update/generate-branch-plugin
- dev-release-v1.4.2
- dev-release-v1.4.1
- dev-feature/reorg
- dev-release-v1.4.0
- dev-release-v1.3.1
- dev-release-v1.3.0
- dev-release-v1.2.0
- dev-release-v1.1.0
This package is auto-updated.
Last update: 2023-10-03 21:02:20 UTC
README
A package that provides support functions for Jetpack hosting partners.
Usage for hosting partners
As a hosting partner you will need to set either the subsidiary id or the affiliate code. Both can be set via an option or a filter (but please do not set them using an option and filter simultaneously as this may not result in the desired effect).
The most straight forward way to set these is by using an option:
// Set or update subsidiary id. Note that subsidiary id is a string that will be filtered // with WordPress' sanitize_key() so make sure it conforms to the regex [^a-z0-9_\-]. update_option( 'jetpack_partner_subsidiary_id', '<subsidiary id here>', true ); // Set or update the affiliate code. update_option( 'jetpack_affiliate_code', '<affiliate code here>', true );
Another way to set these is via a filter. This requires creating a function that returns the desired value.
// Set the subsidairy id. Note that subsidiary id is a string that will be filtered // with WordPress' sanitize_key() so make sure it conforms to the regex [^a-z0-9_\-]. function subsidiary_filter( ) { return '<subsidiary id here>'; } add_filter( 'jetpack_partner_subsidiary_id', 'subsidiary_filter' ); // Set the affiliate code. function affiliate_filter( ) { return '<affiliate code here>'; } add_filter( 'jetpack_affiliate_code', 'affiliate_filter' );
Using this package in your WordPress plugin
If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.
Security
Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.
License
jetpack-partner is licensed under GNU General Public License v2 (or later)