✏️ 正在编辑: notifications.php
路径:
/home/h359620/public_html/wp-content/themes/datis/woocommerce/myaccount/notifications.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php defined('ABSPATH') || exit; $user_id = get_current_user_id(); $current_page = max(1, absint(get_query_var('paged'))); $per_page = (int) apply_filters('datis_myaccount_notifications_per_page', 6, $user_id); /** * Notices query */ $q = Datis_Notices::get_user_notices($user_id, [ 'posts_per_page' => $per_page, 'paged' => $current_page, ]); $total_pages = ($q instanceof WP_Query) ? (int) $q->max_num_pages : 0; $demo = get_option('datis_active_demo'); ?> <div class="notice-shell"> <div class="notice-card"> <?php if ($q instanceof WP_Query && $q->have_posts()) : ?> <div class="notice-titlebar"> <h2 class="notice-title mb-4"><?php echo esc_html_x('Notifications', 'Notifications title', 'datis'); ?></h2> </div> <div class="notice-list" data-accordion="true"> <?php while ($q->have_posts()) : $q->the_post(); $id = get_the_ID(); $excerpt = get_the_excerpt(); if (!$excerpt) { $excerpt = wp_trim_words(wp_strip_all_tags(get_the_content(null, false, $id)), 22, '…'); } ?> <article class="notice-item" data-id="<?php echo esc_attr($id); ?>"> <button class="notice-item-toggle d-flex flex-row align-items-center justify-content-between gap-5 w-100" type="button" aria-expanded="false" aria-controls="notice-panel-<?php echo esc_attr($id); ?>"> <span class="notice-item-main d-flex flex-column gap-2"> <span class="notice-item-head d-flex flex-row align-items-center justify-content-start gap-2"> <span class="notice-item-bell" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M9.10745 2.67414C9.98414 2.24187 10.9649 2 12 2C15.7274 2 18.7491 5.13623 18.7491 9.00497V9.70957C18.7491 10.5552 18.9903 11.3818 19.4422 12.0854L20.5496 13.8095C21.5612 15.3843 20.789 17.5249 19.0296 18.0229C14.4273 19.3257 9.57274 19.3257 4.97036 18.0229C3.21105 17.5249 2.43882 15.3843 3.45036 13.8095L4.5578 12.0854C5.00972 11.3818 5.25087 10.5552 5.25087 9.70957V9.00497C5.25087 7.93058 5.48391 6.91269 5.90039 6.00277" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" /> <path d="M7.5 19C8.15503 20.7478 9.92246 22 12 22C12.2445 22 12.4847 21.9827 12.7192 21.9492M16.5 19C16.2329 19.7126 15.781 20.3428 15.1985 20.8393" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> <span class="notice-item-title"><?php the_title(); ?></span> </span> <span class="notice-item-excerpt"><?php echo esc_html($excerpt); ?></span> </span> <span class="notice-item-action" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12 4L12 14M12 14L15 11M12 14L9 11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 20C7.58172 20 4 16.4183 4 12M20 12C20 14.5264 18.8289 16.7792 17 18.2454" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> </button> <div class="notice-panel" id="notice-panel-<?php echo esc_attr($id); ?>" role="region" aria-hidden="true"> <div class="notice-panel-inner"> <div class="notice-panel-title"><?php the_title(); ?></div> <div class="notice-panel-content"> <?php the_content(); ?> </div> <div class="notice-panel-meta"> <small><?php echo esc_html(get_the_date()); ?></small> </div> </div> </div> </article> <?php endwhile; wp_reset_postdata(); ?> </div> <?php if ($total_pages > 1 && class_exists('Datis_Pagination')) : ?> <div class="notice-pagination mt-4"> <?php echo Datis_Pagination::get_instance()->render(null, [ 'total' => $total_pages, 'current' => $current_page, 'base_url' => wc_get_account_endpoint_url('notifications'), 'format' => 'page/%#%/', 'wrap_class' => 'datis-pagination-list', 'item_class' => 'datis-pagination-item', 'current_class' => 'is-current', ]); ?> </div> <?php endif; ?> <?php else : ?> <div class="notice-empty d-flex flex-column align-items-center justify-content-center gap-3 w-100"> <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect width="100" height="100" rx="20" fill="currentColor" fill-opacity="0.08" /> <path d="M54.5 38.9081C51.8524 37.3765 48.7786 36.5 45.5 36.5C35.5589 36.5 27.5 44.5589 27.5 54.5C27.5 57.3794 28.1761 60.1009 29.3782 62.5144C29.6977 63.1558 29.804 63.8889 29.6188 64.5811L28.5467 68.588C28.0813 70.3274 29.6726 71.9187 31.412 71.4533L35.4189 70.3812C36.1111 70.196 36.8442 70.3023 37.4856 70.6218C39.8991 71.8239 42.6206 72.5 45.5 72.5C55.4411 72.5 63.5 64.4411 63.5 54.5C63.5 51.2214 62.6235 48.1476 61.0919 45.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" /> <path d="M63.5 55.6291C63.6496 55.5668 63.7979 55.502 63.9449 55.4348C64.7596 55.0627 65.6737 54.9235 66.5389 55.155L67.61 55.4416C69.7842 56.0234 71.7734 54.0342 71.1916 51.86L70.905 50.7889C70.6735 49.9236 70.8127 49.0096 71.1848 48.1949C72.0294 46.346 72.5 44.2904 72.5 42.125C72.5 39.2583 71.6752 36.5843 70.25 34.3272M44.375 36.4901C46.5814 31.2102 51.7949 27.5 57.875 27.5C60.7744 27.5 63.4768 28.3437 65.75 29.7991" stroke="currentColor" stroke-width="2" stroke-linecap="round" /> <path d="M37.6645 54.5H37.6848M45.5187 54.5H45.5389M53.3734 54.5H53.3937" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <p><?php echo esc_html_x('You have no notifications yet.', 'Notifications empty', 'datis'); ?></p> <a class="notice-empty-action" href="<?php echo esc_url(function_exists('wc_get_account_endpoint_url') ? wc_get_account_endpoint_url('dashboard') : home_url('/')); ?>"> <?php if ($demo == 'industry') : ?> <svg width="14" height="13" viewBox="0 0 14 13" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12.7701 11.8579L10.8921 10.2077M0.750669 1.29699L9.2183 0.750029M0.750669 1.29699L1.29763 9.76463M0.750669 1.29699L8.63844 8.22758" stroke="#F5F5F5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> </svg> <?php elseif ($demo == 'business'): ?> <svg width="44" height="40" viewBox="0 0 44 40" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M10 40C4.47715 40 -1.95703e-07 35.5228 -4.37114e-07 30L-1.31134e-06 10C-1.55275e-06 4.47715 4.47715 -1.95703e-07 10 -4.37114e-07L33.1922 -1.45088e-06C39.6979 -1.73525e-06 44.4715 6.11389 42.8937 12.4254L37.8937 32.4254C36.7807 36.877 32.7809 40 28.1922 40L10 40Z" fill="#F9E65C" /> <path d="M15.3433 15.3139H22.3286M15.3433 15.3139V22.2992M15.3433 15.3139L21.4554 21.4261M24.657 24.6276L23.2017 23.1724" stroke="#0A2647" stroke-width="1.23483" stroke-linecap="round" stroke-linejoin="round" /> </svg> <?php else : ?> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M6 6H15M6 6V15M6 6L12.5 12.5M18 18L15.5 15.5" stroke="#F7F6FE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path> </svg> <?php endif; ?> <?php if ($demo == 'industry' || $demo == 'business') : echo esc_html_x('Go to dashboard', 'Notifications empty action', 'datis'); else : ?> <span><?php echo esc_html_x('Go to dashboard', 'Notifications empty action', 'datis'); ?></span> <?php endif; ?> </a> </div> <?php endif; ?> </div> </div>
💾 保存文件
← 返回文件管理器