class Rest_ControllerRegisters and handles REST routes for Social Kit.
class final
- Full name
Kernowdev\ClanbiteSocialKit\Rest\Rest_Controller
Constants
| Name | Value | Description |
|---|---|---|
NAMESPACE | 'clanbite-social-kit/v1' |
Methods
accept_friendship()Accept an incoming friend request by row ID.create_comment()Add a comment to a post.create_friend_request()Send a friend request to another user.create_post()Create a new social post.decline_friendship()Decline an incoming friend request by row ID.delete_comment()Delete a comment and the replies below it: its author, the post's manager or a site administrator.delete_post()Delete a social post (author, team or group manager, or site administrator).editor_resolve_player()Block editor: resolve one user by ID for saved block attributes.editor_resolve_team()Block editor: resolve one team by post ID for saved block attributes.editor_search_players()Block editor: search users (players) by display name or username.editor_search_teams()Block editor: search teams by name (cp_team).get_comments()List comments on a post.get_context_posts()Paginated posts for any registered feed context (GET /feeds/{context}/{id}/posts).get_feed_context_snapshot()First page of posts for any registered feed context (server render of the Social feed block).get_feed()Paginated home feed for the current user.get_friendships()List friend requests or accepted friendships.get_group_posts()Paginated posts for a group feed.get_link_preview()Fetch link preview metadata for the composer (before posting).get_post()Fetch a single social post if the viewer may see it.get_posts_media()Batched media loader for multiple post IDs.get_reaction_types()Registered reaction types (emoji, labels) for UI and third-party overrides.get_social_feed_block_initial_snapshot()First page of posts for the social-feed block server render (includes media; same shape as REST).get_team_posts()Paginated posts for a team feed.get_user_posts()Paginated posts for a player profile (visibility rules).ignore_friendship_request()Ignore requester from an incoming request and decline that request.reactor_author()A reactor as the feed describes any author (shared reactions service callback).record_post_view()Record a (mostly) unique view for a post.register_routes()Register routes.remove_friendship()Remove an accepted friendship (unfriend).remove_ignored_user()Remove one user from the viewer's friend-request ignore list.require_edit_posts()Block editor: user can edit posts (search teams/players for block attributes).require_login()Require a logged-in user (REST permission callback).search_mentions()Search for mentionable users, teams, and groups.toggle_comment_reaction()Toggle a reaction on a comment.toggle_reaction()Toggle a reaction on a post (body: { "reaction_type": "like" }).update_comment()Edit a comment ({ "content": "…" }): its author only.update_post()Update a social post (author only).upload_media()Upload one image for a future post (stored under uploads/clanbite/player/{user_id}/).viewer_can_view_post()Whether a viewer may read a post, by ID (used by the shared reactions service for posts and comments).vote_poll()Cast a vote on a post poll (one vote per user; authors cannot vote on their own poll).
Defined in inc/Rest/Rest_Controller.php
Changelog
| Version | Description |
|---|---|
| 1.6.2 | Updated. |