Properties

$wpdb

$wpdb : 

Type

$version

$version : 

Type

$slug

$slug : 

Type

$mappings

$mappings : 

Type

$logging

$logging : 

Type

$option_prefix

$option_prefix : 

Type

Methods

__construct()

__construct(object  $wpdb, string  $version, string  $slug, object  $mappings, object  $logging, string  $option_prefix = '') 

Constructor which discovers objects in WordPress

Parameters

object $wpdb

A wpdb object.

string $version

The plugin version.

string $slug

The plugin slug.

object $mappings

Mapping objects.

object $logging

a Object_Sync_Sf_Logging instance.

string $option_prefix

The plugin's option prefix

Throws

\Exception

get_object_types()

get_object_types() : array

Get WordPress object types

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

Returns

array —

$wordpress_objects

get_wordpress_table_structure()

get_wordpress_table_structure(string  $object_type) : array

Get WordPress table structure for an object

Parameters

string $object_type

The type of object.

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

Returns

array —

$object_table_structure The table structure.

get_wordpress_object_fields()

get_wordpress_object_fields(string  $wordpress_object, string  $id_field = 'ID') : array

Get WordPress fields for an object

Parameters

string $wordpress_object

The type of WordPress object.

string $id_field

The field of that object that corresponds with its ID in the database.

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

Returns

array —

$object_fields

get_wordpress_object_data()

get_wordpress_object_data(string  $object_type, string  $object_id, boolean  $is_deleted = false) : array

Get WordPress data based on what object it is

Parameters

string $object_type

The type of object.

string $object_id

The ID of the object.

boolean $is_deleted

Whether the WordPress object has been deleted

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

Returns

array —

$wordpress_object

cache_get()

cache_get(string  $url, array  $args) : \$this->sfwp_transients->get

Check to see if this API call exists in the cache if it does, return the transient for that key

Parameters

string $url

The API call we'd like to make.

array $args

The arguents of the API call.

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

Returns

\$this->sfwp_transients->get —

$cachekey

cache_set()

cache_set(string  $url, array  $args, array  $data, string  $cache_expiration = '') : Bool

Create a cache entry for the current result, with the url and args as the key

Parameters

string $url

The API query URL.

array $args

The arguments passed on the API query.

array $data

The data received.

string $cache_expiration

How long to keep the cache result around for.

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

Returns

Bool —

whether or not the value was set

cache_expiration()

cache_expiration(string  $option_key, integer  $expire) : \The

If there is a WordPress setting for how long to keep this specific cache, return it and set the object property Otherwise, return seconds in 24 hours

Parameters

string $option_key

The cache item to keep around.

integer $expire

The default time after which to expire the 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 1293

Returns

\The —

cache expiration saved in the database.

object_create()

object_create(string  $name, array  $params) : array

Create a new object of a given type.

Parameters

string $name

Object type name, E.g., user, post, comment.

array $params

Values of the fields to set for the object.

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

Returns

array —

data: id : 123, success : true errors : [ ], from_cache: cached: is_redo:

part of CRUD for WordPress objects

object_upsert()

object_upsert(string  $name, string  $key, string  $value, array  $methods = array(), array  $params, boolean  $pull_to_drafts = false, boolean  $check_only = false) : array

Create new records or update existing records.

The new records or updated records are based on the value of the specified field. If the value is not unique, REST API returns a 300 response with the list of matching records.

Parameters

string $name

Object type name, E.g., user, post, comment.

string $key

The field to check if this record should be created or updated.

string $value

The value for this record of the field specified for $key.

array $methods

What WordPress methods do we use to get the data, if there are any. otherwise, maybe will have to do a wpdb query.

array $params

Values of the fields to set for the object.

boolean $pull_to_drafts

Whether to save to WordPress drafts when pulling from Salesforce.

boolean $check_only

Allows this method to only check for matching records, instead of making any data changes.

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

Returns

array —

data: "id" : 123, "success" : true "errors" : [ ], from_cache: cached: is_redo:

part of CRUD for WordPress objects

object_update()

object_update(string  $name, string  $id, array  $params) : array

Update an existing object.

Parameters

string $name

Object type name, E.g., user, post, comment.

string $id

WordPress id of the object.

array $params

Values of the fields to set for the object.

part of CRUD for WordPress objects

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

Returns

array —

data: success: 1 "errors" : [ ], from_cache: cached: is_redo:

object_delete()

object_delete(string  $name, string  $id) : array

Delete a WordPress object.

Parameters

string $name

Object type name, E.g., user, post, comment.

string $id

WordPress id of the object.

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

Returns

array —

data: success: 1 "errors" : [ ],

part of CRUD for WordPress objects

object_fields()

object_fields(string  $object_name, string  $id_field, string  $content_table, array  $content_methods, string  $meta_table, array  $meta_methods, string  $where, array  $ignore_keys) : array

