Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
99fc687
Check for Site-Kits in interaction endpoint
pfefferle Aug 4, 2025
9a72a8e
Starter Kit: Add actor selection to Starter Kit import
pfefferle Aug 4, 2025
74b6996
Update author selection heading in Starter Kit import
pfefferle Aug 4, 2025
699eead
Refactor import options UI and logic
pfefferle Aug 4, 2025
93b145d
Add missing docblocks to Starter_Kit methods
pfefferle Aug 4, 2025
10c9046
Starter Kit: Import via URL
pfefferle Aug 4, 2025
6d4f59c
update url
pfefferle Aug 4, 2025
9a165ce
Fix URL parameter handling and standardize printf calls
pfefferle Aug 4, 2025
f842bf0
Merge branch 'add/import-starter-pack-from-url' into add/import-from-url
pfefferle Aug 4, 2025
467df5c
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 4, 2025
25ca315
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 4, 2025
6df0643
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 4, 2025
2f415d3
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 4, 2025
6ac346f
Refactor Starter_Kit class for consistency and clarity
pfefferle Aug 4, 2025
bb74c27
Merge branch 'trunk' into add/starter-kit-show-actors
pfefferle Aug 4, 2025
bd47a9b
Merge branch 'add/starter-kit-show-actors' into add/import-starter-pa…
pfefferle Aug 4, 2025
d8aa107
Merge branch 'add/import-starter-pack-from-url' into add/import-from-url
pfefferle Aug 4, 2025
f70af81
Update includes/rest/class-interaction-controller.php
pfefferle Aug 4, 2025
5e3d86b
Update includes/rest/class-interaction-controller.php
pfefferle Aug 4, 2025
2bc95c5
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 4, 2025
f73a09b
Add PHPCS ignore for nonce verification in import
pfefferle Aug 4, 2025
3c3f31b
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 4, 2025
2256b87
Fix is_wp_error call with correct namespace
pfefferle Aug 4, 2025
d3b61e3
Merge branch 'add/import-starter-pack-from-url' into add/import-from-url
pfefferle Aug 4, 2025
ffc1424
Merge branch 'trunk' into add/import-starter-pack-from-url
pfefferle Aug 5, 2025
3f1fe5f
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 5, 2025
f6248b9
fixed phpcs
pfefferle Aug 5, 2025
4736dce
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 5, 2025
3788a0c
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 5, 2025
5192ef2
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 5, 2025
c2a1a0e
Update includes/wp-admin/import/class-starter-kit.php
pfefferle Aug 5, 2025
d017793
Improve variable alignment in Starter_Kit class
pfefferle Aug 5, 2025
8a09c84
Add changelog
matticbot Aug 5, 2025
1db1f18
Merge branch 'add/import-starter-pack-from-url' into add/import-from-url
pfefferle Aug 5, 2025
8333816
Merge branch 'trunk' into add/import-from-url
pfefferle Aug 5, 2025
70389b9
Add changelog
matticbot Aug 5, 2025
6cd40b7
fix phpcs
pfefferle Aug 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/changelog/2049-from-description
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Adds support for Starter Kit collections in the ActivityPub API.
20 changes: 19 additions & 1 deletion includes/rest/class-interaction-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function get_item( $request ) {
case 'Service':
case 'Application':
case 'Organization':
if ( boolval( get_option( 'activitypub_following_ui', '0' ) ) ) {
if ( \get_option( 'activitypub_following_ui', '0' ) ) {
if ( user_can_activitypub( \get_current_user_id() ) ) {
$redirect_url = \admin_url( 'users.php?page=activitypub-following-list&resource=' . $url_param );
} elseif ( user_can_activitypub( Actors::BLOG_USER_ID ) ) {
Expand All @@ -132,8 +132,26 @@ public function get_item( $request ) {
*/
$redirect_url = \apply_filters( 'activitypub_interactions_follow_url', $redirect_url, $uri, $object );
break;
case 'Collection':
case 'CollectionPage':
case 'OrderedCollection':
case 'OrderedCollectionPage':
if ( \get_option( 'activitypub_following_ui', '0' ) ) {
$redirect_url = \admin_url( 'admin.php?import=starter-kit&url=' . $url_param );
}

/**
* Filters the URL used for importing a Starter Kit collection.
*
* @param string $redirect_url The URL to redirect to.
* @param string $uri The URI of the collection to import.
* @param array $object The full collection object data.
*/
$redirect_url = \apply_filters( 'activitypub_interactions_starter_kit_url', $redirect_url, $uri, $object );
break;
default:
$redirect_url = \admin_url( 'post-new.php?in_reply_to=' . $url_param );

/**
* Filters the URL used for replying to an ActivityPub object.
*
Expand Down
3 changes: 2 additions & 1 deletion includes/wp-admin/import/class-starter-kit.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,12 @@ public static function handle_url_import() {
$base_filename = 'starter-kit.json';
$unique_filename = \wp_unique_filename( $upload_dir['path'], $base_filename );
$temp_file = \trailingslashit( $upload_dir['path'] ) . $unique_filename;

if ( ! \WP_Filesystem() ) {
\printf( '<p><strong>%s</strong><br />%s</p>', \esc_html( $error_message ), \esc_html__( 'Failed to initialize the WordPress filesystem.', 'activitypub' ) );
return false;
}

global $wp_filesystem;

if ( ! $wp_filesystem || ! is_a( $wp_filesystem, 'WP_Filesystem_Base' ) ) {
Expand Down Expand Up @@ -323,7 +325,6 @@ private static function setup_blog_user_filter() {
* Cleanup blog user filter.
*/
private static function cleanup_blog_user_filter() {

if ( self::$blog_user_filter_callback && self::$blog_user_filter_added ) {
\remove_filter( 'wp_dropdown_users', self::$blog_user_filter_callback );
self::$blog_user_filter_callback = null;
Expand Down
Loading