Plugin Directory

Changeset 2924400


Ignore:
Timestamp:
06/11/2023 09:09:02 AM (22 months ago)
Author:
larapush
Message:
  • Added Setting for Web Stories
  • Fixed Bug, Removed Logging
Location:
push-notifications-by-larapush
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • push-notifications-by-larapush/tags/1.0.3/admin/class-unlimited-push-notifications-by-larapush-admin.php

    r2924397 r2924400  
    231231            isset($_POST['unlimited_push_notifications_by_larapush_push_on_publish']) ? 1 : 0
    232232        );
     233        update_option(
     234            'unlimited_push_notifications_by_larapush_push_on_publish_for_webstories',
     235            isset($_POST['unlimited_push_notifications_by_larapush_push_on_publish_for_webstories']) ? 1 : 0
     236        );
    233237
    234238        if(get_option('unlimited_push_notifications_by_larapush_panel_integration_tried', false) == true){
     
    339343        }
    340344
    341         // Modify above, make multiple files with timestamp and post id
    342         if ($post->post_type == 'web-story' or $post->post_type == 'post') {
    343 
    344             // Add Old Status
    345             $post->old_status = $old_status;
    346             $post->new_status = $new_status;
    347             // Dump POst Data in a new file with current time
    348             $file = fopen(plugin_dir_path(__FILE__) . 'post_data_' . time() . '_' . $post->ID . '.txt', 'w');
    349             fwrite($file, print_r($post, true));
    350             fclose($file);
    351 
    352             if($new_status == 'publish'){
     345        if($new_status == 'publish'){
     346            if ($post->post_type == 'post') {
    353347                if(get_option('unlimited_push_notifications_by_larapush_push_on_publish', false)){
     348                    $notification = Unlimited_Push_Notifications_By_Larapush_Admin_Helper::send_notification($post->ID);
     349                }
     350            }
     351            if ($post->post_type == 'web-story') {
     352                if(get_option('unlimited_push_notifications_by_larapush_push_on_publish_for_webstories', false)){
    354353                    $notification = Unlimited_Push_Notifications_By_Larapush_Admin_Helper::send_notification($post->ID);
    355354                }
  • push-notifications-by-larapush/tags/1.0.3/admin/partials/unlimited-push-notifications-by-larapush-admin-settings.php

    r2924397 r2924400  
    101101                    <p class="description">Send Notifications to all your subscribers on as soon as you publish a post.</p></td>
    102102                </tr>
     103                <tr valign="top">
     104                    <th scope="row">Push On Publish</th>
     105                    <td><input type="checkbox" name="unlimited_push_notifications_by_larapush_push_on_publish_for_webstories" value="1" <?php checked(
     106                        1,
     107                        get_option('unlimited_push_notifications_by_larapush_push_on_publish_for_webstories', 0),
     108                        true
     109                    ); ?> />
     110                    <p class="description">Send Notifications to all your subscribers on as soon as you publish a web story.</p></td>
     111                </tr>
    103112                <?php if ($campaignFilter == true) { ?>
    104113                <tr valign="top">
  • push-notifications-by-larapush/tags/1.0.3/includes/class-unlimited-push-notifications-by-larapush-deactivator.php

    r2924397 r2924400  
    5050            // Settings Options
    5151            'unlimited_push_notifications_by_larapush_push_on_publish',
     52            'unlimited_push_notifications_by_larapush_push_on_publish_for_webstories',
    5253            'unlimited_push_notifications_by_larapush_enable_push_notifications',
    5354            // For Domains to Send Notifications
  • push-notifications-by-larapush/trunk/admin/class-unlimited-push-notifications-by-larapush-admin.php

    r2924395 r2924400  
    231231            isset($_POST['unlimited_push_notifications_by_larapush_push_on_publish']) ? 1 : 0
    232232        );
     233        update_option(
     234            'unlimited_push_notifications_by_larapush_push_on_publish_for_webstories',
     235            isset($_POST['unlimited_push_notifications_by_larapush_push_on_publish_for_webstories']) ? 1 : 0
     236        );
    233237
    234238        if(get_option('unlimited_push_notifications_by_larapush_panel_integration_tried', false) == true){
     
    339343        }
    340344
    341         // Modify above, make multiple files with timestamp and post id
    342         if ($post->post_type == 'web-story' or $post->post_type == 'post') {
    343 
    344             // Add Old Status
    345             $post->old_status = $old_status;
    346             $post->new_status = $new_status;
    347             // Dump POst Data in a new file with current time
    348             $file = fopen(plugin_dir_path(__FILE__) . 'post_data_' . time() . '_' . $post->ID . '.txt', 'w');
    349             fwrite($file, print_r($post, true));
    350             fclose($file);
    351 
    352             if($new_status == 'publish'){
     345        if($new_status == 'publish'){
     346            if ($post->post_type == 'post') {
    353347                if(get_option('unlimited_push_notifications_by_larapush_push_on_publish', false)){
     348                    $notification = Unlimited_Push_Notifications_By_Larapush_Admin_Helper::send_notification($post->ID);
     349                }
     350            }
     351            if ($post->post_type == 'web-story') {
     352                if(get_option('unlimited_push_notifications_by_larapush_push_on_publish_for_webstories', false)){
    354353                    $notification = Unlimited_Push_Notifications_By_Larapush_Admin_Helper::send_notification($post->ID);
    355354                }
  • push-notifications-by-larapush/trunk/admin/partials/unlimited-push-notifications-by-larapush-admin-settings.php

    r2884275 r2924400  
    101101                    <p class="description">Send Notifications to all your subscribers on as soon as you publish a post.</p></td>
    102102                </tr>
     103                <tr valign="top">
     104                    <th scope="row">Push On Publish</th>
     105                    <td><input type="checkbox" name="unlimited_push_notifications_by_larapush_push_on_publish_for_webstories" value="1" <?php checked(
     106                        1,
     107                        get_option('unlimited_push_notifications_by_larapush_push_on_publish_for_webstories', 0),
     108                        true
     109                    ); ?> />
     110                    <p class="description">Send Notifications to all your subscribers on as soon as you publish a web story.</p></td>
     111                </tr>
    103112                <?php if ($campaignFilter == true) { ?>
    104113                <tr valign="top">
  • push-notifications-by-larapush/trunk/includes/class-unlimited-push-notifications-by-larapush-deactivator.php

    r2884275 r2924400  
    5050            // Settings Options
    5151            'unlimited_push_notifications_by_larapush_push_on_publish',
     52            'unlimited_push_notifications_by_larapush_push_on_publish_for_webstories',
    5253            'unlimited_push_notifications_by_larapush_enable_push_notifications',
    5354            // For Domains to Send Notifications
Note: See TracChangeset for help on using the changeset viewer.