| @@ -17,13 +17,15 @@ | ||
| 17 | 17 | $disabled = 'disabled'; |
| 18 | 18 | $published = __( 'Published', 'depicter' ); |
| 19 | 19 | $noticeText = ''; |
| 20 | 20 | |
| 21 | -if ( $isNotPublished ) { | |
| 22 | - $noticeText = __( 'This slider is not published yet and will not be visible to the visitors. Open the editor and publish now. This notice is only visible to you.', 'depicter' ); | |
| 21 | +if ( ! $isPublishedBefore ) { | |
| 22 | + $noticeText = __( 'This slider is not published yet and is not visible to visitors. Open the editor and publish now. This notice is only visible to you.', 'depicter' ); | |
| 23 | 23 | } elseif ( $documentStatus == 'draft' ) { |
| 24 | 24 | $noticeText = __( 'This slider has unpublished changes. Publish the changes to see the final result.', 'depicter' ); |
| 25 | 25 | } |
| 26 | + | |
| 27 | +$documentID = $documentID ?? 0; | |
| 26 | 28 | ?> |
| 27 | 29 | <div class="depicter-editor-notice"> |
| 28 | 30 | <?php |
| 29 | 31 | if ( $documentStatus == 'draft' ) { |
| @@ -38,11 +40,11 @@ | ||
| 38 | 40 | } |
| 39 | 41 | ?> |
| 40 | 42 | |
| 41 | 43 | <div class="depicter-notice-btns"> |
| 42 | - <button class="depicter-edit-slider elementor-button"><?php echo esc_html__( 'Edit Slider', 'depicter' );?></button> | |
| 43 | - <button class="depicter-publish-slider elementor-button elementor-button-success" <?php echo esc_attr( $disabled );?>> | |
| 44 | + <button class="depicter-edit-slider elementor-button" data-document-id="<?php echo esc_attr( $documentID );?>"><?php echo esc_html__( 'Edit Slider', 'depicter' );?></button> | |
| 45 | + <button class="depicter-publish-slider elementor-button elementor-button-success" data-document-id="<?php echo esc_attr( $documentID );?>" <?php echo esc_attr( $disabled );?>> | |
| 44 | 46 | <span class="btn-label"> <?php echo esc_html( $published );?></span> |
| 45 | 47 | <span class="depicter-state-icon" style="display: none;"></span> |
| 46 | 48 | </button> |
| 47 | 49 | </div> |
| 48 | -</div> | |
| 50 | +</div> | |