turn string The partner code.
*/
public function get_partner_code( $type ) {
switch ( $type ) {
case self::AFFILIATE_CODE:
/**
* Allow to filter the affiliate code.
*
* @since partner-1.0.0
* @since-jetpack 6.9.0
* @since 2.0.0
*
* @param string $affiliate_code The affiliate code, blank by default.
*/
return apply_filters( 'jetpack_affiliate_code', get_option( 'jetpack_affiliate_code', '' ) );
case self::SUBSIDIARY_CODE:
/**
* Allow to filter the partner subsidiary id.
*
* @since partner-1.0.0
* @since 2.0.0
*
* @param string $subsidiary_id The partner subsidiary id, blank by default.
*/
return apply_filters(
'jetpack_partner_subsidiary_id',
get_option( 'jetpack_partner_subsidiary_id', '' )
);
default:
return '';
}
}
/**
* Resets the singleton for testing purposes.
*/
public static function reset() {
self::$instance = null;
}
}