Skip to content

Apiki-Challenge-2#57

Open
Miraak245 wants to merge 1 commit intoApiki:masterfrom
Miraak245:reza-rastegarian
Open

Apiki-Challenge-2#57
Miraak245 wants to merge 1 commit intoApiki:masterfrom
Miraak245:reza-rastegarian

Conversation

@Miraak245
Copy link
Copy Markdown

@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