Changeset 2388400
- Timestamp:
- 09/25/2020 03:50:58 PM (6 years ago)
- Location:
- pushnami-web-push-notifications
- Files:
-
- 14 added
- 4 edited
-
tags/1.0.4 (added)
-
tags/1.0.4/assets (added)
-
tags/1.0.4/assets/tmp (added)
-
tags/1.0.4/assets/tmp/advanced-script.js.tmp (added)
-
tags/1.0.4/assets/tmp/manifest.json.tmp (added)
-
tags/1.0.4/assets/tmp/service-worker.js.tmp (added)
-
tags/1.0.4/includes (added)
-
tags/1.0.4/includes/class-pushnami.php (added)
-
tags/1.0.4/pushnami.php (added)
-
tags/1.0.4/readme.txt (added)
-
tags/1.0.4/uninstall.php (added)
-
tags/1.0.4/views (added)
-
tags/1.0.4/views/admin (added)
-
tags/1.0.4/views/admin/pushnami-settings.php (added)
-
trunk/includes/class-pushnami.php (modified) (4 diffs)
-
trunk/pushnami.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/views/admin/pushnami-settings.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pushnami-web-push-notifications/trunk/includes/class-pushnami.php
r2317588 r2388400 436 436 $options->api_url = get_option('pushnami_api_url'); 437 437 $options->prompt = !(get_option('pushnami_prompt') === '0'); 438 $options->update = !(get_option('pushnami_update') === '0') ;438 $options->update = !(get_option('pushnami_update') === '0') || get_option('track_category'); 439 439 $options->optin = get_option('pushnami_advanced_optin'); 440 440 $options->trigger = get_option('pushnami_prompt_trigger'); … … 487 487 else $prompt_options = ''; 488 488 489 $update_options = array(); 490 // Get post categories 491 $categories = get_the_category(); 492 if (!empty($categories)) { 493 // In case of multiple post categories, use the first one 494 $category = $categories[0]->name; 495 array_push($update_options, '"last_category":"' . $category . '"'); 496 } 497 if (sizeof($update_options) 498 && get_option('track_category') === '1' 499 ) { 500 $update_options = '{' . join(',', $update_options) . '}'; 501 } 502 else $update_options = ''; 503 489 504 $script_options = ''; 490 505 … … 499 514 $script_options .= 'Pushnami'; 500 515 // if ($options->swPath) $script_options .= PHP_EOL . ' .setSWPath(\''.$options->swPath.'\')'; 501 if ($options->update) $script_options .= PHP_EOL . ' .update( )';516 if ($options->update) $script_options .= PHP_EOL . ' .update(' . $update_options . ')'; 502 517 if ($options->optin) $script_options .= PHP_EOL . ' .showOverlay({force:true})'; 503 518 if ($options->prompt) $script_options .= PHP_EOL . ' .prompt(' . $prompt_options . ')'; … … 538 553 !get_option('pushnami_advanced_optin') && 539 554 !get_option('pushnami_prompt_trigger') && 540 !get_option('pushnami_prompt_delay') 555 !get_option('pushnami_prompt_delay') && 556 !get_option('track_category') 541 557 ); 542 558 } -
pushnami-web-push-notifications/trunk/pushnami.php
r2344190 r2388400 7 7 Plugin URI: https://wordpress.org/plugins/pushnami-web-push-notifications 8 8 Description: Capture & Monetize Your Audience. The leader for web push, mobile push notifications, and email. Trusted by more than 20K brands to send 10 billion messages per month. 9 Version: 1.0. 49 Version: 1.0.5 10 10 Author: Pushnami 11 11 Author URI: https://www.pushnami.com -
pushnami-web-push-notifications/trunk/readme.txt
r2363564 r2388400 59 59 == Changelog == 60 60 61 = 1.0.5 = 62 * Adds settings option to capture category of last article read by a subscriber 63 61 64 = 1.0.4 = 62 65 * Updates Pushnami free account sign-up links -
pushnami-web-push-notifications/trunk/views/admin/pushnami-settings.php
r2344194 r2388400 91 91 } else { 92 92 $('#prompt_update_error').css('display', 'none'); 93 $('#submit_button').prop('disabled', false); 94 } 95 }); 96 97 $('#track_category').click(function (event) { 98 const promptChecked = event.target.checked; 99 const updateChecked = $('#pushnami_update').prop("checked"); 100 if (!promptChecked && !updateChecked) { 101 $('#submit_button').prop('disabled', true); 102 } else { 93 103 $('#submit_button').prop('disabled', false); 94 104 } … … 248 258 } 249 259 260 if(isset($_POST['track_category']) && !empty($_POST['track_category'])) { 261 update_option('track_category', '1'); 262 } else { 263 update_option('track_category', '0'); 264 } 265 250 266 if(isset($_POST['pushnami_update']) && !empty($_POST['pushnami_update'])) { 251 267 update_option('pushnami_update', '1'); … … 356 372 <?php 357 373 $checked = !(get_option('pushnami_prompt') === '0'); 374 checked($checked); 375 ?> 376 /> 377 </td> 378 </tr> 379 <tr valign="top" class="advanced_option"> 380 <th scope="row">Track Categories Read</th> 381 <td> 382 <input 383 type="checkbox" 384 name="track_category" 385 id="track_category" 386 value="true" 387 <?php 388 $checked = !(get_option('track_category') === '0'); 358 389 checked($checked); 359 390 ?>
Note: See TracChangeset
for help on using the changeset viewer.