{"id":231281,"date":"2022-12-24T19:10:00","date_gmt":"2022-12-24T16:10:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=231281"},"modified":"2022-12-24T19:10:36","modified_gmt":"2022-12-24T16:10:36","slug":"zagalnij-priklad-shablonu-shovishha-v-wordpress","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/uk\/zagalnij-priklad-shablonu-shovishha-v-wordpress\/","title":{"rendered":"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0438\u0439 \u043f\u0440\u0438\u043a\u043b\u0430\u0434 \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u0441\u0445\u043e\u0432\u0438\u0449\u0430 \u0432 WordPress"},"content":{"rendered":"\n<p>\u0417 \u043c\u043e\u0433\u043e \u0434\u043e\u0441\u0432\u0456\u0434\u0443, \u0442\u0435, \u044f\u043a \u043c\u0438 \u0441\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0432\u0437\u0430\u0454\u043c\u043e\u0434\u0456\u0454\u043c\u043e \u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0443 \u0441\u0445\u043e\u0432\u0438\u0449\u0430, \u0447\u0430\u0441\u0442\u043e \u0432\u043f\u043b\u0438\u0432\u0430\u0454 \u043d\u0430 \u0442\u0435, \u044f\u043a \u043c\u0438 \u0434\u0443\u043c\u0430\u0454\u043c\u043e \u043f\u0440\u043e \u0448\u0430\u0431\u043b\u043e\u043d. (\u041f\u0435\u0440\u0448\u0456 \u0432\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u043b\u0438\u0448\u0430\u044e\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u0431\u0443\u0442\u043d\u0456\u043c\u0438, \u0447\u0438 \u043d\u0435 \u0442\u0430\u043a?)<\/p>\n<p>\u041c\u0435\u0442\u0430 \u0446\u0456\u0454\u0457 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0438, \u044f\u043a \u0446\u0435 \u043c\u043e\u0436\u043d\u0430 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 \u0443 WordPress, \u0437\u043e\u043a\u0440\u0435\u043c\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044f \u043e\u0431&#8217;\u0454\u043a\u0442\u043d\u043e-\u043e\u0440\u0456\u0454\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u0445 \u043f\u043b\u0430\u0433\u0456\u043d\u0456\u0432 \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u043d\u043d\u044f \u0434\u0430\u043d\u0438\u0445 (\u0437\u0430\u043f\u0438\u0441 \u0434\u0430\u043d\u0438\u0445 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0440\u043e\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u043e \u0432 \u0456\u043d\u0448\u0456\u0439 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457), \u0430\u043b\u0435 \u043f\u0435\u0440\u0435\u0434 \u0442\u0438\u043c, \u044f\u043a \u0446\u0435 \u0437\u0440\u043e\u0431\u0438\u0442\u0438, \u044f \u0441\u043f\u0440\u043e\u0431\u0443\u0432\u0430\u0432 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u0438 \u043f\u0440\u043e \u043a\u0456\u043b\u044c\u043a\u0430 \u0443\u0437\u0433\u043e\u0434\u0436\u0435\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u0456\u0436 \u0432\u0430\u0440\u0456\u0430\u043d\u0442\u0438 \u0432\u0456\u0437\u0435\u0440\u0443\u043d\u043a\u0430, \u044f\u043a\u0456 \u044f \u0431\u0430\u0447\u0438\u0432.<\/p>\n<p>\u0417\u0430\u0433\u0430\u043b\u043e\u043c, \u0446\u0435 \u0442\u0435, \u0449\u043e, \u043d\u0430 \u043c\u043e\u044e \u0434\u0443\u043c\u043a\u0443, \u043f\u043e\u0432\u0438\u043d\u0435\u043d \u0440\u043e\u0431\u0438\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u0445\u043e\u0432\u0438\u0449\u0430:<\/p>\n<ul>\n<li>\u0437\u0430\u0431\u0435\u0437\u043f\u0435\u0447\u0438\u0442\u0438 \u0454\u0434\u0438\u043d\u0435 \u043c\u0456\u0441\u0446\u0435 \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u043d\u043d\u044f \u0434\u0430\u043d\u0438\u0445,<\/li>\n<li>\u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0434\u0435\u0442\u0430\u043b\u0456 \u0442\u043e\u0433\u043e, \u044f\u043a \u0437\u0434\u0456\u0439\u0441\u043d\u044e\u0454\u0442\u044c\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u0434\u0430\u043d\u0438\u0445,<\/li>\n<li>\u0456 \u043c\u0430\u0442\u0438 \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0443\u0437\u0433\u043e\u0434\u0436\u0435\u043d\u0438\u0439 \u0456\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/li>\n<\/ul>\n<p>\u0426\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0454, \u0449\u043e \u0432\u0441\u0435, \u0449\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438, \u043c\u043e\u0436\u043d\u0430 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0437 \u0431\u0430\u0437\u0438 \u0434\u0430\u043d\u0438\u0445. \u0410\u043b\u0435 \u0442\u0435, \u044f\u043a \u0439\u043e\u0433\u043e \u0432\u0438\u0442\u044f\u0433\u043b\u0438, \u043c\u043e\u0436\u043d\u0430 \u0432\u0432\u0430\u0436\u0430\u0442\u0438 \u0447\u043e\u0440\u043d\u043e\u044e \u0441\u043a\u0440\u0438\u043d\u044c\u043a\u043e\u044e. \u0426\u0435 \u0437\u0430\u043b\u0435\u0436\u0438\u0442\u044c \u0432\u0456\u0434 \u0440\u043e\u0437\u0440\u043e\u0431\u043d\u0438\u043a\u0430, \u044f\u043a\u0438\u0439 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0454 \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<p>\u0406 \u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u0442\u0438\u0445, \u0445\u0442\u043e \u0447\u0438\u0442\u0430\u0454 \u0446\u0435\u0439 \u043f\u043e\u0441\u0442, \u0446\u0435, \u0448\u0432\u0438\u0434\u0448\u0435 \u0437\u0430 \u0432\u0441\u0435, \u043c\u0438.<\/p>\n<h2>\u0428\u0430\u0431\u043b\u043e\u043d \u0441\u0445\u043e\u0432\u0438\u0449\u0430 \u0432 WordPress<\/h2>\n<p>\u041f\u0430\u0440\u0443 \u0440\u043e\u043a\u0456\u0432 \u0442\u043e\u043c\u0443 <a href=\"https:\/\/wordpress.mediadoma.com\/uk\/bazovij-shablon-shovishha\/\" title=\"\u044f \u043f\u0438\u0441\u0430\u0432 \u043f\u0440\u043e \u0448\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u044e,\">\u044f \u043f\u0438\u0441\u0430\u0432 \u043f\u0440\u043e \u0448\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u044e,<\/a> \u043d\u0430\u0432\u043e\u0434\u044f\u0447\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0438\u0439 \u043f\u0440\u0438\u043a\u043b\u0430\u0434. \u0426\u0435 \u0432\u0441\u0435 \u0449\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e, \u0430\u043b\u0435 \u043c\u0435\u0442\u0430 \u0442\u043e\u0433\u043e, \u0449\u043e \u044f \u0445\u043e\u0447\u0443 \u0432\u0438\u0441\u0432\u0456\u0442\u043b\u0438\u0442\u0438 \u0432 \u0446\u0456\u0439 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457, \u0434\u0435\u0449\u043e \u0456\u043d\u0448\u0430.<\/p>\n<p>\u0417\u0430\u043c\u0456\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0449\u043e\u0431 \u043f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443 \u0440\u0435\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u044e, \u0437\u0430\u0441\u043d\u043e\u0432\u0430\u043d\u0443 \u043d\u0430 \u0444\u0430\u043a\u0442\u0438\u0447\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u0456, \u044f \u0431 \u0440\u0430\u0434\u0448\u0435 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0443\u0432\u0430\u0432, \u044f\u043a \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0446\u0435\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0443 \u043d\u0430\u0448\u0456\u0439 \u043f\u043e\u0432\u0441\u044f\u043a\u0434\u0435\u043d\u043d\u0456\u0439 \u0440\u043e\u0431\u043e\u0442\u0456.<\/p>\n<p>\u0427\u0438\u0442\u0430\u044e\u0447\u0438 \u0446\u0435, \u0441\u043b\u0456\u0434 \u043f\u0430\u043c\u2019\u044f\u0442\u0430\u0442\u0438 \u043f\u0440\u043e \u0434\u0432\u0456 \u0440\u0435\u0447\u0456:<\/p>\n<ol>\n<li>\u0437 \u0442\u043e\u0447\u043a\u0438 \u0437\u043e\u0440\u0443 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430, \u0431\u0430\u0437\u043e\u0432\u0435 \u0441\u0445\u043e\u0432\u0438\u0449\u0435 \u0434\u0430\u043d\u0438\u0445 \u043d\u0435 \u043c\u0430\u0454 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f,<\/li>\n<li>\u0417 \u0442\u043e\u0447\u043a\u0438 \u0437\u043e\u0440\u0443 \u0440\u043e\u0437\u0440\u043e\u0431\u043d\u0438\u043a\u0430, \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043e\u0437\u0432\u043e\u043b\u044f\u0454 \u043d\u0430\u043c \u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438 \u0437 \u043a\u0456\u043b\u044c\u043a\u043e\u043c\u0430 \u0434\u0436\u0435\u0440\u0435\u043b\u0430\u043c\u0438 \u0434\u0430\u043d\u0438\u0445, \u0430 \u0442\u0430\u043a\u043e\u0436 \u043c\u0430\u043a\u0435\u0442\u0443\u0432\u0430\u0442\u0438 \u0437\u0440\u0430\u0437\u043a\u043e\u0432\u0435 \u0441\u0445\u043e\u0432\u0438\u0449\u0435 \u0434\u0430\u043d\u0438\u0445, \u0449\u043e\u0431 \u043c\u0438 \u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0435 \u0442\u0435\u0441\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0434\u0430\u043d\u0438\u0445.<\/li>\n<\/ol>\n<p>\u041f\u0440\u0438 \u0440\u0435\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457 \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u043d\u0435 \u043c\u0430\u0454 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f, \u0437\u0432\u0456\u0434\u043a\u0438 \u043d\u0430\u0434\u0445\u043e\u0434\u044f\u0442\u044c \u0434\u0430\u043d\u0456. \u041f\u0440\u0438\u043d\u0430\u0439\u043c\u043d\u0456 \u0434\u043e \u0442\u0438\u0445 \u043f\u0456\u0440, \u043f\u043e\u043a\u0438 \u0432\u0438 \u0454 \u0440\u043e\u0437\u0440\u043e\u0431\u043d\u0438\u043a\u043e\u043c \u0430\u0431\u043e \u043a\u043b\u0456\u0454\u043d\u0442\u0441\u044c\u043a\u0438\u043c \u043e\u0431\u2019\u0454\u043a\u0442\u043e\u043c, \u044f\u043a\u0438\u0439 \u0437\u0432\u0435\u0440\u0442\u0430\u0454\u0442\u044c\u0441\u044f \u0434\u043e \u043d\u044c\u043e\u0433\u043e. \u0421\u0445\u043e\u0432\u0438\u0449\u0435\u043c \u0434\u0430\u043d\u0438\u0445 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u0438\u0445, \u043d\u0430\u0431\u0456\u0440 \u0444\u0443\u043d\u043a\u0446\u0456\u0439 API \u0430\u0431\u043e \u043a\u043e\u043c\u0431\u0456\u043d\u0430\u0446\u0456\u044f \u043e\u0431\u043e\u0445.<\/p>\n<p>\u0422\u043e\u0434\u0456 \u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0456\u043c\u043e, \u0449\u043e \u0432\u0438 \u043f\u0440\u0430\u0446\u044e\u0454\u0442\u0435 \u0437 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044c\u043a\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0434\u043b\u044f \u043f\u043e\u0434\u0456\u0439, \u0456 \u0432\u0438 \u0442\u0430\u043a\u043e\u0436 \u043f\u0440\u0430\u0446\u044e\u0454\u0442\u0435 \u0437 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u0438\u043c\u0438 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0442\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043f\u043e\u0432\u2019\u044f\u0437\u0430\u043d\u0438\u043c\u0438 \u0437 \u0447\u0438\u043c\u043e\u0441\u044c \u043d\u0430 \u0437\u0440\u0430\u0437\u043e\u043a \u043f\u043e\u0434\u0456\u0439.<\/p>\n<p>\u0412\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 \u0449\u043e\u0441\u044c \u043d\u0430 \u043a\u0448\u0442\u0430\u043b\u0442:<\/p>\n<ul>\n<li>\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043d\u0430\u0437\u0432\u0443 \u043f\u043e\u0434\u0456\u0457,<\/li>\n<li>\u0437\u043d\u0430\u0439\u0442\u0438 \u0456\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0456\u044e \u043f\u0440\u043e \u043c\u0456\u0441\u0446\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u0437\u0430\u0445\u043e\u0434\u0443,<\/li>\n<li>\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043f\u0435\u0440\u0448\u0438\u0439 \u0442\u0438\u043f \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0442\u0430 \u0441\u0442\u0430\u0442\u0443\u0441, \u0443\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u0430\u043d\u0438\u0439 \u0437\u0430 \u0457\u0457 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440\u043e\u043c<\/li>\n<\/ul>\n<p>\u0423\u0441\u044f \u0446\u044f \u0456\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0456\u044f \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0440\u043e\u0437\u043a\u0438\u0434\u0430\u043d\u0430 \u0432 \u0440\u0456\u0437\u043d\u0438\u0445 \u043c\u0456\u0441\u0446\u044f\u0445, \u0456 \u0441\u043f\u043e\u0441\u0456\u0431 \u0457\u0457 \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u043c\u043e\u0436\u0435 \u0432\u0456\u0434\u0440\u0456\u0437\u043d\u044f\u0442\u0438\u0441\u044f.<\/p>\n<h3>1 \u041e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u043d\u0430\u0437\u0432\u0438 \u043f\u043e\u0434\u0456\u0457<\/h3>\n<p>\u042f\u043a\u0449\u043e \u043c\u0438 \u043f\u0440\u0430\u0446\u044e\u0454\u043c\u043e \u0437 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u043b\u044c\u043d\u0438\u0446\u044c\u043a\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457, \u0456 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043d\u0430\u0437\u0432\u0443 \u043f\u043e\u0434\u0456\u0457, \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0442\u0430 <a href=\"https:\/\/gist.github.com\/tommcfarlin\/24e5bae859863d39512abc2af2169fbb#file-00-get-event-name-php\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043e\u0434\u043d\u0443 \u0437 \u0444\u0443\u043d\u043a\u0446\u0456\u0439 API WordPress<\/a>.<\/p>\n<pre><code>&lt;?php\n\n\/**\n * Retrieves the title of the Event, a custom post type.\n *\n * @param  int    $eventId the ID of the event post type\n * @return string          the title of the post.\n *\/\npublic function getName(int $eventId): string\n{\n  return get_the_title($eventId);\n}<\/code><\/pre>\n<p>\u0426\u0435 \u043e\u0434\u0438\u043d \u0432\u0438\u043f\u0430\u0434\u043e\u043a, \u043a\u043e\u043b\u0438 \u0441\u0445\u043e\u0432\u0438\u0449\u0435 \u0434\u0430\u043d\u0438\u0445 \u0432\u0441\u0435 \u0449\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u043e\u0432\u0430\u043d\u043e \u0432\u0456\u0434 \u043d\u0430\u0441 \u0456 \u043d\u0430\u0442\u043e\u043c\u0456\u0441\u0442\u044c \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454 \u0456\u0441\u043d\u0443\u044e\u0447\u0438\u0439 API WordPress.<\/p>\n<h3>2 \u041e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u043c\u0456\u0441\u0446\u044f \u043f\u043e\u0434\u0456\u0457<\/h3>\n<p>\u0423 \u0446\u044c\u043e\u043c\u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u0442\u0438, \u0449\u043e \u043c\u0456\u0441\u0446\u0435 \u043f\u043e\u0434\u0456\u0457 \u0431\u0443\u043b\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443 \u0430\u0431\u043e, \u043c\u043e\u0436\u043b\u0438\u0432\u043e, \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0456\u043c API. \u0410 \u043e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u043c\u0456\u0441\u0446\u0435\u0437\u043d\u0430\u0445\u043e\u0434\u0436\u0435\u043d\u043d\u044f \u043f\u043e\u0432\u2019\u044f\u0437\u0430\u043d\u0435 \u0437 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u044e \u043f\u043e\u0434\u0456\u0454\u044e, \u0432\u043e\u043d\u043e \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0456 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u0438\u0445 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457.<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-160195-61e7073d3924f.png\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-160195-61e7073d3924f.png\" alt=\"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0438\u0439 \u043f\u0440\u0438\u043a\u043b\u0430\u0434 \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u0441\u0445\u043e\u0432\u0438\u0449\u0430 \u0432 WordPress\"><\/a><\/p>\n<p>\u0417\u043d\u043e\u0432\u0443 \u0436 \u0442\u0430\u043a\u0438, \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0439\u043e\u0433\u043e \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u044e\u0447\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0456\u0439 API; \u043e\u0434\u043d\u0430\u043a \u0443 \u043f\u043e\u0434\u0456\u0431\u043d\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0456\u044f\u0445 \u043c\u0430\u0454 \u0441\u0435\u043d\u0441 \u043c\u0430\u0442\u0438 \u0434\u043e\u043f\u043e\u043c\u0456\u0436\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0456\u044e, \u0442\u043e\u043c\u0443 \u0449\u043e \u043c\u0438, \u0439\u043c\u043e\u0432\u0456\u0440\u043d\u043e, \u043c\u0430\u0442\u0438\u043c\u0435\u043c\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u0456 \u0434\u043e \u0456\u043d\u0448\u0438\u0445 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u0438\u0445.<\/p>\n<p>\u041e\u0442\u0436\u0435, \u0441\u043f\u043e\u0447\u0430\u0442\u043a\u0443 <a href=\"https:\/\/gist.github.com\/tommcfarlin\/24e5bae859863d39512abc2af2169fbb#file-01-get-the-event-location-helper-php\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043f\u043e\u043c\u0456\u0447\u043d\u0438\u043a<\/a> :<\/p>\n<pre><code>&lt;?php \n\/**\n * A helper function for easily retrieving post meta data for a given Event.\n *\n * @param int    $id  the ID of the event\n * @param string $key the key for the post meta data for which we're retrieveing the data\n *\n * @return string the result of retrieiving the meta data\n *\/\nprivate function get(int $id, string $key): string\n{\n    return get_post_meta($id, $key, true);\n}<\/code><\/pre>\n<p>\u0410 \u043f\u043e\u0442\u0456\u043c \u0444\u0443\u043d\u043a\u0446\u0456\u044f, \u044f\u043a\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454 \u043f\u043e\u043c\u0456\u0447\u043d\u0438\u043a \u0434\u043b\u044f <a href=\"https:\/\/gist.github.com\/tommcfarlin\/24e5bae859863d39512abc2af2169fbb#file-02-get-the-event-location-php\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u0440\u043e\u0437\u0442\u0430\u0448\u0443\u0432\u0430\u043d\u043d\u044f<\/a> :<\/p>\n<pre><code>&lt;?php\n\/**\n * @param  int    $eventID the ID of the event\n * @return string          the name of the event of an empty string\n *\/\npublic function getLocationName($eventId): string\n{\n    return $this-&gt;get($eventId, 'ymc-event-location-name');\n}<\/code><\/pre>\n<p>\u0410\u043b\u0435 \u0432 \u0446\u0438\u0445 \u0434\u0432\u043e\u0445 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u0430\u0445 \u043c\u0438 \u0432\u0441\u0435 \u0449\u0435 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u043c\u043e \u043d\u0430\u044f\u0432\u043d\u0456 \u0444\u0443\u043d\u043a\u0446\u0456\u0457 API. \u0410 \u044f\u043a \u0449\u043e\u0434\u043e \u0432\u0438\u043f\u0430\u0434\u043a\u0443, \u043a\u043e\u043b\u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0441\u043f\u0456\u043b\u043a\u0443\u0432\u0430\u0442\u0438\u0441\u044f \u0437 \u0431\u0430\u0437\u043e\u044e \u0434\u0430\u043d\u0438\u0445?<\/p>\n<h3>3 \u041e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f URL-\u0430\u0434\u0440\u0435\u0441\u0438 \u043e\u0434\u043d\u0456\u0454\u0457 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457<\/h3>\n<p>\u0423 \u0446\u044c\u043e\u043c\u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u043c\u0438 \u0431\u0443\u0434\u0435\u043c\u043e \u0441\u043f\u0456\u043b\u043a\u0443\u0432\u0430\u0442\u0438\u0441\u044f \u0431\u0435\u0437\u043f\u043e\u0441\u0435\u0440\u0435\u0434\u043d\u044c\u043e \u0437 \u0431\u0430\u0437\u043e\u044e \u0434\u0430\u043d\u0438\u0445 WordPress. \u042f\u043a\u0449\u043e \u0432\u0438 \u0437\u043d\u0430\u0439\u043e\u043c\u0456 \u0437 \u043e\u0431\u2019\u0454\u043a\u0442\u043e\u043c <a href=\"https:\/\/codex.wordpress.org\/Class_Reference\/wpdb\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">$wpdb<\/a> \u0456 SQL, \u0442\u043e \u0446\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435 \u0432\u0435\u043b\u0438\u043a\u043e\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u044e.<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-160195-61e70741367bc.png\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-160195-61e70741367bc.png\" alt=\"\u0417\u0430\u0433\u0430\u043b\u044c\u043d\u0438\u0439 \u043f\u0440\u0438\u043a\u043b\u0430\u0434 \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u0441\u0445\u043e\u0432\u0438\u0449\u0430 \u0432 WordPress\"><\/a><\/p>\n<p>\u042f\u043a\u0449\u043e \u0432\u0438 \u043d\u0456, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u043f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0456\u044e <a href=\"https:\/\/codex.wordpress.org\/Data_Validation#Database\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043f\u0456\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438<\/a>, \u0430 \u0442\u0430\u043a\u043e\u0436 \u043f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0456\u044e <a href=\"https:\/\/codex.wordpress.org\/Class_Reference\/wpdb#Talking_to_the_Database:_The_wpdb_Class\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">get_results<\/a>.<\/p>\n<p>\u0412\u0440\u0430\u0445\u043e\u0432\u0443\u044e\u0447\u0438 \u0446\u0435, \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u0438 \u0437\u0430\u043f\u0438\u0442, \u044f\u043a\u0438\u0439 \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u0442\u0438\u043c\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0435:<\/p>\n<ol>\n<li>\u0437\u0430\u0445\u043e\u043f\u0438\u0442\u0438 \u0432\u0441\u0456 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457, \u0434\u0435 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u0430\u0454 \u043f\u0435\u0432\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044e, \u0442\u0438\u043f \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0442\u0430 \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0454 \u043f\u0435\u0432\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f\u043c, \u0456 \u043c\u0438 \u0432\u043f\u043e\u0440\u044f\u0434\u043a\u0443\u0454\u043c\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438 \u0437\u0430 \u0437\u0440\u043e\u0441\u0442\u0430\u043d\u043d\u044f\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440\u0430,<\/li>\n<li>\u043f\u043e\u0442\u0456\u043c \u043c\u0438 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0454\u043c\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438 \u0446\u044c\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0442\u0443, \u0449\u043e\u0431 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043e\u0434\u043d\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f.<\/li>\n<\/ol>\n<p>\u0406 <a href=\"https:\/\/gist.github.com\/tommcfarlin\/24e5bae859863d39512abc2af2169fbb#file-03-get-single-post-url-php\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0437\u0440\u043e\u0431\u0438\u0442\u0438 \u0446\u0435<\/a>, \u043e\u0442\u0440\u0438\u043c\u0430\u0432\u0448\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u0431\u0430\u0437\u0438 \u0434\u0430\u043d\u0438\u0445 \u0456 \u043d\u0430\u043f\u0438\u0441\u0430\u0432\u0448\u0438 \u0432\u043a\u043b\u0430\u0434\u0435\u043d\u0438\u0439 \u0437\u0430\u043f\u0438\u0442:<\/p>\n<pre><code>&lt;?php\n\n\/**\n * @return string the URL to the event next to the current event.\n *\/\npublic function getNextEventUrl()\n{\n    global $wpdb;\n    $results = $wpdb-&gt;get_results(\n        $wpdb-&gt;prepare(\n            \"\n            SELECT *\n            FROM $wpdb-&gt;posts\n            WHERE ID &gt; (SELECT ID\n                FROM $wpdb-&gt;posts\n                WHERE ID = %d\n                AND post_type = '%s'\n                AND post_status = '%s'\n                ORDER BY ID ASC) AND post_type = '%s'\n            AND post_status = '%s'\n            ORDER BY ID ASC\n            LIMIT 1\n        \",\n            get_the_ID(),\n            'ymc-events',\n            'publish',\n            'ymc-events',\n            'publish') );\n\n  $result = (isset($result[0]))? $result[0]: '';\n\n  return $result;\n}<\/code><\/pre>\n<p>\u0406 \u0442\u043e\u0434\u0456 \u0432\u0441\u0435 \u0446\u0435 \u043c\u043e\u0436\u043d\u0430 \u0456\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044e\u0432\u0430\u0442\u0438 \u0432 \u043e\u0434\u0438\u043d \u043a\u043b\u0430\u0441, \u044f\u043a\u0438\u0439 \u0431\u0443\u0434\u0435, \u0441\u043a\u0430\u0436\u0456\u043c\u043e, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u0454\u043c \u043f\u043e\u0434\u0456\u0439 (\u0430\u0431\u043e <strong>EventRepository<\/strong> ).<\/p>\n<p>\u041f\u0440\u043e\u0442\u0435 \u044f \u0440\u043e\u0437\u043f\u043e\u0432\u0456\u043c \u043f\u0440\u043e \u0446\u0435 \u0431\u0456\u043b\u044c\u0448\u0435 \u0432 \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0456\u0439 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457. \u0410 \u0441\u0430\u043c\u0435, \u044f\u043a \u043e\u0431\u0440\u043e\u0431\u043b\u044f\u0442\u0438 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0442\u043e\u0433\u043e, \u044f\u043a\u0456 \u0444\u0443\u043d\u043a\u0446\u0456\u0457 \u043a\u0443\u0434\u0438 \u043d\u0430\u043b\u0435\u0436\u0430\u0442\u044c, \u0434\u043e\u043c\u043e\u0432\u043b\u0435\u043d\u043e\u0441\u0442\u0456 \u043f\u0440\u043e \u0456\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u0442\u0430 \u044f\u043a \u043e\u0431\u0440\u043e\u0431\u043b\u044f\u0442\u0438 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043d\u044f, \u044f\u043a\u0449\u043e \u0432\u0438 \u0442\u0430\u043a\u043e\u0436 \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0432\u0435\u0441\u0442\u0438 \u0446\u0435 \u0443 \u0441\u0432\u0456\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u0439.<\/p>\n<h2>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u0439 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043e<\/h2>\n<p>\u041f\u0435\u0440\u0448 \u0437\u0430 \u0432\u0441\u0435 \u043c\u0430\u0439\u0442\u0435 \u043d\u0430 \u0443\u0432\u0430\u0437\u0456:<\/p>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u044e \u043c\u0430\u0441\u043a\u0443\u0454 \u0441\u043f\u043e\u0441\u0456\u0431 \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u0434\u0430\u043d\u0438\u0445, \u0430\u043b\u0435 \u0437\u0430\u0431\u0435\u0437\u043f\u0435\u0447\u0443\u0454 \u043f\u043e\u0441\u043b\u0456\u0434\u043e\u0432\u043d\u0438\u0439 \u0441\u043f\u043e\u0441\u0456\u0431 \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u0434\u0430\u043d\u0438\u0445, \u0437 \u044f\u043a\u0438\u043c\u0438 \u0432\u043e\u043d\u0438 \u043f\u043e\u0432\u2019\u044f\u0437\u0430\u043d\u0456.<\/p>\n<p>\u0425\u0442\u043e\u0441\u044c \u0442\u0430\u043a\u043e\u0436 \u043c\u043e\u0436\u0435 \u0434\u043e\u0434\u0430\u0442\u0438, \u044f\u043a \u0439\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u0430 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 <strong>\u0442\u0430<\/strong> \u044f\u043a \u0446\u0435 \u043c\u043e\u0436\u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u0438, \u0430\u043b\u0435, \u043c\u043e\u0436\u043b\u0438\u0432\u043e, \u044f \u043e\u0431\u0433\u043e\u0432\u043e\u0440\u044e \u0446\u0435 \u0432 \u0456\u043d\u0448\u0456\u0439 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457.<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">\u0414\u0436\u0435\u0440\u0435\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0443:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/tommcfarlin.com\" class=\"external external_icon\">tommcfarlin.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0428\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u044e \u0437\u0430\u0431\u0435\u0437\u043f\u0435\u0447\u0443\u0454 \u043f\u043e\u0441\u043b\u0456\u0434\u043e\u0432\u043d\u0438\u0439 \u0441\u043f\u043e\u0441\u0456\u0431 \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u0434\u0430\u043d\u0438\u0445. \u041e\u0441\u044c \u044f\u043a \u0446\u0435 \u043c\u043e\u0436\u043d\u0430 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 \u0432 \u043f\u043b\u0430\u0433\u0456\u043d\u0456 WordPress.<\/p>\n","protected":false},"author":1,"featured_media":236255,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[869,902,725],"tags":[1174],"class_list":["post-231281","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-10","category-kod-3","category-rozrobnyk","tag-affiai-uk"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/231281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/comments?post=231281"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/231281\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media\/236255"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media?parent=231281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/categories?post=231281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/tags?post=231281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}