Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Merge with develop#
  • Loading branch information
aminurislamarnob committed Dec 5, 2024
2 parents 9ff6848 + 1af76e5 commit b673bc3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
15 changes: 12 additions & 3 deletions includes/Capability.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class Capability {
* Initialize the class
*/
public function __construct() {
add_filter( 'user_has_cap', [ $this, 'grant_delete_capability_to_specific_roles' ], 10, 4 );
add_filter( 'user_has_cap', array( $this, 'grant_delete_capability_to_specific_roles' ), 10, 4 );
}

/**
* Grant doc delete capabilities to Admin, Editor and
* 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.
Expand All @@ -25,13 +25,22 @@ public function __construct() {
* @return array
*/
public function grant_delete_capability_to_specific_roles( $all_caps, $caps, $args, $user ) {
if ( ! isset( $_GET['post'] ) || 'docs' !== get_post_type( absint( $_GET['post'] ) ) ) {
return $all_caps;
}

$permitted_roles = array( 'administrator', 'editor' );
$delete_caps = array(
$delete_caps = array(
'delete_published_docs' => true,
'delete_docs' => true,
'delete_others_docs' => true,
'delete_private_docs' => true,
);

if ( empty( array_intersect( array_keys( $delete_caps ), $caps ) ) ) {
return $all_caps;
}

if ( wedocs_pro_exists() ) {
$permitted_roles = wedocs_get_permission_settings( 'global_permission', [ 'administrator', 'editor' ] );
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "weDocs",
"version": "2.1.9",
"version": "2.1.10",
"description": "A documentation plugin for WordPress",
"author": "Tareq Hasan",
"license": "GPL",
Expand Down Expand Up @@ -58,4 +58,4 @@
"react-router-dom": "^6.6.2",
"sweetalert2": "^11.7.1"
}
}
}
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: WordPress documentation plugin, WordPress docs plugin, Documentation, Know
Requires at least: 5.6
Tested up to: 6.6.2
Requires PHP: 7.4
Stable tag: 2.1.9
Stable tag: 2.1.10
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 Down Expand Up @@ -237,6 +237,10 @@ Can’t wait to join us?

== Changelog ==

= v2.1.10 (05th Dec, 2024) =

* 🛠️ [FIX] Resolves "TranslatePress" conflict with editor's trash capability.

= v2.1.9 (31th Oct, 2024) =

* 🪝 [ADD] Introduced the "weDocs - Docs Grid" block for displaying documents in a customizable grid view.
Expand Down
4 changes: 2 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.9
Version: 2.1.10
Author: weDevs
Author URI: https://wedocs.co/?utm_source=wporg&utm_medium=banner&utm_campaign=author-uri
License: GPL2
Expand Down Expand Up @@ -60,7 +60,7 @@ final class WeDocs {
*
* @var string
*/
const VERSION = '2.1.9';
const VERSION = '2.1.10';

/**
* The plugin url.
Expand Down

0 comments on commit b673bc3

Please sign in to comment.