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 | |
/** | |
* An example function used to demonstrate how to use the `user_can_save` function | |
* that provides boilerplate security checks when saving custom post meta data. | |
* | |
* The ultimate goal is provide a simple helper function to be used in themes and | |
* plugins without the need to use a set of complex conditionals and constants. | |
* | |
* Instead, the aim is to have a simplified function that's easy to read and that uses | |
* WordPress APIs. |
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 | |
function analytics_confirmation($confirmation, $form, $entry, $ajax = 0) | |
{ | |
$isProduct = false; | |
foreach ($form['fields'] as $field) { | |
if ($field['type'] == 'product') { | |
$isProduct = true; | |
$fieldID = $field['id']; | |
$productSKU = $form['id'] . '-' . str_replace(" ", "_", $field['label']); | |
break; |