This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
const PUB_KEY = 'abcd'; | |
const TOKEN = '1234'; | |
const URL = 'https://example.com/wp-json/gh/v4'; | |
/** | |
* Send JSON post | |
* | |
* @param $url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$contact_data = [ | |
// Primary contact data | |
'data' => [ | |
'first_name' => 'John', | |
'last_name' => 'Doe', | |
'email' => 'john@example.com', | |
'option_status' => 2, // 1 for unconfirmed, 2 for confirmed, | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'groundhogg/admin/contacts/register_info_cards', 'remove_unwanted_info_cards', 11 ); | |
/** | |
* @param $cards \Groundhogg\Admin\Contacts\Info_Cards | |
*/ | |
function remove_unwanted_info_cards( $cards ){ | |
if ( ! is_super_admin() ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Auto company creation and linking from forms and the contact record | |
remove_action( 'groundhogg/after_form_submit', 'GroundhoggCompanies\maybe_create_company_from_contact', 10 ); | |
remove_action( 'groundhogg/companies/save_work_details', 'GroundhoggCompanies\maybe_create_company_from_contact', 10); | |
// Webhooks | |
remove_action( 'groundhogg/update_contact_with_map/after', 'GroundhoggCompanies\were_company_changes_made_during_mapping', 10 ); | |
remove_action( 'groundhogg/generate_contact_with_map/after', 'GroundhoggCompanies\were_company_changes_made_during_mapping', 10 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'groundhogg/owners', function ( $users ) { | |
// Remove users with these IDs | |
$remove = [ 1234, 4321 ]; | |
$keep = []; | |
foreach ( $users as $user ){ | |
if ( in_array( $user->ID, $remove ) ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"total_items": 4, | |
"items": [ | |
{ | |
"ID": 4, | |
"data": { | |
"title": "Test Deal", | |
"deal_value": 300, | |
"close_probability": 50, | |
"contact_id": "0", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"item": { | |
"ID": 4, | |
"data": { | |
"title": "Test Deal", | |
"deal_value": 300, | |
"close_probability": 50, | |
"contact_id": "0", | |
"owner_id": 1, | |
"stage_id": 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data" : { | |
"deal_value": 300, | |
"priority": 1, | |
"status": "won" | |
}, | |
"meta" : { | |
"product_interest": [ | |
[ | |
"Product Name", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"item": { | |
"ID": 4, | |
"data": { | |
"title": "Test Deal", | |
"deal_value": 300, | |
"close_probability": 50, | |
"contact_id": "0", | |
"owner_id": 1, | |
"stage_id": 1, |