updated plugin ActivityPub version 2.3.0

This commit is contained in:
2024-04-19 10:49:31 +00:00
committed by Gitium
parent 34dbbce9b4
commit 620280b550
39 changed files with 797 additions and 663 deletions

View File

@ -384,7 +384,7 @@ function is_user_disabled( $user_id ) {
break;
}
if ( ! \user_can( $user_id, 'publish_posts' ) ) {
if ( ! \user_can( $user_id, 'activitypub' ) ) {
$return = true;
break;
}
@ -644,7 +644,7 @@ function get_total_users() {
$users = \get_users(
array(
'capability__in' => array( 'publish_posts' ),
'capability__in' => array( 'activitypub' ),
)
);
@ -827,3 +827,19 @@ function get_post_type_description( $post_type ) {
return apply_filters( 'activitypub_post_type_description', $description, $post_type->name, $post_type );
}
/**
* Get the masked WordPress version to only show the major and minor version.
*
* @return string The masked version.
*/
function get_masked_wp_version() {
// only show the major and minor version
$version = get_bloginfo( 'version' );
// strip the RC or beta part
$version = preg_replace( '/-.*$/', '', $version );
$version = explode( '.', $version );
$version = array_slice( $version, 0, 2 );
return implode( '.', $version );
}