get_featured() ) { return $data; } $post_id = \url_to_postid( $object_uri ); if ( ! $post_id ) { return new \WP_Error( 'activitypub_object_not_found', \__( 'The referenced object was not found.', 'activitypub' ), array( 'status' => 404 ) ); } $post = \get_post( $post_id ); if ( ! $post ) { return new \WP_Error( 'activitypub_object_not_found', \__( 'The referenced object was not found.', 'activitypub' ), array( 'status' => 404 ) ); } // Verify the user owns this post. if ( $user_id > 0 && (int) $post->post_author !== $user_id ) { return new \WP_Error( 'activitypub_forbidden', \__( 'You can only feature your own posts.', 'activitypub' ), array( 'status' => 403 ) ); } // Making the post sticky triggers the scheduler which adds to outbox. \stick_post( $post_id ); return $post; } }