Get all the fields for an object The important thing here is returning the fields as an array: $all_fields = array( 'key' => 'key name', 'table' => 'table name', 'methods' => array( 'create' => '', 'read' => '', 'update' => '', 'delete' => '' ) ); if there's a better way to do this than the mess of queries below, we should switch to that when we can we just need to make sure we get all applicable fields for the object itself, as well as its meta fields

Parameters

string $object_name

THe name of the object type.

string $id_field

The database filed that contains its ID.

string $content_table

The table that normally contains such objects.

array $content_methods

Unused, but included as part of the return.

string $meta_table

The table where meta values for this object type are contained.

array $meta_methods

Unused, but included as part of the return.

string $where

SQL query.

array $ignore_keys

Fields to ignore from the database.

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

Returns

array —

$all_fields The fields for the object.

user_create()

user_create(array  $params, string  $id_field = 'ID') : array

Create a new WordPress user.

Parameters

array $params

array of user data params.

string $id_field

The column in the DB that holdes the user ID.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

user_upsert()

user_upsert(string  $key, string  $value, array  $methods = array(), array  $params, string  $id_field = 'ID', boolean  $pull_to_drafts = false, boolean  $check_only = false) : array

Create a new WordPress user or update it if a match is found.

Parameters

string $key

What key we are looking at for possible matches.

string $value

What value we are looking at for possible matches.

array $methods

What WordPress methods do we use to get the data, if there are any. otherwise, maybe will have to do a wpdb query.

array $params

Array of user data params. This is generated by Object_Sync_Sf_Mapping::map_params().

string $id_field

Optional string of what the ID field is, if it is ever not ID.

boolean $pull_to_drafts

Whether to save to WordPress drafts when pulling from Salesforce.

boolean $check_only

Allows this method to only check for matching records, instead of making any data changes.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

user_update()

user_update(string  $user_id, array  $params, string  $id_field = 'ID') : array

Update a WordPress user.

Parameters

string $user_id

The ID for the user to be updated. This value needs to be in the array that is sent to wp_update_user.

array $params

Array of user data params.

string $id_field

Optional string of what the ID field is, if it is ever not ID.

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

Returns

array —

data: success: 1 "errors" : [ ],

user_delete()

user_delete(integer  $id, integer  $reassign = null) : boolean

Delete a WordPress user.

Parameters

integer $id

User ID.

integer $reassign

If we should reassign any posts to other users. We don't change this from NULL anywhere in this plugin.

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

Returns

boolean —

true if successful

post_create()

post_create(array  $params, string  $id_field = 'ID', string  $post_type = 'post') : array

Create a new WordPress post.

Parameters

array $params

Array of post data params.

string $id_field

Optional string of what the ID field is, if it is ever not ID.

string $post_type

Optional string for custom post type, if applicable.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

post_upsert()

post_upsert(string  $key, string  $value, array  $methods = array(), array  $params, string  $id_field = 'ID', boolean  $pull_to_drafts = false, string  $post_type = 'post', boolean  $check_only = false) : array

Create a new WordPress post or update it if a match is found.

Parameters

string $key

What key we are looking at for possible matches.

string $value

What value we are looking at for possible matches.

array $methods

What WordPress methods do we use to get the data, if there are any. otherwise, maybe will have to do a wpdb query.

array $params

Array of post data params.

string $id_field

optional string of what the ID field is, if it is ever not ID.

boolean $pull_to_drafts

Whether to save to WordPress drafts when pulling from Salesforce.

string $post_type

Optional string for custom post type, if applicable.

boolean $check_only

Allows this method to only check for matching records, instead of making any data changes.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

post_update()

post_update(string  $post_id, array  $params, string  $id_field = 'ID', string  $post_type = '') : array

Update a WordPress post.

Parameters

string $post_id

The ID for the post to be updated. This value needs to be in the array that is sent to wp_update_post.

array $params

Array of post data params.

string $id_field

Optional string of what the ID field is, if it is ever not ID.

string $post_type

Optional string for custom post type, if applicable.

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

Returns

array —

data: success: 1 "errors" : [ ],

post_delete()

post_delete(integer  $id, boolean  $force_delete = false) : mixed

Delete a WordPress post.

Parameters

integer $id

Post ID.

boolean $force_delete

If we should bypass the trash. We don't change this from FALSE anywhere in this plugin.

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

Returns

mixed —

post object if successful, false if failed

attachment_create()

attachment_create(array  $params, string  $id_field = 'ID') : array

Create a new WordPress attachment.

Parameters

array $params

Array of attachment data params.

string $id_field

Optional string of what the ID field is, if it is ever not ID.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

attachment_upsert()

attachment_upsert(string  $key, string  $value, array  $methods = array(), array  $params, string  $id_field = 'ID', boolean  $check_only = false) : array

Create a new WordPress attachment or update it if a match is found.

Parameters

string $key

What key we are looking at for possible matches.

string $value

What value we are looking at for possible matches.

array $methods

What WordPress methods do we use to get the data, if there are any. otherwise, maybe will have to do a wpdb query.

