acf-like-button

ACF Block with the Interactivity API

Stars
2
Committers
1

ACF Like Button

Final demo site ACFLikeButton.WPEnginePowered.com

This repo contains the source code for a WordPress plugin, which does several things:

  1. Registers two post types: movie, song
  2. Register ACF Relationship field type and associates it with each user.
  3. Includes some CSS and a few other things to allow for a custom login/register screen.
  4. Registers two custom blocks: Like Button and Like Count. These blocks integrate the Interactivity API. When a user clicks the Like Button then it alters the state of the Like Count. Each like is associated with meta information with the user. A user can visit their profile to see a list of all their liked items and edit them as well.

📹 Check out the playback recording from the ACF Chat Friday on YouTube to see the foundation for how this was built. 📹

Installation & Setup

Requirements

A WordPress site with:

Changelog

June 7, 2024

  • Add aria-pressed to notify screen readers of current Like button state.
Related Projects