Skip to content

Commit

Permalink
Fix Extra-Fields handling (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle authored Sep 9, 2024
1 parent 15cff15 commit c180644
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.2.2] - 2024-09-09

### Fixed

* Fixed: Extra-Fields check

## [3.2.1] - 2024-09-09

### Fixed
Expand Down Expand Up @@ -891,6 +897,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* initial

[3.2.2]: https://github.com/Automattic/wordpress-activitypub/compare/3.2.1...3.2.2
[3.2.1]: https://github.com/Automattic/wordpress-activitypub/compare/3.2.0...3.2.1
[3.2.0]: https://github.com/Automattic/wordpress-activitypub/compare/3.1.0...3.2.0
[3.1.0]: https://github.com/Automattic/wordpress-activitypub/compare/3.0.0...3.1.0
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Tags:** OStatus, fediverse, activitypub, activitystream
**Requires at least:** 5.5
**Tested up to:** 6.6
**Stable tag:** 3.2.1
**Stable tag:** 3.2.2
**Requires PHP:** 7.0
**License:** MIT
**License URI:** http://opensource.org/licenses/MIT
Expand Down Expand Up @@ -134,6 +134,10 @@ For reasons of data protection, it is not possible to see the followers of other

## Changelog ##

### 3.2.2 ###

* Fixed: Extra-Fields check

### 3.2.1 ###

* Fixed: Use `Excerpt` for Podcast Episodes
Expand Down
4 changes: 2 additions & 2 deletions activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: ActivityPub
* Plugin URI: https://github.com/pfefferle/wordpress-activitypub/
* Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.
* Version: 3.2.1
* Version: 3.2.2
* Author: Matthias Pfefferle & Automattic
* Author URI: https://automattic.com/
* License: MIT
Expand All @@ -21,7 +21,7 @@
require_once __DIR__ . '/includes/compat.php';
require_once __DIR__ . '/includes/functions.php';

\define( 'ACTIVITYPUB_PLUGIN_VERSION', '3.2.1' );
\define( 'ACTIVITYPUB_PLUGIN_VERSION', '3.2.2' );

/**
* Initialize the plugin constants.
Expand Down
2 changes: 1 addition & 1 deletion includes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function ( $allcaps, $caps, $arg ) {

$post = get_post( $arg[2] );

if ( Extra_Fields::is_extra_fields_post_type( $post->post_type ) ) {
if ( ! Extra_Fields::is_extra_field_post_type( $post->post_type ) ) {
return $allcaps;
}

Expand Down
22 changes: 22 additions & 0 deletions includes/collection/class-extra-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,28 @@ public static function is_extra_fields_post_type( $post_type ) {
return \in_array( $post_type, array( self::USER_POST_TYPE, self::BLOG_POST_TYPE ), true );
}

/**
* Check if a post type is the `ap_extrafield` post type.
*
* @param string $post_type The post type.
*
* @return bool True if the post type is `ap_extrafield`, otherwise false.
*/
public static function is_extra_field_post_type( $post_type ) {
return self::USER_POST_TYPE === $post_type;
}

/**
* Check if a post type is the `ap_extrafield_blog` post type.
*
* @param string $post_type The post type.
*
* @return bool True if the post type is `ap_extrafield_blog`, otherwise false.
*/
public static function is_extra_field_blog_post_type( $post_type ) {
return self::BLOG_POST_TYPE === $post_type;
}

/**
* Add default extra fields to an actor.
*
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: automattic, pfefferle, mediaformat, mattwiebe, akirk, jeherve, nur
Tags: OStatus, fediverse, activitypub, activitystream
Requires at least: 5.5
Tested up to: 6.6
Stable tag: 3.2.1
Stable tag: 3.2.2
Requires PHP: 7.0
License: MIT
License URI: http://opensource.org/licenses/MIT
Expand Down Expand Up @@ -134,6 +134,10 @@ For reasons of data protection, it is not possible to see the followers of other

== Changelog ==

= 3.2.2 =

* Fixed: Extra-Fields check

= 3.2.1 =

* Fixed: Use `Excerpt` for Podcast Episodes
Expand Down

0 comments on commit c180644

Please sign in to comment.