Skip to content

Commit

Permalink
Merge develop to master before releasing v2.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
haideralibd committed Aug 22, 2024
2 parents 054a59e + 440ab8f commit ac7757a
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 10 deletions.
47 changes: 47 additions & 0 deletions includes/Capability.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

namespace WeDevs\WeDocs;

/**
* Post type class
*/
class Capability {
/**
* Initialize the class
*/
public function __construct() {
add_filter( 'user_has_cap', [ $this, 'grant_delete_capability_to_specific_roles' ], 10, 4 );
}

/**
* Grant doc delete capabilities to Admin, Editor and
* weDocs-pro global permission given roles.
*
* @param array $all_caps An array of all the user's capabilities.
* @param array $caps Actual capabilities for meta capability.
* @param array $args Optional parameters passed to has_cap(), typically object ID.
* @param WP_User $user
*
* @return array
*/
public function grant_delete_capability_to_specific_roles( $all_caps, $caps, $args, $user ) {
$permitted_roles = array( 'administrator', 'editor' );
$delete_caps = array(
'delete_published_docs' => true,
'delete_others_docs' => true,
'delete_private_docs' => true,
);

if ( wedocs_pro_exists() ) {
$permitted_roles = wedocs_get_permission_settings( 'global_permission', [ 'administrator', 'editor' ] );
}

$has_role = array_intersect( $user->roles, $permitted_roles );

if ( ! empty( $user->roles ) && ! empty( $has_role ) ) {
$all_caps = array_merge( $all_caps, $delete_caps );
}

return $all_caps;
}
}
2 changes: 1 addition & 1 deletion languages/wedocs.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is distributed under the GPL2.
msgid ""
msgstr ""
"Project-Id-Version: weDocs 2.1.6\n"
"Project-Id-Version: weDocs 2.1.7\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wedocs-plugin\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "weDocs",
"version": "2.1.6",
"version": "2.1.7",
"description": "A documentation plugin for WordPress",
"author": "Tareq Hasan",
"license": "GPL",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The documentation plugin for WordPress. Create great looking documentation for your products.

