Changeset 3351090
- Timestamp:
- 08/27/2025 10:31:29 AM (4 months ago)
- Location:
- naibabiji-b2b-product-showcase/trunk
- Files:
-
- 5 edited
-
includes/class-admin-settings.php (modified) (3 diffs)
-
includes/class-meta-fields.php (modified) (3 diffs)
-
includes/post-types.php (modified) (2 diffs)
-
naibabiji-b2b-product-showcase.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
naibabiji-b2b-product-showcase/trunk/includes/class-admin-settings.php
r3350010 r3351090 159 159 <h3><?php echo esc_html__('Usage Instructions', 'naibabiji-b2b-product-showcase'); ?></h3> 160 160 <ul> 161 <li><strong><?php echo esc_html__('Product Archive Page', 'naibabiji-b2b-product-showcase'); ?>:</strong> <?php echo esc_html__('Visit', 'naibabiji-b2b-product-showcase'); ?> <code><?php echo esc_url(home_url('/ naibb2pr-products/')); ?></code> <?php echo esc_html__('to view all products', 'naibabiji-b2b-product-showcase'); ?></li>161 <li><strong><?php echo esc_html__('Product Archive Page', 'naibabiji-b2b-product-showcase'); ?>:</strong> <?php echo esc_html__('Visit', 'naibabiji-b2b-product-showcase'); ?> <code><?php echo esc_url(home_url('/products/')); ?></code> <?php echo esc_html__('to view all products', 'naibabiji-b2b-product-showcase'); ?></li> 162 162 <li><strong><?php echo esc_html__('Shortcode', 'naibabiji-b2b-product-showcase'); ?>:</strong> <?php echo esc_html__('Use', 'naibabiji-b2b-product-showcase'); ?> <code>[naibabiji_b2b_products]</code> <?php echo esc_html__('to display product grid on any page', 'naibabiji-b2b-product-showcase'); ?></li> 163 163 <li><strong><?php echo esc_html__('Shortcode Parameters', 'naibabiji-b2b-product-showcase'); ?>:</strong> … … 172 172 </div> 173 173 </div> 174 174 <?php 175 175 // 添加内联样式 176 176 wp_add_inline_style( … … 192 192 }' 193 193 ); 194 <?php195 194 } 196 195 -
naibabiji-b2b-product-showcase/trunk/includes/class-meta-fields.php
r3350010 r3351090 350 350 351 351 /** 352 * 添加产品编辑页面的自定义样式 和设置模态框352 * 添加产品编辑页面的自定义样式 353 353 * 354 354 * @since 1.0.0 … … 357 357 global $post_type, $pagenow; 358 358 if ( 'naibb2pr_products' === $post_type && in_array( $pagenow, array( 'post.php', 'post-new.php' ), true ) ) { 359 $default_inquiry_url = get_option( 'naibabiji_b2b_product_default_inquiry_url', '' );360 $default_inquiry_text = get_option( 'naibabiji_b2b_product_inquiry_button_text', esc_html__( 'Get Quote', 'naibabiji-b2b-product-showcase' ) );361 362 359 // 添加内联样式 363 360 wp_add_inline_style( … … 369 366 width: 100%; 370 367 min-height: 80px; 371 }372 373 /* 设置模态框样式 */374 .naibabiji-b2b-settings-modal {375 display: none;376 position: fixed;377 z-index: 100000;378 left: 0;379 top: 0;380 width: 100%;381 height: 100%;382 background-color: rgba(0,0,0,0.5);383 }384 .naibabiji-b2b-settings-modal-content {385 background-color: #fefefe;386 margin: 5% auto;387 padding: 20px;388 border: 1px solid #888;389 width: 80%;390 max-width: 600px;391 border-radius: 5px;392 }393 .naibabiji-b2b-settings-close {394 color: #aaa;395 float: right;396 font-size: 28px;397 font-weight: bold;398 cursor: pointer;399 }400 .naibabiji-b2b-settings-close:hover {401 color: black;402 368 }' 403 369 ); 404 405 $save_success_msg = esc_js( __( 'Settings saved successfully! The page will refresh to show new settings.', 'naibabiji-b2b-product-showcase' ) );406 $save_failed_msg = esc_js( __( 'Save failed:', 'naibabiji-b2b-product-showcase' ) );407 $unknown_error_msg = esc_js( __( 'Unknown error', 'naibabiji-b2b-product-showcase' ) );408 409 // 添加内联脚本410 wp_add_inline_script(411 'naibabiji-b2b-product-showcase-admin-script',412 'function openSettingsModal() {413 document.getElementById("naibabijiB2bSettingsModal").style.display = "block";414 }415 416 function closeSettingsModal() {417 document.getElementById("naibabijiB2bSettingsModal").style.display = "none";418 }419 420 function saveSettings() {421 var form = document.getElementById("naibabijiB2bSettingsForm");422 var formData = new FormData(form);423 formData.append("action", "naibabiji_b2b_save_settings");424 425 fetch(ajaxurl, {426 method: "POST",427 body: formData428 })429 .then(function(response) {430 return response.json();431 })432 .then(function(data) {433 if (data.success) {434 alert("' . $save_success_msg . '");435 location.reload();436 } else {437 alert("' . $save_failed_msg . ' " + (data.data || "' . $unknown_error_msg . '"));438 }439 })440 .catch(function(error) {441 alert("' . $save_failed_msg . ' " + error.message);442 });443 }444 445 // 点击模态框外部关闭446 window.onclick = function(event) {447 var modal = document.getElementById("naibabijiB2bSettingsModal");448 if (event.target == modal) {449 closeSettingsModal();450 }451 }'452 );453 ?>454 <!-- 设置模态框 -->455 <div id="naibabijiB2bSettingsModal" class="naibabiji-b2b-settings-modal">456 <div class="naibabiji-b2b-settings-modal-content">457 <span class="naibabiji-b2b-settings-close" onclick="closeSettingsModal()">×</span>458 <h2><?php esc_html_e( 'B2B Product Showcase - Global Settings', 'naibabiji-b2b-product-showcase' ); ?></h2>459 <form id="naibabijiB2bSettingsForm">460 <table class="form-table">461 <tr>462 <th scope="row">463 <label for="naibabiji_b2b_product_default_inquiry_url"><?php esc_html_e( 'Default Inquiry Page URL:', 'naibabiji-b2b-product-showcase' ); ?></label>464 </th>465 <td>466 <input type="url" id="naibabiji_b2b_product_default_inquiry_url" name="naibabiji_b2b_product_default_inquiry_url"467 value="<?php echo esc_attr( $default_inquiry_url ); ?>" class="regular-text">468 </td>469 </tr>470 <tr>471 <th scope="row">472 <label for="naibabiji_b2b_product_inquiry_button_text"><?php esc_html_e( 'Default Inquiry Button Text:', 'naibabiji-b2b-product-showcase' ); ?></label>473 </th>474 <td>475 <input type="text" id="naibabiji_b2b_product_inquiry_button_text" name="naibabiji_b2b_product_inquiry_button_text"476 value="<?php echo esc_attr( $default_inquiry_text ); ?>" class="regular-text">477 </td>478 </tr>479 </table>480 <p class="submit">481 <button type="button" class="button button-primary" onclick="saveSettings()"><?php esc_html_e( 'Save Settings', 'naibabiji-b2b-product-showcase' ); ?></button>482 </p>483 </form>484 </div>485 </div>486 <?php487 370 } 488 371 } -
naibabiji-b2b-product-showcase/trunk/includes/post-types.php
r3350010 r3351090 51 51 'show_in_nav_menus' => true, 52 52 'can_export' => true, 53 'has_archive' => ' naibb2pr_products',53 'has_archive' => 'products', 54 54 'exclude_from_search' => false, 55 55 'publicly_queryable' => true, … … 57 57 'show_in_rest' => true, 58 58 'rewrite' => array( 59 'slug' => ' naibb2pr_products',59 'slug' => 'products', 60 60 'with_front' => false, 61 61 ), -
naibabiji-b2b-product-showcase/trunk/naibabiji-b2b-product-showcase.php
r3350010 r3351090 4 4 * Plugin URI: https://blog.naibabiji.com 5 5 * Description: Lightweight B2B product showcase plugin designed for corporate websites, without shopping cart functionality, focusing on product display and inquiry. 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: Naibabiji 8 8 * Text Domain: naibabiji-b2b-product-showcase … … 25 25 * 定义插件常量 26 26 */ 27 define( 'NAIBABIJI_B2B_PRODUCT_SHOWCASE_VERSION', '1.0. 6' );27 define( 'NAIBABIJI_B2B_PRODUCT_SHOWCASE_VERSION', '1.0.7' ); 28 28 define( 'NAIBABIJI_B2B_PRODUCT_SHOWCASE_AUTHOR', 'Naibabiji' ); 29 29 define( 'NAIBABIJI_B2B_PRODUCT_SHOWCASE_URI', 'https://blog.naibabiji.com' ); -
naibabiji-b2b-product-showcase/trunk/readme.txt
r3350010 r3351090 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 67 Stable tag: 1.0.7 8 8 License: GPL v2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 82 82 == Changelog == 83 83 84 = 1.0.7 = 85 * Changed product archive page URL from 'naibb2pr-products' to 'products' 86 * Fixed PHP syntax error in admin settings page 87 84 88 = 1.0.6 = 85 89 * Fixed an issue with WordPress official review feedback
Note: See TracChangeset
for help on using the changeset viewer.