{"id":1149,"date":"2024-09-02T21:37:07","date_gmt":"2024-09-02T14:37:07","guid":{"rendered":"https:\/\/doaction.co.th\/?p=1149"},"modified":"2024-12-11T12:37:23","modified_gmt":"2024-12-11T05:37:23","slug":"wordpress-backend-with-rest-api","status":"publish","type":"post","link":"https:\/\/doaction.co.th\/en\/wordpress-backend-with-rest-api\/","title":{"rendered":"Transform WordPress into a Backend with the Power of REST API"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">WordPress \u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e41\u0e04\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c\u0e2b\u0e23\u0e37\u0e2d\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e43\u0e19\u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32\u0e40\u0e17\u0e48\u0e32\u0e19\u0e31\u0e49\u0e19 \u0e41\u0e15\u0e48\u0e22\u0e31\u0e07\u0e21\u0e35\u0e1f\u0e35\u0e40\u0e08\u0e2d\u0e23\u0e4c API \u0e17\u0e35\u0e48\u0e0a\u0e48\u0e27\u0e22\u0e02\u0e22\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e19\u0e01\u0e32\u0e23\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e41\u0e25\u0e30\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d\u0e01\u0e31\u0e1a\u0e23\u0e30\u0e1a\u0e1a\u0e2d\u0e37\u0e48\u0e19\u0e46 \u0e44\u0e21\u0e48\u0e27\u0e48\u0e32\u0e04\u0e38\u0e13\u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e2d\u0e1b\u0e1e\u0e25\u0e34\u0e40\u0e04\u0e0a\u0e31\u0e19\u0e2b\u0e23\u0e37\u0e2d\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d\u0e01\u0e31\u0e1a\u0e1a\u0e23\u0e34\u0e01\u0e32\u0e23\u0e15\u0e48\u0e32\u0e07\u0e46 WordPress API \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e0a\u0e48\u0e27\u0e22\u0e04\u0e38\u0e13\u0e44\u0e14\u0e49 \u0e1a\u0e17\u0e04\u0e27\u0e32\u0e21\u0e19\u0e35\u0e49\u0e08\u0e30\u0e1e\u0e32\u0e04\u0e38\u0e13\u0e17\u0e33\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49\u0e08\u0e31\u0e01\u0e01\u0e31\u0e1a WordPress API \u0e41\u0e25\u0e30\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e19\u0e33\u0e44\u0e1b\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e43\u0e2b\u0e49\u0e40\u0e01\u0e34\u0e14\u0e1b\u0e23\u0e30\u0e42\u0e22\u0e0a\u0e19\u0e4c\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>\u0e2a\u0e32\u0e23\u0e1a\u0e31\u0e0d<\/h2><nav><ul><li class=\"\"><a href=\"#\u0e04\u0e19\u0e40\u0e23\u0e34\u0e48\u0e21\u0e43\u0e0a\u0e49-word-press-\u0e40\u0e1b\u0e47\u0e19-backend-\u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19\">\u0e04\u0e19\u0e40\u0e23\u0e34\u0e48\u0e21\u0e43\u0e0a\u0e49 WordPress \u0e40\u0e1b\u0e47\u0e19 Backend \u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19<\/a><\/li><li class=\"\"><a href=\"#word-press-api-\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e21\u0e35\u0e2d\u0e30\u0e44\u0e23\u0e21\u0e32\u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49\u0e1a\u0e49\u0e32\u0e07\">WordPress API \u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e21\u0e35\u0e2d\u0e30\u0e44\u0e23\u0e21\u0e32\u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49\u0e1a\u0e49\u0e32\u0e07 ?<\/a><\/li><li class=\"\"><a href=\"#\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e43\u0e19\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07-rest-api\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e43\u0e19\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07 REST API<\/a><\/li><li class=\"\"><a href=\"#\u0e27\u0e34\u0e18\u0e35\u0e1b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e07-api-\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e07\">\u0e27\u0e34\u0e18\u0e35\u0e1b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e07 API \u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e07<\/a><\/li><li class=\"\"><a href=\"#\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25-acf-\u0e44\u0e1b\u0e22\u0e31\u0e07-rest-api\">\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 ACF \u0e44\u0e1b\u0e22\u0e31\u0e07 REST API<\/a><\/li><li class=\"\"><a href=\"#\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e27\u0e32\u0e21\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22\u0e43\u0e2b\u0e49-rest-api-\u0e17\u0e33\u0e22\u0e31\u0e07\u0e44\u0e07\u0e44\u0e14\u0e49\u0e1a\u0e49\u0e32\u0e07\">\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e27\u0e32\u0e21\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22\u0e43\u0e2b\u0e49 REST API \u0e17\u0e33\u0e22\u0e31\u0e07\u0e44\u0e07\u0e44\u0e14\u0e49\u0e1a\u0e49\u0e32\u0e07<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u0e04\u0e19\u0e40\u0e23\u0e34\u0e48\u0e21\u0e43\u0e0a\u0e49-word-press-\u0e40\u0e1b\u0e47\u0e19-backend-\u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19\">\u0e04\u0e19\u0e40\u0e23\u0e34\u0e48\u0e21\u0e43\u0e0a\u0e49 WordPress \u0e40\u0e1b\u0e47\u0e19 Backend \u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e43\u0e19\u0e0a\u0e48\u0e27\u0e07\u0e44\u0e21\u0e48\u0e01\u0e35\u0e48\u0e1b\u0e35\u0e17\u0e35\u0e48\u0e1c\u0e48\u0e32\u0e19\u0e21\u0e32 \u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 WordPress \u0e43\u0e19\u0e10\u0e32\u0e19\u0e30 Backend \u0e01\u0e33\u0e25\u0e31\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e17\u0e35\u0e48\u0e19\u0e34\u0e22\u0e21\u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19 \u0e2a\u0e32\u0e40\u0e2b\u0e15\u0e38\u0e2b\u0e25\u0e31\u0e01\u0e21\u0e32\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e19\u0e31\u0e01\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e2b\u0e31\u0e19\u0e44\u0e1b\u0e43\u0e0a\u0e49 <strong>React<\/strong> \u0e41\u0e25\u0e30 <strong>Vue.js<\/strong> \u0e43\u0e19\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07 Frontend \u0e41\u0e25\u0e30\u0e43\u0e0a\u0e49 WordPress API (REST API) \u0e19\u0e31\u0e49\u0e19\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e33\u0e07\u0e32\u0e19\u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e1a Frameworks \u0e40\u0e2b\u0e25\u0e48\u0e32\u0e19\u0e35\u0e49\u0e44\u0e14\u0e49\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e23\u0e32\u0e1a\u0e23\u0e37\u0e48\u0e19 \u0e17\u0e33\u0e43\u0e2b\u0e49 WordPress \u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e41\u0e04\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32 (CMS) \u0e2d\u0e35\u0e01\u0e15\u0e48\u0e2d\u0e44\u0e1b \u0e41\u0e15\u0e48\u0e01\u0e25\u0e32\u0e22\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e17\u0e35\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e40\u0e1b\u0e47\u0e19 Backend \u0e43\u0e19\u0e01\u0e32\u0e23\u0e40\u0e01\u0e47\u0e1a\u0e41\u0e25\u0e30\u0e2a\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e1b\u0e22\u0e31\u0e07 Frontend \u0e44\u0e14\u0e49<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"word-press-api-\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e21\u0e35\u0e2d\u0e30\u0e44\u0e23\u0e21\u0e32\u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49\u0e1a\u0e49\u0e32\u0e07\">WordPress API \u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e21\u0e35\u0e2d\u0e30\u0e44\u0e23\u0e21\u0e32\u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49\u0e1a\u0e49\u0e32\u0e07 ?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e43\u0e19 WordPress REST API \u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19 2 (\/v2) \u0e44\u0e14\u0e49\u0e23\u0e27\u0e21\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e17\u0e35\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e25\u0e30\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1c\u0e48\u0e32\u0e19 API \u0e40\u0e2d\u0e32\u0e44\u0e27\u0e49\u0e43\u0e19\u0e15\u0e31\u0e27\u0e23\u0e30\u0e1a\u0e1a \u0e0b\u0e36\u0e48\u0e07\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e19\u0e31\u0e01\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e41\u0e25\u0e30\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1a\u0e19\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c\u0e44\u0e14\u0e49\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e2a\u0e30\u0e14\u0e27\u0e01 \u0e42\u0e14\u0e22\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\u0e01\u0e31\u0e1a REST API \u0e08\u0e30\u0e43\u0e0a\u0e49\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a URL \u0e40\u0e09\u0e1e\u0e32\u0e30\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e23\u0e35\u0e22\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a JSON<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 URL \u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1c\u0e48\u0e32\u0e19 API \u0e08\u0e30\u0e21\u0e35\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">https:\/\/yoursite.com\/wp-json\/wp\/v2\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e43\u0e19\u0e42\u0e04\u0e23\u0e07\u0e2a\u0e23\u0e49\u0e32\u0e07 URL \u0e19\u0e35\u0e49:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>https:\/\/yoursite.com<\/strong>: \u0e04\u0e37\u0e2d\u0e42\u0e14\u0e40\u0e21\u0e19\u0e02\u0e2d\u0e07\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c WordPress \u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13<\/li>\n\n\n\n<li><strong>\/wp-json<\/strong>: \u0e40\u0e1b\u0e47\u0e19\u0e40\u0e2a\u0e49\u0e19\u0e17\u0e32\u0e07\u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07 REST API \u0e02\u0e2d\u0e07 WordPress<\/li>\n\n\n\n<li><strong>\/wp\/v2\/<\/strong>: \u0e40\u0e1b\u0e47\u0e19\u0e40\u0e2a\u0e49\u0e19\u0e17\u0e32\u0e07\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e17\u0e35\u0e48\u0e1a\u0e48\u0e07\u0e1a\u0e2d\u0e01\u0e27\u0e48\u0e32\u0e04\u0e38\u0e13\u0e01\u0e33\u0e25\u0e31\u0e07\u0e43\u0e0a\u0e49 WordPress REST API \u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19 2<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e42\u0e14\u0e22\u0e01\u0e32\u0e23\u0e15\u0e48\u0e2d\u0e17\u0e49\u0e32\u0e22 URL \u0e14\u0e49\u0e27\u0e22\u0e40\u0e2a\u0e49\u0e19\u0e17\u0e32\u0e07\u0e17\u0e35\u0e48\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e40\u0e08\u0e32\u0e30\u0e08\u0e07 \u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e48\u0e32\u0e07\u0e46 \u0e40\u0e0a\u0e48\u0e19 \u0e42\u0e1e\u0e2a\u0e15\u0e4c, \u0e40\u0e1e\u0e08, \u0e40\u0e21\u0e15\u0e32\u0e14\u0e32\u0e15\u0e49\u0e32 \u0e41\u0e25\u0e30\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e44\u0e14\u0e49 \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e40\u0e0a\u0e48\u0e19:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\/posts<\/strong>: \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e42\u0e1e\u0e2a\u0e15\u0e4c\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14<\/li>\n\n\n\n<li><strong>\/pages<\/strong>: \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e40\u0e1e\u0e08\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14<\/li>\n\n\n\n<li><strong>\/users<\/strong>: \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><br>\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e04\u0e38\u0e13\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07 URL \u0e19\u0e35\u0e49 \u0e04\u0e38\u0e13\u0e08\u0e30\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e42\u0e1e\u0e2a\u0e15\u0e4c\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a JSON \u0e0b\u0e36\u0e48\u0e07\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e19\u0e33\u0e44\u0e1b\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e15\u0e48\u0e2d\u0e43\u0e19\u0e41\u0e2d\u0e1b\u0e1e\u0e25\u0e34\u0e40\u0e04\u0e0a\u0e31\u0e19\u0e2b\u0e23\u0e37\u0e2d\u0e40\u0e27\u0e47\u0e1a Frontend \u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e44\u0e14\u0e49\u0e17\u0e31\u0e19\u0e17\u0e35<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e43\u0e19\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07-rest-api\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e43\u0e19\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07 REST API<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e01\u0e32\u0e23\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e42\u0e1e\u0e2a\u0e15\u0e4c (Posts)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">https:\/\/yoursite.com\/wp-json\/wp\/v2\/posts<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e01\u0e32\u0e23\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e42\u0e1e\u0e2a\u0e15\u0e4c\u0e15\u0e32\u0e21 ID<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">https:\/\/yoursite.com\/wp-json\/wp\/v2\/posts\/{ID}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e01\u0e32\u0e23\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e40\u0e1e\u0e08 (Pages)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">https:\/\/yoursite.com\/wp-json\/wp\/v2\/pages<\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized rounded\"><img loading=\"lazy\" decoding=\"async\" width=\"1680\" height=\"1691\" src=\"https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json.webp\" alt=\"\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01 Rest API \u0e02\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e14\u0e36\u0e07\u0e42\u0e1e\u0e2a\u0e15\u0e4c\" class=\"wp-image-1187\" style=\"width:1080px\" srcset=\"https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json.webp 1680w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-298x300.webp 298w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-1017x1024.webp 1017w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-150x150.webp 150w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-768x773.webp 768w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-1526x1536.webp 1526w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-12x12.webp 12w\" sizes=\"auto, (max-width: 1680px) 100vw, 1680px\" \/><figcaption class=\"wp-element-caption\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01 REST API \u0e02\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e14\u0e36\u0e07\u0e42\u0e1e\u0e2a\u0e15\u0e4c<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u0e27\u0e34\u0e18\u0e35\u0e1b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e07-api-\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e07\">\u0e27\u0e34\u0e18\u0e35\u0e1b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e07 API \u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e07<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e16\u0e49\u0e32\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e1b\u0e22\u0e31\u0e07 WordPress REST API \u0e42\u0e14\u0e22\u0e44\u0e21\u0e48\u0e43\u0e0a\u0e49\u0e1b\u0e25\u0e31\u0e4a\u0e01\u0e2d\u0e34\u0e19\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21 \u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 register_rest_field \u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 hook rest_api_init \u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c functions.php \u0e02\u0e2d\u0e07\u0e18\u0e35\u0e21\u0e44\u0e14\u0e49\u0e40\u0e25\u0e22 \u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e19\u0e35\u0e49\u0e08\u0e30\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e14\u0e49\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e14\u0e35\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 \u0e43\u0e19\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07 field &#8220;pin&#8221; \u0e44\u0e27\u0e49\u0e43\u0e19 API \u0e02\u0e2d\u0e07 \/v2\/posts <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function add_custom_fields_to_post_api() {\n    \/\/ \u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e48\u0e19\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e40\u0e1e\u0e34\u0e48\u0e21 field \u0e43\u0e19 API\n    register_rest_field(\n        'post', \/\/ \u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e1f\u0e34\u0e25\u0e14\u0e4c\n        'pin', \/\/ \u0e0a\u0e37\u0e48\u0e2d\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e43\u0e19 API\n        array(\n            'get_callback'    => 'get_post_meta_for_api',\n            'schema'          => null,\n        )\n    );\n}\n\nfunction get_post_meta_for_api($object) {\n    return get_post_meta($object['id'], 'pin', true);\n}\n\nadd_action('rest_api_init', 'add_custom_fields_to_post_api');<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 \u0e43\u0e19\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07 REST API \u0e40\u0e2a\u0e49\u0e19\u0e43\u0e2b\u0e21\u0e48\u0e02\u0e36\u0e49\u0e19\u0e21\u0e32\u0e40\u0e25\u0e22 \u0e08\u0e30\u0e44\u0e14\u0e49\u0e40\u0e2a\u0e49\u0e19\u0e17\u0e35\u0e48\u0e0a\u0e37\u0e48\u0e2d\u0e27\u0e48\u0e32 \/v2\/messages <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function register_custom_api_routes() {\n    register_rest_route(\n        'v2', \/\/ \u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e48\u0e19\n        '\/messages', \/\/ \u0e0a\u0e37\u0e48\u0e2d Route\n        array(\n            'methods'  => 'GET', \/\/ HTTP (GET, POST, etc.)\n            'callback' => 'get_custom_messages', \/\/ \u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e48\u0e19\u0e17\u0e35\u0e48 return        )\n    );\n}\n\nadd_action('rest_api_init', 'register_custom_api_routes');\n\nfunction get_custom_messages() {\n    \/\/ \u0e23\u0e35\u0e40\u0e17\u0e34\u0e23\u0e4c\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a API\n    $messages = array(\n        array(\n            'id'      => 1,\n            'message' => 'Hello, this is the first custom message!',\n        ),\n        array(\n            'id'      => 2,\n            'message' => 'Here is another custom message.',\n        ),\n    );\n\n    return rest_ensure_response($messages);\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25-acf-\u0e44\u0e1b\u0e22\u0e31\u0e07-rest-api\">\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 ACF \u0e44\u0e1b\u0e22\u0e31\u0e07 REST API<\/h2>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized rounded\"><img loading=\"lazy\" decoding=\"async\" width=\"1680\" height=\"1115\" src=\"https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-acf.webp\" alt=\"\u0e1b\u0e23\u0e31\u0e1a ACF \u0e43\u0e2b\u0e49\u0e41\u0e2a\u0e14\u0e07\u0e43\u0e19 API \u0e44\u0e1b\u0e14\u0e49\u0e27\u0e22\" class=\"wp-image-1199\" style=\"width:1080px\" srcset=\"https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-acf.webp 1680w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-acf-300x199.webp 300w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-acf-1024x680.webp 1024w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-acf-768x510.webp 768w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-acf-1536x1019.webp 1536w, https:\/\/doaction.co.th\/wp-content\/uploads\/2024\/09\/result-json-acf-18x12.webp 18w\" sizes=\"auto, (max-width: 1680px) 100vw, 1680px\" \/><figcaption class=\"wp-element-caption\">\u0e1b\u0e23\u0e31\u0e1a ACF \u0e43\u0e2b\u0e49\u0e41\u0e19\u0e1a\u0e44\u0e1b\u0e43\u0e19 API<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e43\u0e19\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e48\u0e19\u0e43\u0e2b\u0e21\u0e48\u0e02\u0e2d\u0e07 ACF \u0e21\u0e35\u0e1f\u0e35\u0e40\u0e08\u0e2d\u0e23\u0e4c\u0e17\u0e35\u0e48\u0e43\u0e2b\u0e49\u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e1b\u0e34\u0e14\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e01\u0e32\u0e23\u0e41\u0e19\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e44\u0e1b\u0e01\u0e31\u0e1a REST API \u0e44\u0e14\u0e49\u0e17\u0e31\u0e19\u0e17\u0e35 \u0e42\u0e14\u0e22\u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e1b\u0e34\u0e14\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e1f\u0e35\u0e40\u0e08\u0e2d\u0e23\u0e4c\u0e19\u0e35\u0e49\u0e44\u0e14\u0e49\u0e17\u0e35\u0e48\u0e2b\u0e19\u0e49\u0e32\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e02\u0e2d\u0e07\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e01\u0e23\u0e38\u0e4a\u0e1b  ACF &gt; Field Group &gt; Group Settings &gt; <strong>Show in REST API<\/strong><br><br>\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e1b\u0e34\u0e14\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e41\u0e25\u0e49\u0e27 ACF \u0e08\u0e30\u0e1c\u0e39\u0e01\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e15\u0e48\u0e32\u0e07 \u0e46 \u0e01\u0e31\u0e1a Post Type \u0e2b\u0e23\u0e37\u0e2d Page \u0e17\u0e35\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e27\u0e49 \u0e41\u0e25\u0e30\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 REST API \u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e40\u0e2b\u0e25\u0e48\u0e32\u0e19\u0e35\u0e49\u0e08\u0e30\u0e16\u0e39\u0e01\u0e23\u0e27\u0e21\u0e40\u0e02\u0e49\u0e32\u0e01\u0e31\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19 API \u0e42\u0e14\u0e22\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e31\u0e15\u0e34<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e27\u0e32\u0e21\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22\u0e43\u0e2b\u0e49-rest-api-\u0e17\u0e33\u0e22\u0e31\u0e07\u0e44\u0e07\u0e44\u0e14\u0e49\u0e1a\u0e49\u0e32\u0e07\">\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e04\u0e27\u0e32\u0e21\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22\u0e43\u0e2b\u0e49 REST API \u0e17\u0e33\u0e22\u0e31\u0e07\u0e44\u0e07\u0e44\u0e14\u0e49\u0e1a\u0e49\u0e32\u0e07<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e15\u0e31\u0e27 REST API \u0e17\u0e35\u0e48 WordPress \u0e21\u0e35\u0e21\u0e32\u0e43\u0e2b\u0e49\u0e21\u0e35\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30\u0e40\u0e1b\u0e34\u0e14\u0e40\u0e1b\u0e47\u0e19\u0e2a\u0e32\u0e18\u0e32\u0e23\u0e32\u0e13\u0e30 \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e2b\u0e25\u0e32\u0e22\u0e27\u0e34\u0e18\u0e35\u0e43\u0e19\u0e01\u0e32\u0e23\u0e1b\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e19\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e04\u0e19\u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b \u0e44\u0e21\u0e48\u0e27\u0e48\u0e32\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 Auth, Token \u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e17\u0e33 Whitelist \u0e42\u0e14\u0e22\u0e1c\u0e21\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e1b\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e19\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e17\u0e35\u0e48\u0e07\u0e48\u0e32\u0e22\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14\u0e43\u0e19\u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e01\u0e47\u0e04\u0e37\u0e2d Whitelist<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 \u0e08\u0e30\u0e17\u0e33\u0e01\u0e32\u0e23 Whitelist \u0e42\u0e14\u0e22\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a IP \u0e17\u0e35\u0e48\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 API<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function restrict_api_access_by_ip($result) {\n    \/\/ \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 IP \u0e17\u0e35\u0e48\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\n    $allowed_ips = array(\n        '123.456.789.000', \/\/ \u0e43\u0e2a\u0e48\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 IP \u0e17\u0e35\u0e48\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49 API\n        '111.222.333.444',\n    );\n\n    \/\/ \u0e14\u0e36\u0e07 IP \u0e17\u0e35\u0e48\u0e17\u0e33\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 API\n    $ip_address = $_SERVER['REMOTE_ADDR'];\n\n    \/\/ \u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a IP \u0e16\u0e49\u0e32\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19\u0e23\u0e32\u0e22\u0e01\u0e32\u0e32\u0e23\u0e17\u0e35\u0e48\u0e44\u0e21\u0e48\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49\u0e41\u0e2a\u0e14\u0e07 error\n    if (!in_array($ip_address, $allowed_ips)) {\n        return new WP_Error('rest_forbidden', 'Your IP address is not allowed to access this API.', array('status' => 403));\n    }\n\n    return $result;\n}\n\nadd_filter('rest_authentication_errors', 'restrict_api_access_by_ip');<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 \u0e08\u0e30\u0e17\u0e33\u0e01\u0e32\u0e23 Whitelist \u0e42\u0e14\u0e22\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a Domain \u0e17\u0e35\u0e48\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 API<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function restrict_api_access_by_domain($result) {\n    \/\/ \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 Domain \u0e17\u0e35\u0e48\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\n    $allowed_domains = array(\n        'https:\/\/allowed-domain.com',\n        'https:\/\/another-allowed-domain.com',\n    );\n\n    \/\/ \u0e14\u0e36\u0e07 Domaiin \u0e17\u0e35\u0e48\u0e17\u0e33\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 API\n    $origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : '';\n\n    \/\/ \u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a Domain \u0e16\u0e49\u0e32\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19\u0e23\u0e32\u0e22\u0e01\u0e32\u0e32\u0e23\u0e17\u0e35\u0e48\u0e44\u0e21\u0e48\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49\u0e41\u0e2a\u0e14\u0e07 error\n    if (!in_array($origin, $allowed_domains)) {\n        return new WP_Error('rest_forbidden', 'Your domain is not allowed to access this API.', array('status' => 403));\n    }\n\n    return $result;\n}\n\nadd_filter('rest_authentication_errors', 'restrict_api_access_by_domain');<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e2b\u0e32\u0e01\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e28\u0e36\u0e01\u0e29\u0e32\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 WordPress REST API \u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e2d\u0e48\u0e32\u0e19\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\u0e44\u0e14\u0e49\u0e17\u0e35\u0e48\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23\u0e02\u0e2d\u0e07 WordPress \u0e42\u0e14\u0e22\u0e15\u0e23\u0e07 \u0e0b\u0e36\u0e48\u0e07\u0e21\u0e35\u0e40\u0e2d\u0e01\u0e2a\u0e32\u0e23\u0e41\u0e25\u0e30\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e04\u0e23\u0e1a\u0e16\u0e49\u0e27\u0e19\u0e17\u0e35\u0e48: <a href=\"https:\/\/developer.wordpress.org\/rest-api\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/developer.wordpress.org\/rest-api\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress \u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e41\u0e04\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c\u0e2b\u0e23\u0e37\u0e2d\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e43\u0e19\u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32\u0e40\u0e17\u0e48\u0e32\u0e19\u0e31\u0e49\u0e19 \u0e41\u0e15\u0e48\u0e22\u0e31\u0e07\u0e21\u0e35\u0e1f\u0e35\u0e40\u0e08\u0e2d\u0e23\u0e4c API \u0e17\u0e35\u0e48\u0e0a\u0e48\u0e27\u0e22\u0e02\u0e22\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e19\u0e01\u0e32\u0e23\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e41\u0e25\u0e30\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d\u0e01\u0e31\u0e1a\u0e23\u0e30\u0e1a\u0e1a\u0e2d\u0e37\u0e48\u0e19\u0e46 \u0e44\u0e21\u0e48\u0e27\u0e48\u0e32\u0e04\u0e38\u0e13\u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e2d\u0e1b\u0e1e\u0e25\u0e34\u0e40\u0e04\u0e0a\u0e31\u0e19\u0e2b\u0e23\u0e37\u0e2d\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d\u0e01\u0e31\u0e1a\u0e1a\u0e23\u0e34\u0e01\u0e32\u0e23\u0e15\u0e48\u0e32\u0e07\u0e46 WordPress API \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e0a\u0e48\u0e27\u0e22\u0e04\u0e38\u0e13\u0e44\u0e14\u0e49 \u0e1a\u0e17\u0e04\u0e27\u0e32\u0e21\u0e19\u0e35\u0e49\u0e08\u0e30\u0e1e\u0e32\u0e04\u0e38\u0e13\u0e17\u0e33\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49\u0e08\u0e31\u0e01\u0e01\u0e31\u0e1a WordPress API \u0e41\u0e25\u0e30\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e19\u0e33\u0e44\u0e1b\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e43\u0e2b\u0e49\u0e40\u0e01\u0e34\u0e14\u0e1b\u0e23\u0e30\u0e42\u0e22\u0e0a\u0e19\u0e4c\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14 \u0e04\u0e19\u0e40\u0e23\u0e34\u0e48\u0e21\u0e43\u0e0a\u0e49 WordPress \u0e40\u0e1b\u0e47\u0e19 Backend \u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19 \u0e43\u0e19\u0e0a\u0e48\u0e27\u0e07\u0e44\u0e21\u0e48\u0e01\u0e35\u0e48\u0e1b\u0e35\u0e17\u0e35\u0e48\u0e1c\u0e48\u0e32\u0e19\u0e21\u0e32 \u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 WordPress \u0e43\u0e19\u0e10\u0e32\u0e19\u0e30 Backend \u0e01\u0e33\u0e25\u0e31\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e17\u0e35\u0e48\u0e19\u0e34\u0e22\u0e21\u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19 \u0e2a\u0e32\u0e40\u0e2b\u0e15\u0e38\u0e2b\u0e25\u0e31\u0e01\u0e21\u0e32\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e19\u0e31\u0e01\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e2b\u0e31\u0e19\u0e44\u0e1b\u0e43\u0e0a\u0e49 React \u0e41\u0e25\u0e30 Vue.js \u0e43\u0e19\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07 Frontend \u0e41\u0e25\u0e30\u0e43\u0e0a\u0e49 WordPress API (REST API) \u0e19\u0e31\u0e49\u0e19\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e33\u0e07\u0e32\u0e19\u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e1a Frameworks \u0e40\u0e2b\u0e25\u0e48\u0e32\u0e19\u0e35\u0e49\u0e44\u0e14\u0e49\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e23\u0e32\u0e1a\u0e23\u0e37\u0e48\u0e19 \u0e17\u0e33\u0e43\u0e2b\u0e49 WordPress \u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e41\u0e04\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32 (CMS) \u0e2d\u0e35\u0e01\u0e15\u0e48\u0e2d\u0e44\u0e1b \u0e41\u0e15\u0e48\u0e01\u0e25\u0e32\u0e22\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e17\u0e35\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e40\u0e1b\u0e47\u0e19 Backend \u0e43\u0e19\u0e01\u0e32\u0e23\u0e40\u0e01\u0e47\u0e1a\u0e41\u0e25\u0e30\u0e2a\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e1b\u0e22\u0e31\u0e07 Frontend \u0e44\u0e14\u0e49 WordPress API \u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e21\u0e35\u0e2d\u0e30\u0e44\u0e23\u0e21\u0e32\u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49\u0e1a\u0e49\u0e32\u0e07 ? \u0e43\u0e19 WordPress REST [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1224,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","inline_featured_image":false,"footnotes":""},"categories":[43],"tags":[],"class_list":["post-1149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledge"],"acf":{"eng_thumbnail":1224,"eng_title":"Transform WordPress into a Backend with the Power of REST API","eng_description":"WordPress is not just a website creation system or a content management tool; it also features an API that extends its capabilities for development and integration with other systems. Whether you want to build an application or connect with various services, the WordPress API can assist you. This article will introduce you to the WordPress API and show you how to make the most of its functionality."},"_links":{"self":[{"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/posts\/1149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/comments?post=1149"}],"version-history":[{"count":3,"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/posts\/1149\/revisions"}],"predecessor-version":[{"id":1484,"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/posts\/1149\/revisions\/1484"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/media\/1224"}],"wp:attachment":[{"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/media?parent=1149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/categories?post=1149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doaction.co.th\/en\/wp-json\/wp\/v2\/tags?post=1149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}