Plugin Directory

Changeset 2536006


Ignore:
Timestamp:
05/23/2021 08:23:42 AM (5 years ago)
Author:
re_enter_rupok
Message:

Version 1.7.6

Location:
betterdocs
Files:
179 added
13 edited

Legend:

Unmodified
Added
Removed
  • betterdocs/trunk/README.txt

    r2523266 r2536006  
    44Tags:  knowledge base, docs, documentation, documents, wiki, faq page, doc, knowledge, table of content, TOC, knowledgebase, faqs, doc page, best documentation plugin, support ticket, customer support, instant answer bot, bot, help articles, better docs
    55Requires at least: 4.0
    6 Tested up to: 5.7.1
    7 Stable tag: 1.7.5
     6Tested up to: 5.7.2
     7Stable tag: 1.7.6
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8282Got multiple products? You can easily create multiple knowledge-bases for your different products and provide instant support to your customers from one place
    8383
     84## 🔒 MANAGE INTERNAL KNOWLEDGE BASE (PRO) ##
     85
     86Restrict your knowledge base based on certain user roles and manage Internal Knowledge Base to make your documentation private
     87
    8488## 📔 DESIGN STUNNING MULTIPLE KNOWLEDGE BASES WITH ELEMENTOR (PRO) ##
    8589
     
    153157
    154158== Changelog ==
     159
     160= 1.7.6 - 23/05/2021 =
     161- Fixed: PHP error in the BetterDocs admin page
     162
    155163= 1.7.5 - 29/04/2021 =
    156164- Added: menu_order param to the list of rest api orderby value for docs
  • betterdocs/trunk/admin/assets/js/betterdocs-admin.js

    r2436174 r2536006  
    157157    $.betterdocsAdmin.initializeFields = function () {
    158158        $.betterdocsAdmin.innerTab();
    159         if (
    160             $(".betterdocs-meta-field, .betterdocs-settings-field").length > 0
    161         ) {
     159        if ($(".betterdocs-meta-field, .betterdocs-settings-field").length > 0) {
    162160            $(".betterdocs-meta-field, .betterdocs-settings-field").map(
    163161                function (iterator, item) {
     
    182180        }
    183181
    184         $(
    185             ".betterdocs-metabox-wrapper .betterdocs-meta-field, .betterdocs-settings-field"
    186         ).trigger("change");
     182        $(".betterdocs-settings-field.betterdocs-select").on("select2:select", function (evt) {
     183            let $values = $(this).val();
     184            const isNotEqual = (a, b) => JSON.stringify(a) !== JSON.stringify(b);
     185            if (isNotEqual($values, ["all"])) {
     186                let $filtered = $values.filter(function($value, index, arr) {
     187                    return $value != 'all';
     188                });
     189                $(this).val($filtered);
     190                $(this).trigger('change');
     191            }
     192        });
     193
     194        $(".betterdocs-metabox-wrapper .betterdocs-meta-field, .betterdocs-settings-field").trigger("change");
    187195
    188196        if ($(".betterdocs-colorpicker-field").length > 0) {
  • betterdocs/trunk/admin/class-betterdocs-admin.php

    r2522453 r2536006  
    9292
    9393        $tax = function_exists('get_current_screen') ? get_current_screen() : '';
    94         if (!in_array($hook, array('toplevel_page_betterdocs-admin', 'betterdocs_page_betterdocs-settings', 'betterdocs_page_betterdocs-analytics', 'edit-tags.php', 'edit.php'))) {
     94        if (!in_array($hook, array('toplevel_page_betterdocs-admin', 'betterdocs_page_betterdocs-settings', 'betterdocs_page_betterdocs-analytics'))) {
    9595            if ($tax->taxonomy !== 'doc_category') {
    9696                return;
     
    120120    public function enqueue_scripts( $hook ) {
    121121        $tax = function_exists('get_current_screen') ? get_current_screen() : '';
    122         if (!in_array($hook, array('toplevel_page_betterdocs-admin', 'betterdocs_page_betterdocs-settings', 'betterdocs_page_betterdocs-analytics', 'betterdocs_page_betterdocs-setup', 'edit-tags.php', 'edit.php'))) {
     122        if (!in_array($hook, array('toplevel_page_betterdocs-admin', 'betterdocs_page_betterdocs-settings', 'betterdocs_page_betterdocs-analytics', 'betterdocs_page_betterdocs-setup'))) {
    123123            if ($tax->taxonomy !== 'doc_category') {
    124124                return;
  • betterdocs/trunk/admin/customizer/output-css.php

    r2522453 r2536006  
    247247            margin-top: <?php echo $output['betterdocs_doc_page_article_list_margin_top'] ?>px;
    248248            margin-right: <?php echo $output['betterdocs_doc_page_article_list_margin_right'] ?>px;
    249             margin-bottom: <?php echo $output['betterdocs_doc_page_article_list_margin_bottom'] ?>px;
    250249            margin-left: <?php echo $output['betterdocs_doc_page_article_list_margin_left'] ?>px;
    251250        }
     251        .betterdocs-categories-wrap.single-kb .docs-item-container li {
     252            margin-bottom: <?php echo $output['betterdocs_doc_page_article_list_margin_bottom'] ?>px;
     253        }
    252254        .betterdocs-categories-wrap.single-kb .docs-item-container li svg {
    253255            fill: <?php echo $output['betterdocs_doc_page_list_icon_color'] ?>;
  • betterdocs/trunk/admin/includes/betterdocs-settings-page-helper.php

    r2522453 r2536006  
    153153                                'kb_based_search' => apply_filters( 'betterdocs_kb_based_search_settings', array(
    154154                                    'type'        => 'checkbox',
    155                                     'label'       => __('Search Result based on Knowledge Base' , 'betterdocs'),
     155                                    'label'       => __('Search Result based on KB' , 'betterdocs'),
    156156                                    'default'     => '',
    157157                                    'priority'    => 10,
     
    567567            'priority'    => 20,
    568568            'button_text' => __( 'Save Settings' ),
    569             'sections' => apply_filters( 'betterdocs_pro_advanced_settings_sections', array(
     569            'sections' => apply_filters( 'betterdocs_advanced_settings_sections', array(
    570570                'role_management_section' => array(
    571571                    'title' => __('Role Management', 'betterdocs'),
     
    599599                            'label'       => __('Who Can Check Analytics?', 'betterdocs'),
    600600                            'priority'    => 1,
    601                             'multiple' => true,
     601                            'multiple'    => true,
     602                            'disable'     => true,
     603                            'default'     => 'administrator',
     604                            'options'     => BetterDocs_Settings::get_roles()
     605                        ),
     606                    )
     607                ),
     608                'internal_kb_section' => array(
     609                    'title' => __('Internal Knowledge Base', 'betterdocs'),
     610                    'priority'    => 0,
     611                    'fields' => array(
     612                        'content_restriction_title' => array(
     613                            'type'        => 'title',
     614                            'label'       => __('Internal Knowledge Base', 'betterdocs'),
     615                            'priority'    => 0,
     616                        ),
     617                        'enable_content_restriction_free' => array(
     618                            'type'      => 'checkbox',
     619                            'priority'  => 1,
    602620                            'disable' => true,
    603                             'default' => 'administrator',
    604                             'options' => BetterDocs_Settings::get_roles()
     621                            'label'     => __( 'Enable/Disable', 'betterdocs' ),
     622                            'default'   => '',
     623                            'dependency' => array(
     624                                1 => array(
     625                                    'fields' => array( 'content_visibility', 'restrict_template', 'restrict_kb', 'restrict_category', 'restricted_redirect_url' ),
     626                                )
     627                            )
    605628                        ),
    606629                    )
    607630                )
    608             ) )
     631            ))
    609632        ),
    610633        'betterdocs_instant_answer' => array(
  • betterdocs/trunk/admin/includes/class-betterdocs-db.php

    r2522453 r2536006  
    7373            'display_ia_texonomy' => array('all'),
    7474            'display_ia_single' => array('all'),
     75            'enable_content_restriction' => '',
     76            'restrict_template' => array('all'),
     77            'restrict_category' => array('all'),
     78            'restrict_kb' => array('all')
    7579        ));
    7680    }
  • betterdocs/trunk/admin/includes/class-betterdocs-settings.php

    r2522453 r2536006  
    235235    }
    236236    /**
    237      * Get All Roles
     237     * Get Roles except subscriber
    238238     * dynamically
    239239     * @return array
     
    244244        return $roles;
    245245    }
     246
     247    /**
     248     * Get All Roles
     249     * dynamically
     250     * @return array
     251     */
     252    public static function get_all_user_roles(){
     253        $users = array(
     254            'all' => 'All logged in users'
     255        );
     256        $roles = wp_roles()->role_names;
     257        return array_merge($users, $roles);
     258    }
     259
     260    /**
     261     * Get All Registered Texanomy
     262     * dynamically
     263     * @return array
     264     */
     265    public static function get_texanomy() {
     266        $taxonomies = get_taxonomies( array (
     267                'object_type' => array( 'docs' )
     268            ), 'objects'
     269        );
     270        $docs_tax = array(
     271            'all' => 'All Docs Archive',
     272            'docs' => 'Docs Page'
     273        );
     274        foreach($taxonomies as $key=>$value) {
     275            $docs_tax[$key] = $value->label;
     276        }
     277        unset( $docs_tax['doc_tag'] );
     278        return $docs_tax;
     279    }
     280
     281    /**
     282     * Get Terms List
     283     * dynamically
     284     * @return array
     285     */
     286    public static function get_terms_list($texanomy) {
     287        $get_terms = get_terms(
     288            array(
     289                'taxonomy' => $texanomy,
     290                'hide_empty' => false,
     291            )
     292        );
     293        $terms = array(
     294            'all' => 'All'
     295        );
     296        foreach($get_terms as $key=>$value) {
     297            $terms[$value->slug] = $value->name;
     298        }
     299        return $terms;
     300    }
    246301}
  • betterdocs/trunk/admin/includes/fields/betterdocs-text.php

    r2173572 r2536006  
    11<?php
    22    $readonly = isset( $field['readonly'] ) && $field['readonly'] == true ? 'readonly' : '';
     3    $placeholder = isset($field['placeholder']) ? $field['placeholder'] : '';
    34?>
    45
    5 <input <?php echo $readonly; ?> class="<?php echo esc_attr( $class ); ?>" id="<?php echo $field_id; ?>" type="text" name="<?php echo $name; ?>" value="<?php echo $value; ?>" <?php echo $attrs; ?>>
     6<input <?php echo $readonly; ?> class="<?php echo esc_attr( $class ); ?>" id="<?php echo $field_id; ?>" type="text" name="<?php echo $name; ?>" placeholder="<?php echo $placeholder; ?>" value="<?php echo $value; ?>" <?php echo $attrs; ?>>
  • betterdocs/trunk/betterdocs.php

    r2523266 r2536006  
    55 * Plugin URI:        https://betterdocs.co/
    66 * Description:       Create stunning Knowledge base for your WordPress website and reduce support pressure with the help of BetterDocs. Get access to amazing templates and create fully customizable KB within minutes.
    7  * Version:           1.7.5
     7 * Version:           1.7.6
    88 * Author:            WPDeveloper
    99 * Author URI:        https://wpdeveloper.net
     
    1919}
    2020
    21 define('BETTERDOCS_VERSION', '1.7.5');
     21define('BETTERDOCS_VERSION', '1.7.6');
    2222define('BETTERDOCS_DIR_PATH', plugin_dir_path(__FILE__));
    2323define('BETTERDOCS_URL', plugin_dir_url(__FILE__));
  • betterdocs/trunk/includes/class-betterdocs-docs-post-type.php

    r2523266 r2536006  
    4848        add_filter('betterdocs_docs_rewrite', array(__CLASS__, 'docs_rewrite'), 9);
    4949        add_filter('post_type_link', array(__CLASS__, 'docs_show_permalinks'), 1, 3);
     50        add_action( 'init', array(__CLASS__, 'flush_rewrite_rules'), 99999 );
    5051        add_filter('rest_api_allowed_post_types', array(__CLASS__, 'rest_api_allowed_post_types'));
    5152        add_filter('rest_docs_collection_params', array(__CLASS__, 'add_rest_orderby_params'), 10, 1);
     
    241242
    242243        register_taxonomy(self::$tag, array(self::$post_type), $tag_args);
    243 
    244         // flush_rewrite_rules();
    245 
    246244    }
    247245
     
    299297    public static function admin_order_terms() {
    300298        $screen = function_exists('get_current_screen') ? get_current_screen() : '';
    301 
    302         if (in_array($screen->id, array('toplevel_page_betterdocs-admin', 'betterdocs_page_betterdocs-settings'))) {
     299        $screen_id = isset($screen->id) ? $screen->id : '';
     300        if (in_array($screen_id, array('toplevel_page_betterdocs-admin', 'betterdocs_page_betterdocs-settings'))) {
    303301            self::default_term_order('doc_category');
    304302        }
     
    642640    }
    643641
     642    public static function flush_rewrite_rules(){
     643        // Get the rewrite rules
     644        $rules = get_option('rewrite_rules');
     645        if(is_array($rules)) {
     646            $rules = implode('', $rules);
     647        }
     648        if ( ! strpos( $rules, 'docs' ) ) {
     649            flush_rewrite_rules();
     650        }
     651    }
     652
    644653}
    645654
  • betterdocs/trunk/includes/class-betterdocs-helpers.php

    r2522453 r2536006  
    415415        $meta_query = '';
    416416        $terms_object['meta_query'] = apply_filters('betterdocs_child_taxonomy_meta_query', $meta_query, $multiple_kb, $kb_slug);
    417         $taxonomy_objects = get_terms('doc_category', $terms_object);
    418         return $taxonomy_objects;
     417        return get_terms('doc_category', $terms_object);
    419418    }
    420419
    421420    public static function term_permalink($texanomy, $term_slug) {
    422421        $get_term_link = get_term_link( $term_slug, $texanomy );
    423         $term_permalink = apply_filters( 'betterdocs_cat_term_permalink', $get_term_link, $term_slug, $texanomy );
    424    
    425         return $term_permalink;
     422        return apply_filters( 'betterdocs_cat_term_permalink', $get_term_link, $term_slug, $texanomy );
    426423    }
    427424
  • betterdocs/trunk/public/betterdocs-shortcodes.php

    r2522453 r2536006  
    262262        </div>';
    263263        }
    264         if ($masonry_layout == 1 && $nested_subcategory != 1 && $get_args['masonry'] != "false") {
     264        if (
     265            ($masonry_layout == 1 && $nested_subcategory != 1 && $get_args['masonry'] != "false")
     266            || (isset($get_args['masonry']) && $get_args['masonry'] == true && $get_args['masonry'] != "false")
     267        ) {
    265268            $output = betterdocs_generate_output();
    266269            echo '<script>
     
    646649                $icon = '<img src="' . $first_img . '" alt="">';
    647650            }
    648             $output .= '<li>' . $icon . '<a href="' . get_permalink() . '">' . get_the_title() . '<br><span>' . $all_terms . '<span></a></li>';
    649         endwhile;
     651            $output .= '<li>' . $icon . '<a href="' . get_permalink() . '"><span class="betterdocs-search-title">' . get_the_title() . '</span><br><span class="betterdocs-search-category">' . $all_terms . '</span></a></li>';
     652        endwhile;
    650653    else :
    651654        $output .= '<li>' . BetterDocs_DB::get_settings('search_not_found_text') . '</li>';
  • betterdocs/trunk/public/css/betterdocs-public.css

    r2522453 r2536006  
    292292  display: flex;
    293293  align-items: center;
     294}
     295.betterdocs-categories-wrap .docs-item-container .docs-sub-cat-title {
     296  margin-bottom: 0;
    294297}
    295298.betterdocs-categories-wrap li a,
Note: See TracChangeset for help on using the changeset viewer.