Changeset 3426113
- Timestamp:
- 12/23/2025 10:54:02 AM (3 months ago)
- Location:
- deardocs/trunk
- Files:
-
- 2 added
- 8 edited
-
assets/admin/css/admin.css (modified) (3 diffs)
-
assets/admin/js/editor.js (added)
-
assets/frontend/css/deardocs.css (modified) (6 diffs)
-
deardocs.php (modified) (2 diffs)
-
includes/Admin/Admin.php (modified) (5 diffs)
-
includes/Core/Post_Types.php (modified) (2 diffs)
-
includes/Frontend/Frontend.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
templates/components/tags.php (added)
-
templates/single-deardocs.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
deardocs/trunk/assets/admin/css/admin.css
r3423603 r3426113 157 157 158 158 .deardocs-doc-card { 159 display: flex; 160 flex-direction: column; 159 161 background: #fff; 160 162 border: 1px solid #fff; … … 193 195 min-height: 50px; 194 196 padding: 10px; 197 flex: 1; 195 198 } 196 199 … … 202 205 203 206 .deardocs-doc-item { 207 background-color: #fff; 204 208 display: flex; 205 209 align-items: center; -
deardocs/trunk/assets/frontend/css/deardocs.css
r3423603 r3426113 166 166 display: flex; 167 167 flex-wrap: wrap; 168 justify-content: center; 168 169 gap: 2rem; 169 170 max-width: 100%; … … 795 796 } 796 797 798 .deardocs * { 799 box-sizing: border-box; 800 } 797 801 .deardocs-search { 798 802 position: relative; … … 865 869 width: 100%; 866 870 height: 100%; 867 background-color: rgba(15, 23, 42, 0.8); 868 backdrop-filter: blur(4px); 871 background-color: rgba(0, 0, 0, 0.404); 869 872 z-index: 999; 870 873 } … … 886 889 opacity: 1; 887 890 visibility: visible; 888 }889 .deardocs-search-modal[aria-hidden=false] .deardocs-search-modal-content {890 transform: translateY(100px);891 891 } 892 892 .deardocs-search-modal-content { … … 899 899 overflow: hidden; 900 900 position: relative; 901 transform: translateY( -20px);901 transform: translateY(100%); 902 902 transition: transform 0.3s ease; 903 903 z-index: 9999; … … 1395 1395 padding-bottom: 1rem; 1396 1396 } 1397 1398 .deardocs-tags { 1399 display: flex; 1400 align-items: center; 1401 flex-wrap: wrap; 1402 gap: 1rem; 1403 margin-bottom: 2rem; 1404 } 1405 .deardocs-tags-label { 1406 font-weight: 600; 1407 color: #333; 1408 font-size: 0.9rem; 1409 } 1410 .deardocs-tags-list { 1411 display: flex; 1412 flex-wrap: wrap; 1413 gap: 0.5rem; 1414 list-style: none; 1415 margin: 0; 1416 padding: 0; 1417 } 1418 .deardocs-tags-list li { 1419 margin: 0; 1420 } 1421 .deardocs-tags-list a { 1422 display: inline-block; 1423 padding: 0.25rem 1rem; 1424 background-color: #f8f9fa; 1425 color: #666; 1426 border-radius: 50px; 1427 font-size: 0.875rem; 1428 text-decoration: none; 1429 transition: 0.2s ease; 1430 border: 1px solid transparent; 1431 } 1432 .deardocs-tags-list a:hover { 1433 background-color: rgba(0, 124, 186, 0.1); 1434 color: #007cba; 1435 border-color: rgba(0, 124, 186, 0.2); 1436 } -
deardocs/trunk/deardocs.php
r3423603 r3426113 3 3 Plugin Name: DearDocs 4 4 Description: Create beautiful documentation, knowledge base, and help center for your WordPress site. Perfect for product docs, FAQs, and user guides. 5 Version: 1.0.2 05 Version: 1.0.21 6 6 Author: Surya Prasad Khanal 7 7 Author URI: https://www.suryakhanal.com.np … … 15 15 } 16 16 17 define( "DEARDOCS_VERSION", "1.0.2 0" );17 define( "DEARDOCS_VERSION", "1.0.21" ); 18 18 19 19 define( "DEARDOCS_PLUGIN_DIR", plugin_dir_path( __FILE__ ) ); -
deardocs/trunk/includes/Admin/Admin.php
r3423603 r3426113 36 36 // add admin assets 37 37 add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] ); 38 39 // Enqueue block editor assets 40 add_action('enqueue_block_editor_assets', [$this, 'enqueue_block_editor_assets']); 38 41 39 42 add_action('created_deardocs_category', [$this, 'set_category_initial_order'], 10, 1); … … 56 59 57 60 // Add doc deletion handler 58 add_action('wp_ajax_deardocs_delete_doc', [$this, 'handle_delete_doc']); 61 add_action( 'wp_ajax_deardocs_delete_doc', [$this, 'handle_delete_doc']); 62 59 63 } 60 64 … … 301 305 $new_columns['order'] = __('Order', 'deardocs'); 302 306 $new_columns['parent'] = __('Parent', 'deardocs'); 307 $new_columns['feedback'] = __('Feedback', 'deardocs'); 303 308 304 309 unset($columns['cb'], $columns['title']); … … 319 324 case 'parent': 320 325 $this->render_doc_parent($post_id); 326 break; 327 case 'feedback': 328 $yes_count = (int)get_post_meta($post_id, '_deardocs_helpful_yes', true); 329 $no_count = (int)get_post_meta($post_id, '_deardocs_helpful_no', true); 330 echo sprintf( 331 '<span style="color: #46b450;" title="%1$s">%2$s: %3$d</span> | <span style="color: #dc3232;" title="%4$s">%5$s: %6$d</span>', 332 __('Helpful', 'deardocs'), 333 __('Yes', 'deardocs'), 334 esc_html($yes_count), 335 __('Not Helpful', 'deardocs'), 336 __('No', 'deardocs'), 337 esc_html($no_count) 338 ); 321 339 break; 322 340 } … … 601 619 <?php 602 620 } 621 /** 622 * Enqueue block editor assets 623 * @return void 624 */ 625 public function enqueue_block_editor_assets(): void { 626 wp_enqueue_script( 627 'deardocs-editor', 628 DEARDOCS_PLUGIN_URL . 'assets/admin/js/editor.js', 629 ['wp-plugins', 'wp-edit-post', 'wp-element', 'wp-components', 'wp-data'], 630 DEARDOCS_VERSION, 631 true 632 ); 633 } 603 634 } -
deardocs/trunk/includes/Core/Post_Types.php
r3423603 r3426113 24 24 add_action('init', [$this, 'register_doc_post_type']); 25 25 add_action('init', [$this, 'register_faq_post_type']); 26 add_action('init', [$this, 'register_meta']); 27 } 28 29 /** 30 * Register post meta 31 * @return void 32 */ 33 public function register_meta(): void { 34 register_post_meta( 35 'deardocs', 36 '_deardocs_helpful_yes', 37 array( 38 'show_in_rest' => true, 39 'single' => true, 40 'type' => 'integer', 41 'auth_callback'=> function() { return current_user_can( 'edit_posts' ); }, 42 ) 43 ); 44 register_post_meta( 45 'deardocs', 46 '_deardocs_helpful_no', 47 array( 48 'show_in_rest' => true, 49 'single' => true, 50 'type' => 'integer', 51 'auth_callback'=> function() { return current_user_can( 'edit_posts' ); }, 52 ) 53 ); 26 54 } 27 55 … … 68 96 'page-attributes', 69 97 'comments', 98 'custom-fields', 70 99 ], 71 100 ]; -
deardocs/trunk/includes/Frontend/Frontend.php
r3423603 r3426113 452 452 update_post_meta( $post_id, $meta_key, $current_count + 1 ); 453 453 454 wp_send_json_success( [ 'message' => __( 'Thank you for your feedback!', 'deardocs' ) ] );454 wp_send_json_success( [ 'message' => __( 'Thank you for your feedback!', 'deardocs' ), 'count' => $current_count + 1 ] ); 455 455 } 456 456 -
deardocs/trunk/readme.txt
r3423603 r3426113 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0.2 07 Stable tag: 1.0.21 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 61 61 == Changelog == 62 62 63 = 1.0.21 = 64 * Fixed issue with meta data not being saved in editor 65 * Tags are now visible in the single doc page 66 * UI Improvements 67 63 68 = 1.0.20 = 64 69 * Added FAQ Builder feature with `[deardocs_faq]` shortcode -
deardocs/trunk/templates/single-deardocs.php
r3419718 r3426113 67 67 68 68 <footer class="deardocs-entry-footer"> 69 <?php deardocs_get_template_part('components/tags'); ?> 69 70 <?php deardocs_get_template_part('components/navigation-links'); ?> 70 71 <?php deardocs_get_template_part('components/feedback'); ?>
Note: See TracChangeset
for help on using the changeset viewer.