Plugin Directory

Changeset 3426113


Ignore:
Timestamp:
12/23/2025 10:54:02 AM (3 months ago)
Author:
codersuraz
Message:

v1.0.21 displayed tags to single doc page
UI enhancements

Location:
deardocs/trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • deardocs/trunk/assets/admin/css/admin.css

    r3423603 r3426113  
    157157
    158158.deardocs-doc-card {
     159  display: flex;
     160  flex-direction: column;
    159161  background: #fff;
    160162  border: 1px solid #fff;
     
    193195  min-height: 50px;
    194196  padding: 10px;
     197  flex: 1;
    195198}
    196199
     
    202205
    203206.deardocs-doc-item {
     207  background-color: #fff;
    204208  display: flex;
    205209  align-items: center;
  • deardocs/trunk/assets/frontend/css/deardocs.css

    r3423603 r3426113  
    166166  display: flex;
    167167  flex-wrap: wrap;
     168  justify-content: center;
    168169  gap: 2rem;
    169170  max-width: 100%;
     
    795796}
    796797
     798.deardocs * {
     799  box-sizing: border-box;
     800}
    797801.deardocs-search {
    798802  position: relative;
     
    865869  width: 100%;
    866870  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);
    869872  z-index: 999;
    870873}
     
    886889  opacity: 1;
    887890  visibility: visible;
    888 }
    889 .deardocs-search-modal[aria-hidden=false] .deardocs-search-modal-content {
    890   transform: translateY(100px);
    891891}
    892892.deardocs-search-modal-content {
     
    899899  overflow: hidden;
    900900  position: relative;
    901   transform: translateY(-20px);
     901  transform: translateY(100%);
    902902  transition: transform 0.3s ease;
    903903  z-index: 9999;
     
    13951395  padding-bottom: 1rem;
    13961396}
     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  
    33Plugin Name: DearDocs
    44Description: Create beautiful documentation, knowledge base, and help center for your WordPress site. Perfect for product docs, FAQs, and user guides.
    5 Version: 1.0.20
     5Version: 1.0.21
    66Author: Surya Prasad Khanal
    77Author URI: https://www.suryakhanal.com.np
     
    1515}
    1616
    17 define( "DEARDOCS_VERSION", "1.0.20" );
     17define( "DEARDOCS_VERSION", "1.0.21" );
    1818
    1919define( "DEARDOCS_PLUGIN_DIR", plugin_dir_path( __FILE__ ) );
  • deardocs/trunk/includes/Admin/Admin.php

    r3423603 r3426113  
    3636        // add admin assets
    3737        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']);
    3841
    3942        add_action('created_deardocs_category', [$this, 'set_category_initial_order'], 10, 1);
     
    5659       
    5760        // 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
    5963    }
    6064
     
    301305        $new_columns['order'] = __('Order', 'deardocs');
    302306        $new_columns['parent'] = __('Parent', 'deardocs');
     307        $new_columns['feedback'] = __('Feedback', 'deardocs');
    303308
    304309        unset($columns['cb'], $columns['title']);
     
    319324            case 'parent':
    320325                $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                );
    321339                break;
    322340        }
     
    601619        <?php
    602620    }
     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    }
    603634}
  • deardocs/trunk/includes/Core/Post_Types.php

    r3423603 r3426113  
    2424        add_action('init', [$this, 'register_doc_post_type']);
    2525        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        );
    2654    }
    2755
     
    6896                'page-attributes',
    6997                'comments',
     98                'custom-fields',
    7099            ],
    71100        ];
  • deardocs/trunk/includes/Frontend/Frontend.php

    r3423603 r3426113  
    452452        update_post_meta( $post_id, $meta_key, $current_count + 1 );
    453453
    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 ] );
    455455    }
    456456   
  • deardocs/trunk/readme.txt

    r3423603 r3426113  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.0.20
     7Stable tag: 1.0.21
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6161== Changelog ==
    6262
     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
    6368= 1.0.20 =
    6469* Added FAQ Builder feature with `[deardocs_faq]` shortcode
  • deardocs/trunk/templates/single-deardocs.php

    r3419718 r3426113  
    6767
    6868                <footer class="deardocs-entry-footer">
     69                    <?php deardocs_get_template_part('components/tags'); ?>
    6970                    <?php deardocs_get_template_part('components/navigation-links'); ?>
    7071                    <?php deardocs_get_template_part('components/feedback'); ?>
Note: See TracChangeset for help on using the changeset viewer.