![WordPress Plugin Version](https://img.shields.io/badge/PLUGIN_VERSION-V2.1.6-blue) ![WordPress Plugin Active Installs](https://img.shields.io/badge/ACTIVE_INSTALLS-6K-green) ![WordPress Plugin Rating](https://img.shields.io/badge/RATING-4.8/5_(61)-green) ![WordPress Plugin: Tested WP Version](https://img.shields.io/badge/WORDPRESS-V6.5_TESTED-orange) ![WordPress Plugin Last Updated](https://img.shields.io/badge/LAST_UPDATED-May_2024-orange)
![WordPress Plugin Version](https://img.shields.io/badge/PLUGIN_VERSION-V2.1.7-blue) ![WordPress Plugin Active Installs](https://img.shields.io/badge/ACTIVE_INSTALLS-6K-green) ![WordPress Plugin Rating](https://img.shields.io/badge/RATING-4.8/5_(61)-green) ![WordPress Plugin: Tested WP Version](https://img.shields.io/badge/WORDPRESS-V6.5_TESTED-orange) ![WordPress Plugin Last Updated](https://img.shields.io/badge/LAST_UPDATED-Aug_2024-orange)

## Description ##

Expand Down
35 changes: 30 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
=== weDocs - Knowledgebase, Documentation, and Wiki for WP ===
=== weDocs - Knowledgebase, Documentation, and Wiki Plugin for WP ===
Contributors: tareq1988, wedevs
Donate link: http://wedocs.co/
Tags: WordPress documentation plugin, WordPress docs plugin, Documentation, Knowledge base, Wiki
Requires at least: 5.6
Tested up to: 6.5.3
Requires PHP: 7.4
Stable tag: 2.1.6
Stable tag: 2.1.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Discover weDocs, the ultimate WordPress documentation plugin. Easily create, manage, and organize content with seamless integration and a user-friendly interface.
Expand All @@ -20,7 +20,7 @@ Documentation has never been this fun on WordPress! Discover **weDocs**, the ult
![Screenshot of weDocs Dashboard](https://wedocs.co/wp-content/uploads/2024/02/Dashboard.png)


🎉 ⭐ [Upgrade to weDocs Pro now!](https://wedocs.co/pricing/) 🎉 ⭐
🚀 🔥 [Upgrade to weDocs Pro now and supercharge your documentation experience!](https://wedocs.co/pricing/) 🚀 🔥

weDocs is a comprehensive knowledgebase (KB Articles) and documentation plugin for WordPress. Create great-looking documentation and organize it beautifully on your website.

Expand Down Expand Up @@ -49,7 +49,8 @@ Let’s check out what Mr. Web shared about weDocs
> 👏 “In one word: amazing. This plugin does what it says. I encountered no problems and found it extremely easy to work with. I recommend this to anyone who wants to set up solid product documentation.” - [Drazen Bebic](https://profiles.wordpress.org/drazenbebic/)


🎉 ⭐ [Upgrade to weDocs Pro now!](https://wedocs.co/pricing/) 🎉 ⭐

🎉 ⭐ [Upgrade to weDocs Pro now and supercharge your documentation experience!](https://wedocs.co/pricing/) 🎉 ⭐


## 🌐 weDocs Free Features at a glance
Expand Down Expand Up @@ -118,8 +119,17 @@ Admins can secure specific articles, ensuring exclusive editing access for thems
🤖 An AI-assisted chatbot with ChatGPT
Experience the magic of weDocs AI Chat, powered by ChatGPT. This feature unlocks a smarter, more intuitive ChatBot, leveraging ChatGPT's advanced AI with document-backed responses, quick understanding of queries, and fast, accurate answers. Enhance customer support with 24/7 availability, reduced workload on routine queries, and continuous learning for improved responses over time.



🎉 ⭐ [Upgrade to weDocs Pro now and supercharge your documentation experience!](https://wedocs.co/pricing/) 🎉 ⭐



📂 Smart article suggestions
Give instant access to the most relevant articles on the Assistant Widget's Explore Tab. weDocs combines manual curation and analytics to bring you the most helpful content, making your experience seamless and efficient.



🔍 Instant search with the assistant widget
Assist users in finding solutions promptly with our robust search feature, which promptly delivers relevant articles based on their inquiries.

Expand Down Expand Up @@ -155,7 +165,18 @@ A. It fetches the data from your already-written articles on your WordPress site
= Can I customize the URL structure of my documentation pages? =
A. Yes, weDocs allows you to customize the URL structure of your documentation pages. You can set up custom permalinks and choose a URL structure that suits your requirements, making it easier for users to navigate your documentation.

# Others



🎉 ⭐ [Upgrade to weDocs Pro now and supercharge your documentation experience!](https://wedocs.co/pricing/) 🎉 ⭐



🚀 People behind this awesome documentation plugin

This powerful knowledge plugin is developed by the people behind [weDevs](https://wedevs.com/), a dedicated team that creates amazing stuff with a customer happiness of more than 425k+.

# Others:

1. Download the weDocs plugin from the WordPress.org repository or the official website.

Expand Down Expand Up @@ -216,6 +237,10 @@ Can’t wait to join us?

== Changelog ==

= v2.1.7 (22th Aug, 2024) =

* **Fix:** Move To Trash option not available for users with the Editor role.

= v2.1.6 (24th May, 2024) =

* **Feature:** Add search block for documentation page.
Expand Down
6 changes: 4 additions & 2 deletions wedocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: weDocs
Plugin URI: https://wedocs.co/
Description: A documentation plugin for WordPress
Version: 2.1.6
Version: 2.1.7
Author: weDevs
Author URI: https://wedocs.co/?utm_source=wporg&utm_medium=banner&utm_campaign=author-uri
License: GPL2
Expand Down Expand Up @@ -39,6 +39,7 @@

// don't call the file directly
use Appsero\Client;
use WeDevs\WeDocs\Capability;

if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand All @@ -58,7 +59,7 @@ final class WeDocs {
*
* @var string
*/
const VERSION = '2.1.6';
const VERSION = '2.1.7';

/**
* The plugin url.
Expand Down Expand Up @@ -207,6 +208,7 @@ public function init_classes() {
$this->container['assets'] = new WeDevs\WeDocs\Assets();
$this->container['migrate'] = new WeDevs\WeDocs\Admin\Migrate();
$this->container['upgrader'] = new WeDevs\WeDocs\Upgrader\Upgrader();
$this->container['capability'] = new Capability();
}

/**
Expand Down

0 comments on commit ac7757a

Please sign in to comment.