array $params

Array of attachment data params.

string $id_field

Optional string of what the ID field is, if it is ever not ID.

boolean $check_only

Allows this method to only check for matching records, instead of making any data changes.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

attachment_update()

attachment_update(string  $attachment_id, array  $params, string  $id_field = 'ID') : array

Update a WordPress attachment.

Parameters

string $attachment_id

The ID for the attachment to be updated. This value needs to be in the array that is sent to the update methods.

array $params

Array of attachment data params.

string $id_field

Optional string of what the ID field is, if it is ever not ID.

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

Returns

array —

data: success: 1 "errors" : [ ],

Note: this method uses wp_insert_attachment for core content fields as there isn't a corresponding method for updating these rows it does use wp_update_attachment_metadata for the meta fields, though. Developers should use hooks to change this, if it does not meet their needs.

attachment_delete()

attachment_delete(integer  $id, boolean  $force_delete = false) : mixed

Delete a WordPress attachment.

Parameters

integer $id

Attachment ID.

boolean $force_delete

If we should bypass the trash. We don't change this from FALSE anywhere in this plugin.

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

Returns

mixed —

attachment object if successful, false if failed

term_create()

term_create(array  $params, string  $taxonomy, string  $id_field = 'ID') : array

Create a new WordPress term.

Parameters

array $params

Array of term data params.

string $taxonomy

The taxonomy to which to add the term. this is required.

string $id_field

Optional string of what the ID field is, if it is ever not ID.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

term_upsert()

term_upsert(string  $key, string  $value, array  $methods = array(), array  $params, string  $taxonomy, string  $id_field = 'ID', boolean  $pull_to_drafts = false, boolean  $check_only = false) : array

Create a new WordPress term or update it if a match is found.

Parameters

string $key

What key we are looking at for possible matches.

string $value

What value we are looking at for possible matches.

array $methods

What WordPress methods do we use to get the data, if there are any. otherwise, maybe will have to do a wpdb query.

array $params

Array of term data params.

string $taxonomy

The taxonomy to which to add the term. this is required..

string $id_field

Optional string of what the ID field is, if it is ever not ID.

boolean $pull_to_drafts

Whether to save to WordPress drafts when pulling from Salesforce.

boolean $check_only

Allows this method to only check for matching records, instead of making any data changes.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

term_update()

term_update(string  $term_id, array  $params, string  $taxonomy, string  $id_field = 'ID') : array

Update a WordPress term.

Parameters

string $term_id

The ID for the term to be updated. This value needs to be in the array that is sent to wp_update_term.

array $params

Array of term data params.

string $taxonomy

The taxonomy to which to add the term. this is required.

string $id_field

Optional string of what the ID field is, if it is ever not ID.

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

Returns

array —

data: success: 1 "errors" : [ ],

term_delete()

term_delete(string  $term_id, string  $taxonomy) : boolean

Delete a WordPress term.

Parameters

string $term_id

The ID for the term to be updated. This value needs to be in the array that is sent to wp_update_term.

string $taxonomy

The taxonomy from which to delete the term. this is required.

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

Returns

boolean —

True if successful, false if failed.

comment_create()

comment_create(array  $params, string  $id_field = 'comment_ID') : array

Create a new WordPress comment.

Parameters

array $params

Array of comment data params.

string $id_field

Optional string of what the ID field is, if it is ever not comment_ID.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

comment_upsert()

comment_upsert(string  $key, string  $value, array  $methods, array  $params, string  $id_field = 'comment_ID', boolean  $pull_to_drafts = false, boolean  $check_only = false) : array

Create a new WordPress comment or update it if a match is found.

Parameters

string $key

What key we are looking at for possible matches.

string $value

What value we are looking at for possible matches.

array $methods

What WordPress methods do we use to get the data, if there are any. otherwise, maybe will have to do a wpdb query.

array $params

Array of comment data params.

string $id_field

Optional string of what the ID field is, if it is ever not comment_ID.

boolean $pull_to_drafts

Whether to save to WordPress drafts when pulling from Salesforce.

boolean $check_only

Allows this method to only check for matching records, instead of making any data changes.

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

Returns

array —

data: ID : 123, success: 1 "errors" : [ ],

comment_update()

comment_update(string  $comment_id, array  $params, string  $id_field = 'comment_ID') : array

Update a WordPress comment.

Parameters

string $comment_id

The ID for the comment to be updated. This value needs to be in the array that is sent to wp_update_comment.

array $params

Array of comment data params.

string $id_field

Optional string of what the ID field is, if it is ever not ID.

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

Returns

array —

data: success: 1 "errors" : [ ],

comment_delete()

comment_delete(integer  $id, boolean  $force_delete = false) : boolean

Delete a WordPress comment.

Parameters

integer $id

Comment ID.

boolean $force_delete

If we should bypass the trash. We don't change this from FALSE anywhere in this plugin.

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

Returns

boolean —

true if successful, false if failed.