Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Modules_Reviews::review_alert( array $alerts = array() )
Register alert when review request is available.
Description Description
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Parameters Parameters
- $alerts
-
(Optional)
Default value: array()
Return Return
(array)
Source Source
File: includes/modules/reviews.php
public static function review_alert( $alerts = array() ) { if ( self::hide_notices() ) { return $alerts; } $trigger = self::get_current_trigger(); // Used to anonymously distinguish unique site+user combinations in terms of effectiveness of each trigger. $uuid = wp_hash( home_url() . '-' . get_current_user_id() ); ob_start(); ?> <script type="text/javascript"> window.pum_review_nonce = '<?php echo wp_create_nonce( 'pum_review_action' ); ?>'; window.pum_review_api_url = '<?php echo self::$api_url; ?>'; window.pum_review_uuid = '<?php echo $uuid; ?>'; window.pum_review_trigger = { group: '<?php echo self::get_trigger_group(); ?>', code: '<?php echo self::get_trigger_code(); ?>', pri: '<?php echo self::get_current_trigger( 'pri' ); ?>' }; </script> <ul> <li> <a class="pum-dismiss" target="_blank" href="<?php echo $trigger['link']; ?>>" data-reason="am_now"> <strong><?php _e( 'Ok, you deserve it', 'popup-maker' ); ?></strong> </a> </li> <li> <a href="#" class="pum-dismiss" data-reason="maybe_later"> <?php _e( 'Nope, maybe later', 'popup-maker' ); ?> </a> </li> <li> <a href="#" class="pum-dismiss" data-reason="already_did"> <?php _e( 'I already did', 'popup-maker' ); ?> </a> </li> </ul> <?php $html = ob_get_clean(); $alerts[] = array( 'code' => 'review_request', 'message' => '<strong>' . $trigger['message'] . '<br />~ danieliser' . '</strong>', 'html' => $html, 'type' => 'success', ); return $alerts; }
Expand full source code Collapse full source code View on Trac