Skip to content

Conversation

@Miraak245
Copy link

@Miraak245 Miraak245 commented Jan 23, 2025

creating plugin => Apiki-Favorites\apiki-favorites.php

  • Wordpress: 6.7.1

added this plugin For Authentication: JWT Authentication for WP-API

added this code to wp-config.php:

...
define('JWT_AUTH_SECRET_KEY', '7Yqq05YKIlMxscXbgYh2kFNN_zs8GgTH1wuX-rfBDRT9o_RiajB5WfIAFH_Wwl5onQ6lXVylt23H_K-M6uKNYQ');
define('JWT_AUTH_CORS_ENABLE', true);

before this line:
/* That's all, stop editing! Happy publishing. */

Apiki-Favorites plug-in APIs:
adds favorite POST => http://localhost/wordpress/wp-json/apiki/v2/favorites?post_id=1
removes favorite DELETE => http://localhost/wordpress/wp-json/apiki/v2/favorites?post_id=1
gets all favorites GET => http://localhost/wordpress/wp-json/apiki/v2/favorites

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant