PHP code example of automattic / jetpack-partner

1. Go to this page and download the library: Download automattic/jetpack-partner library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

automattic / jetpack-partner example snippets



// 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 );


// 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' );