$default_authorize_url_path
$default_authorize_url_path : string
Create default WordPress admin functionality to configure the plugin.
__construct(object $wpdb, string $version, array $login_credentials, string $slug, object $wordpress, object $salesforce, object $mappings, object $push, object $pull, object $logging, array $schedulable_classes, object $queue = '', $option_prefix = '')
Constructor which sets up admin pages
| object | $wpdb | |
| string | $version | |
| array | $login_credentials | |
| string | $slug | |
| object | $wordpress | |
| object | $salesforce | |
| object | $mappings | |
| object | $push | |
| object | $pull | |
| object | $logging | |
| array | $schedulable_classes | |
| object | $queue | |
| $option_prefix |
add_actions()
Create the action hooks to create the admin page(s)
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293initial_action_schedule(string $new_schedule, string $old_schedule, string $option_name) : string
Set up recurring tasks if there are none
| string | $new_schedule | |
| string | $old_schedule | |
| string | $option_name |
$new_schedule
change_action_schedule(string $old_schedule, string $new_schedule, string $option_name)
Change recurring tasks if options change
| string | $old_schedule | |
| string | $new_schedule | |
| string | $option_name |
create_admin_menu()
Create WordPress admin options page
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293show_admin_page()
Render full admin pages in WordPress This allows other plugins to add tabs to the Salesforce settings screen
todo: better front end: html, organization of html into templates, css, js
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293salesforce_settings_forms()
Create default WordPress admin settings form for salesforce This is for the Settings page/tab
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293notices()
Create the notices, settings, and conditions by which admin notices should appear
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293get_salesforce_object_description(array $data = array()) : array
Get all the Salesforce object settings for fieldmapping This takes either the $_POST array via ajax, or can be directly called with a $data array
| array | $data | data must contain a salesforce_object can optionally contain a type |
$object_settings
get_salesforce_object_fields(array $data = array()) : array
Get Salesforce object fields for fieldmapping
| array | $data | data must contain a salesforce_object can optionally contain a type for the field |
$object_fields
get_wordpress_object_fields(string $wordpress_object = '') : array
Get WordPress object fields for fieldmapping This takes either the $_POST array via ajax, or can be directly called with a $wordpress_object field
| string | $wordpress_object |
$object_fields
get_wp_sf_object_fields(string $wordpress_object = '', $salesforce = '') : array
Get WordPress and Salesforce object fields together for fieldmapping This takes either the $_POST array via ajax, or can be directly called with $wordpress_object and $salesforce_object fields
| string | $wordpress_object | |
| $salesforce |
$object_fields
push_to_salesforce(string $wordpress_object = '', integer $wordpress_id = '')
Manually push the WordPress object to Salesforce This takes either the $_POST array via ajax, or can be directly called with $wordpress_object and $wordpress_id fields
| string | $wordpress_object | |
| integer | $wordpress_id |
pull_from_salesforce(string $salesforce_id = '', string $wordpress_object = '')
Manually pull the Salesforce object into WordPress This takes either the $_POST array via ajax, or can be directly called with $salesforce_id fields
| string | $salesforce_id | |
| string | $wordpress_object |
refresh_mapped_data(integer $mapping_id = '')
Manually pull the Salesforce object into WordPress This takes an id for a mapping object row
| integer | $mapping_id |
prepare_fieldmap_data()
Prepare fieldmap data and redirect after processing This runs when the create or update forms are submitted It is public because it depends on an admin hook It then calls the Object_Sync_Sf_Mapping class and sends prepared data over to it, then redirects to the correct page This method does include error handling, by loading the submission in a transient if there is an error, and then deleting it upon success
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293delete_fieldmap()
Delete fieldmap data and redirect after processing This runs when the delete link is clicked, after the user confirms It is public because it depends on an admin hook It then calls the Object_Sync_Sf_Mapping class and the delete method
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293prepare_object_map_data()
Prepare object data and redirect after processing This runs when the update form is submitted It is public because it depends on an admin hook It then calls the Object_Sync_Sf_Mapping class and sends prepared data over to it, then redirects to the correct page This method does include error handling, by loading the submission in a transient if there is an error, and then deleting it upon success
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293delete_object_map()
Delete object map data and redirect after processing This runs when the delete link is clicked on an error row, after the user confirms It is public because it depends on an admin hook It then calls the Object_Sync_Sf_Mapping class and the delete method
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293import_json_file()
Import a json file and use it for plugin data
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293export_json_file()
Create a json file for exporting
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293display_input_field(array $args)
Default display for <input> fields
| array | $args |
display_checkboxes(array $args)
Display for multiple checkboxes Above method can handle a single checkbox as it is
| array | $args |
display_select(array $args)
Display for a dropdown
| array | $args |
display_link(array $args)
Default display for <a href> links
| array | $args |
sanitize_validate_text(string $option) : string
Allow for a standard sanitize/validate method. We could use more specific ones if need be, but this one provides a baseline.
| string | $option |
$option
clear_sfwp_cache()
Ajax call to clear the plugin cache.
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293show_salesforce_user_fields(object $user)
Show what we know about this user's relationship to a Salesforce object, if any
| object | $user |
save_salesforce_user_fields(integer $user_id)
If the user profile has been mapped to Salesforce, do it
| integer | $user_id |
set_action_schedule(string $schedule_name, string $action_group_name)
Set up recurring tasks
| string | $schedule_name | |
| string | $action_group_name |
fields_settings(string $page, string $section, $callbacks)
Fields for the Settings tab This runs add_settings_section once, as well as add_settings_field and register_setting methods for each option
| string | $page | |
| string | $section | |
| $callbacks |
fields_fieldmaps(string $page, string $section, string $input_callback = '')
Fields for the Fieldmaps tab This runs add_settings_section once, as well as add_settings_field and register_setting methods for each option
| string | $page | |
| string | $section | |
| string | $input_callback |
fields_scheduling(string $page, string $section, $callbacks)
Fields for the Scheduling tab This runs add_settings_section once, as well as add_settings_field and register_setting methods for each option
| string | $page | |
| string | $section | |
| $callbacks |
fields_log_settings(string $page, string $section, array $callbacks)
Fields for the Log Settings tab This runs add_settings_section once, as well as add_settings_field and register_setting methods for each option
| string | $page | |
| string | $section | |
| array | $callbacks |
version_options() : array
Dropdown formatted list of Salesforce API versions
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293$args
status(object $sfapi)
Run a demo of Salesforce API call on the authenticate tab after WordPress has authenticated with it
| object | $sfapi |
logout()
Deauthorize WordPress from Salesforce.
This deletes the tokens from the database; it does not currently do anything in Salesforce For this plugin at this time, that is the decision we are making: don't do any kind of authorization stuff inside Salesforce
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293clear_cache( $ajax = false)
Clear the plugin's cache.
This uses the flush method contained in the WordPress cache to clear all of this plugin's cached data.
| $ajax |
check_wordpress_admin_permissions()
Check WordPress Admin permissions Check if the current user is allowed to access the Salesforce plugin options
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/jstegall/Sites/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293tabs(array $tabs, string $tab = '')
Render tabs for settings pages in admin
| array | $tabs | |
| string | $tab |
clear_schedule(string $schedule_name = '')
Clear schedule This clears the schedule if the user clicks the button
| string | $schedule_name |
get_schedule_count(string $schedule_name = '') : integer
Get count of schedule items
| string | $schedule_name |
$count
create_object_map(integer $wordpress_id, string $wordpress_object, string $salesforce_id, string $action = '') : integer
Create an object map between a WordPress object and a Salesforce object
| integer | $wordpress_id | Unique identifier for the WordPress object |
| string | $wordpress_object | What kind of object is it? |
| string | $salesforce_id | Unique identifier for the Salesforce object |
| string | $action | Did we push or pull? |
$wpdb->insert_id This is the database row for the map object