{"id":230448,"date":"2022-12-04T13:05:00","date_gmt":"2022-12-04T10:05:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=230448"},"modified":"2022-11-09T22:26:13","modified_gmt":"2022-11-09T19:26:13","slug":"vikoristannja-shablonu-reiestru-v-wordpress","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/uk\/vikoristannja-shablonu-reiestru-v-wordpress\/","title":{"rendered":"\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u0440\u0435\u0454\u0441\u0442\u0440\u0443 \u0432 WordPress"},"content":{"rendered":"\n<p>\u042f \u043c\u0430\u0432 \u043a\u0456\u043b\u044c\u043a\u0430 \u0431\u0435\u0441\u0456\u0434 \u0437 \u0440\u0456\u0437\u043d\u0438\u043c\u0438 \u0434\u0440\u0443\u0437\u044f\u043c\u0438 \u0442\u0430 \u0456\u043d\u0448\u0438\u043c\u0438 \u0432 Twitter \u043f\u0440\u043e \u043f\u043e\u043d\u044f\u0442\u0442\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0438\u0445 \u0437\u043c\u0456\u043d\u043d\u0438\u0445 \u0443 \u043c\u043e\u0432\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0443\u0432\u0430\u043d\u043d\u044f. \u0414\u043b\u044f \u0442\u0438\u0445, \u0445\u0442\u043e \u043d\u043e\u0432\u0430\u0447\u043e\u043a \u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0443\u0432\u0430\u043d\u043d\u0456 \u0430\u0431\u043e \u0445\u0442\u043e \u043d\u0435 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0438\u0439, \u0447\u043e\u043c\u0443 \u0432\u043e\u043d\u0438 \u043f\u043e\u0433\u0430\u043d\u0456:<\/p>\n<blockquote>\n<p>\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0438\u0445 \u0437\u043c\u0456\u043d\u043d\u0438\u0445 \u0443\u0441\u043a\u043b\u0430\u0434\u043d\u044e\u0454 \u0447\u0438\u0442\u0430\u043d\u043d\u044f \u0442\u0430 \u0440\u043e\u0437\u0443\u043c\u0456\u043d\u043d\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0431\u0435\u0437\u043f\u0435\u0447\u0435\u043d\u043d\u044f. \u041e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u0431\u0443\u0434\u044c-\u044f\u043a\u0438\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u044c-\u0434\u0435 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0456 \u043c\u043e\u0436\u0435 \u0437\u043c\u0456\u043d\u0438\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u043c\u0456\u043d\u043d\u043e\u0457 \u0432 \u0431\u0443\u0434\u044c-\u044f\u043a\u0438\u0439 \u0447\u0430\u0441, \u0440\u043e\u0437\u0443\u043c\u0456\u043d\u043d\u044f \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0437\u043c\u0456\u043d\u043d\u043e\u0457 \u043c\u043e\u0436\u0435 \u043f\u0440\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0434\u043e \u0440\u043e\u0437\u0443\u043c\u0456\u043d\u043d\u044f \u0437\u043d\u0430\u0447\u043d\u043e\u0457 \u0447\u0430\u0441\u0442\u0438\u043d\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438.<\/p>\n<\/blockquote>\n<p>\u0426\u0435 \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0454, <strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Global_variable\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0449\u043e \u0432\u043e\u043d\u0438 \u043d\u0435 \u0437\u0430\u0441\u0442\u043e\u0441\u043e\u0432\u0443\u044e\u0442\u044c\u0441\u044f<\/a><\/strong>, \u0430\u043b\u0435 \u044f\u043a\u0449\u043e \u0432\u0438 \u0437\u0430\u0446\u0456\u043a\u0430\u0432\u043b\u0435\u043d\u0456 \u0432 \u043e\u0431&#8217;\u0454\u043a\u0442\u043d\u043e-\u043e\u0440\u0456\u0454\u043d\u0442\u043e\u0432\u0430\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0443\u0432\u0430\u043d\u043d\u0456 (\u043e\u0441\u043e\u0431\u043b\u0438\u0432\u043e \u0432 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f\u0445 WordPress, \u0434\u0435 \u0432\u0438 \u0437\u0431\u0438\u0440\u0430\u0454\u0442\u0435\u0441\u044f \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 PHP), \u0442\u043e \u0432\u0430\u0436\u043b\u0438\u0432\u043e \u0437\u0440\u043e\u0437\u0443\u043c\u0456\u0442\u0438 \u0434\u0435\u044f\u043a\u0456 \u043a\u0440\u0430\u0449\u0456 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0438 \u043d\u0456\u0436 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0456 \u0437\u043c\u0456\u043d\u043d\u0456.<\/p>\n<p>\u0422\u043e\u0431\u0442\u043e \u0456\u0441\u043d\u0443\u044e\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u0438 \u0440\u043e\u0431\u043e\u0442\u0438 \u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u044e \u0434\u0430\u043d\u0438\u0445 \u043d\u0430\u0432\u043a\u043e\u043b\u043e \u0432\u0430\u0448\u043e\u0457 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u043e\u0441\u0442\u0456 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0438\u0445 \u0437\u043c\u0456\u043d\u043d\u0438\u0445. \u0406 \u043e\u0434\u043d\u0438\u043c \u0456\u0437 \u0442\u0430\u043a\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0456\u0432 \u0454 \u0448\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u0454\u0441\u0442\u0440\u0443.<\/p>\n<h2>\u0428\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u0454\u0441\u0442\u0440\u0443 \u0432 WordPress<\/h2>\n<p>\u041f\u043e-\u043f\u0435\u0440\u0448\u0435, \u0437\u0430\u0443\u0432\u0430\u0436\u0442\u0435, \u0449\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0432\u0438\u0445\u043e\u0434\u044f\u0442\u044c \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0431\u0443\u0434\u044c-\u044f\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443. \u041f\u043e\u043a\u0438 \u043c\u043e\u0432\u0430 \u043f\u0440\u043e\u043f\u043e\u043d\u0443\u0454 \u043f\u043e\u043d\u044f\u0442\u0442\u044f \u043e\u0431\u2019\u0454\u043a\u0442\u0456\u0432 (\u0430\u0431\u043e \u043d\u0430\u0432\u0456\u0442\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0456\u0439), \u043c\u043e\u0436\u043d\u0430 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<p>\u0410\u043b\u0435 \u043d\u0430\u0432\u0456\u0449\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0446\u0435?<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-163107-61e74a43bb7bf.jpg\" 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-163107-61e74a43bb7bf.jpg\" alt=\"\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u0440\u0435\u0454\u0441\u0442\u0440\u0443 \u0432 WordPress\" ><\/a><\/p>\n<p>\u0424\u043e\u0442\u043e \u0421\u0435\u043c\u044e\u0435\u043b\u044f \u0417\u0435\u043b\u043b\u0435\u0440\u0430 \u043d\u0430 Unsplash<\/p>\n<p>\u041a\u043e\u0440\u043e\u0442\u0448\u0435 \u043a\u0430\u0436\u0443\u0447\u0438, \u0432\u0456\u043d \u0437\u0430\u0431\u0435\u0437\u043f\u0435\u0447\u0443\u0454 \u043e\u0431\u2019\u0454\u043a\u0442\u043d\u043e-\u043e\u0440\u0456\u0454\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u0439 \u0441\u043f\u043e\u0441\u0456\u0431 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0456 \u0456\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0456\u0457 \u043d\u0430\u0432\u043a\u043e\u043b\u043e \u0432\u0430\u0448\u043e\u0457 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u043e\u0441\u0442\u0456 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0438\u0445 \u0437\u043c\u0456\u043d\u043d\u0438\u0445. \u0422\u0430\u043a\u0456 \u0440\u0435\u0447\u0456, \u044f\u043a <strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Dependency_injection\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438 \u0456\u043d\u2019\u0454\u043a\u0446\u0456\u0457 \u0437\u0430\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0435\u0439<\/a><\/strong>, \u0442\u0430\u043a\u043e\u0436 \u043f\u0456\u0434\u0445\u043e\u0434\u044f\u0442\u044c \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e, \u0430\u043b\u0435 \u0432\u043e\u043d\u0438 \u0432\u0438\u0445\u043e\u0434\u044f\u0442\u044c \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0446\u0456\u0454\u0457 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457. \u042f \u0442\u0430\u043a\u043e\u0436 \u0441\u0442\u0432\u0435\u0440\u0434\u0436\u0443\u044e, \u0449\u043e \u0431\u0443\u0432\u0430\u044e\u0442\u044c \u0432\u0438\u043f\u0430\u0434\u043a\u0438, \u043a\u043e\u043b\u0438 \u0432\u043e\u043d\u0438 \u043c\u043e\u0436\u0443\u0442\u044c \u0431\u0443\u0442\u0438 \u043d\u0430\u0434\u043c\u0456\u0440\u043d\u0438\u043c\u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0456 \u043d\u0435\u0432\u0435\u043b\u0438\u043a\u0438\u0445 \u043f\u043b\u0430\u0433\u0456\u043d\u0456\u0432.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0443<\/h3>\n<p>\u0417 \u043e\u0433\u043b\u044f\u0434\u0443 \u043d\u0430 \u0446\u0435, \u044f\u043a \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u0454\u0441\u0442\u0440\u0443 \u0432 WordPress, \u0430 \u043f\u043e\u0442\u0456\u043c \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0439\u043e\u0433\u043e \u0432 \u043d\u0430\u0448\u0456\u0439 \u0440\u043e\u0431\u043e\u0442\u0456? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0440\u043e\u0437\u0433\u043b\u044f\u043d\u0435\u043c\u043e <strong><a href=\"https:\/\/gist.github.com\/tommcfarlin\/2f9f0c09dd21c2b8214a787686d778c6#file-00-repository-php\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043e\u0441\u043d\u043e\u0432\u043d\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432\u0456\u0437\u0435\u0440\u0443\u043d\u043a\u0430<\/a><\/strong> :<\/p>\n<pre><code>&lt;?php\n\n\/**\n * Serves as a registry for all objects that need to be accessed globally throughout the\n * plugin.\n *\/\nclass Registry\n{\n\n  \/**\n   * @var array The array used to the the various objects that will be used in the plugin.\n   *\/\n  private $storage;\n\n  \/**\n   * Initializes the plugin by creating an instance of an empty array.\n   *\/\n  public function __construct()\n  {\n      $this-&gt;storage = [];\n  }\n\n  \/**\n   * Adds an instance of a class to the registry's storage array using the given key\n   *\n   * @param string $id    The ID of the object to be used to retrieve it later in the plugin.\n   * @param mixed  $class An instance of the class that will be associated with the specified key.\n   *\/\n  public function add($id, $class)\n  {\n      $this-&gt;storage[$id] = $class;\n  }\n\n  \/**\n   * @param string $id    The ID of the object to retrieve from the repository.\n   * @return mixed $class An instance of the class associated with the specified key (or null if it doesn't exist).\n   *\/\n  public function get($id)\n  {\n      return array_key_exists($id, $this-&gt;storage)? $this-&gt;storage[$id]: null;\n  }\n}<\/code><\/pre>\n<p>\u0417\u0430\u0443\u0432\u0430\u0436\u0442\u0435, \u0449\u043e \u0439\u043e\u0433\u043e \u0440\u0435\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u044f \u0434\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0430:<\/p>\n<ol>\n<li>\u041a\u043b\u0430\u0441 \u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0454\u0434\u0438\u043d\u0438\u0439 \u043c\u0430\u0441\u0438\u0432 \u044f\u043a \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0443 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u0456\u0441\u0442\u044c.<\/li>\n<li>\u0414\u0430\u043d\u0456 \u0434\u043e\u0434\u0430\u044e\u0442\u044c\u0441\u044f \u0434\u043e \u043c\u0430\u0441\u0438\u0432\u0443 \u0437 \u043f\u0435\u0432\u043d\u0438\u043c \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440\u043e\u043c.<\/li>\n<li>\u0414\u0430\u043d\u0456 \u043c\u043e\u0436\u043d\u0430 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u0437 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440\u043e\u043c.<\/li>\n<\/ol>\n<p>\u0412\u0438 \u043d\u0430\u0432\u0456\u0442\u044c \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0456\u0434\u043d\u044f\u0442\u0438 \u0446\u0435\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0430 \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u0439 \u0440\u0456\u0432\u0435\u043d\u044c, \u044f\u043a\u0449\u043e \u0432\u0456\u043d \u043f\u0440\u0438\u0439\u043c\u0430\u0454 \u043b\u0438\u0448\u0435 \u043a\u043b\u0430\u0441 \u043f\u0435\u0432\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 (\u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, AbstractEvent), \u0430 \u043f\u043e\u0442\u0456\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0432\u0438\u043a\u043b\u0438\u043a\u0430\u0454 \u0444\u0443\u043d\u043a\u0446\u0456\u044e \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0443 \u0449\u043e\u0440\u0430\u0437\u0443, \u043a\u043e\u043b\u0438 \u0432\u0456\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0454\u0442\u044c\u0441\u044f (\u0430\u0431\u043e \u043e\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f) \u0437 \u0440\u0435\u0454\u0441\u0442\u0440\u0443.<\/p>\n<p>\u0410\u043b\u0435 \u0446\u0435 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0443 \u0431\u0456\u043b\u044c\u0448 \u0441\u043a\u043b\u0430\u0434\u043d\u0443 \u0440\u0435\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u044e, \u044f\u043a\u0443 \u044f \u0445\u043e\u0442\u0456\u0432 \u0431\u0438 \u0434\u043b\u044f \u0446\u0456\u0454\u0457 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457.<\/p>\n<h3>\u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0440\u0435\u0454\u0441\u0442\u0440\u0443<\/h3>\n<p>\u0427\u0435\u0440\u0435\u0437 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0441\u0438\u0441\u0442\u0435\u043c\u0438 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044f WordPress \u0456\u0441\u043d\u0443\u0454 \u043f\u0435\u0432\u043d\u0438\u0439 \u0441\u043f\u043e\u0441\u0456\u0431 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0440\u0435\u0454\u0441\u0442\u0440\u0443, \u0430 \u043f\u043e\u0442\u0456\u043c \u0439\u043e\u0433\u043e \u0440\u0435\u0454\u0441\u0442\u0440\u0430\u0446\u0456\u0457 \u0432 WordPress.<\/p>\n<p>\u041f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u043e, \u0432\u0438 \u043f\u0440\u0430\u0446\u044e\u0454\u0442\u0435 \u0437 \u043f\u043b\u0430\u0433\u0456\u043d\u043e\u043c. \u0423 \u0444\u0430\u0439\u043b\u0456 \u043f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u043f\u043b\u0430\u0433\u0456\u043d\u0430 <strong><a href=\"https:\/\/gist.github.com\/tommcfarlin\/2f9f0c09dd21c2b8214a787686d778c6#file-01-register-repository-php\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0432\u0438\u043a\u043e\u043d\u0430\u0439\u0442\u0435 \u0449\u043e\u0441\u044c \u043d\u0430 \u0437\u0440\u0430\u0437\u043e\u043a \u0446\u044c\u043e\u0433\u043e:<\/a><\/strong><\/p>\n<pre><code>&lt;?php\n\n\/**\n * Creates a Registry using the Registry Design Pattern to store objects\n * that can be used throughout the plugin.\n *\n *\/\n$registry = new Registry();\nadd_filter('acmeRegistry', function() use ($registry) {\n  return $registry;\n});<\/code><\/pre>\n<p>\u0426\u0435 \u0441\u0442\u0432\u043e\u0440\u044e\u0454 \u0440\u0435\u0454\u0441\u0442\u0440, \u0430 \u043f\u043e\u0442\u0456\u043c \u0441\u0442\u0432\u043e\u0440\u044e\u0454 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0438\u0439 \u0444\u0456\u043b\u044c\u0442\u0440, \u044f\u043a\u0438\u0439 \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u043f\u0456\u0437\u043d\u0456\u0448\u0435 \u0432 \u043f\u043b\u0430\u0433\u0456\u043d\u0456 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u0440\u0435\u0454\u0441\u0442\u0440\u0443 \u0442\u0430 \u0456\u043d\u0448\u0438\u0445 \u043e\u0431\u2019\u0454\u043a\u0442\u0456\u0432, \u044f\u043a\u0456 \u0432\u0456\u043d \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454.<\/p>\n<h3>\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0440\u0435\u0454\u0441\u0442\u0440\u0443<\/h3>\n<p>\u0429\u043e\u0431 \u0434\u043e\u0434\u0430\u0442\u0438 \u043e\u0431\u2019\u0454\u043a\u0442 \u0434\u043e \u0440\u0435\u0454\u0441\u0442\u0440\u0443, <strong><a href=\"https:\/\/gist.github.com\/tommcfarlin\/2f9f0c09dd21c2b8214a787686d778c6#file-02-adding-data-php\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0432\u0438\u043a\u043b\u0438\u0447\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0456\u044e add \u0456 \u043f\u0435\u0440\u0435\u0434\u0430\u0439\u0442\u0435 \u0443\u043d\u0456\u043a\u0430\u043b\u044c\u043d\u0438\u0439 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440 \u0442\u0430 \u0435\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043e\u0431\u2019\u0454\u043a\u0442\u0430<\/a><\/strong>. \u0417\u0430\u0443\u0432\u0430\u0436\u0442\u0435, \u0449\u043e \u043d\u0430\u0448\u0430 \u043f\u043e\u0442\u043e\u0447\u043d\u0430 \u0440\u0435\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u044f \u0432\u0438\u043a\u0438\u0434\u0430\u0454 \u0431\u0443\u0434\u044c-\u044f\u043a\u0456 \u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u0456 \u0435\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0438 \u043e\u0431\u2019\u0454\u043a\u0442\u0430, \u044f\u043a\u0438\u0439 \u043c\u0430\u0454 \u0442\u043e\u0439 \u0441\u0430\u043c\u0438\u0439 \u043a\u043b\u044e\u0447, \u0456 \u0437\u0430\u043c\u0456\u043d\u044e\u0454 \u0439\u043e\u0433\u043e \u0442\u0438\u043c, \u0449\u043e \u043c\u0438 \u0439\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0454\u043c\u043e.<\/p>\n<pre><code>&lt;?php\n\n\/**\n * Get an reference to the repository and add an instance of a \n * PostManager to it. The PostManager is a class that allows us\n * to manipulate posts.\n *\/\n$this-&gt;registry = apply_filters('acmeRegistry', null);\n$this-&gt;registry-&gt;add('postManager', new PostManager());<\/code><\/pre>\n<p>\u0417\u0432\u0456\u0434\u0442\u0438 \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 <strong><a href=\"https:\/\/gist.github.com\/tommcfarlin\/2f9f0c09dd21c2b8214a787686d778c6#file-03-using-data-php\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043e\u0431\u2019\u0454\u043a\u0442\u0438<\/a><\/strong>, \u044f\u043a\u0456 \u0432\u0438 \u0437\u0431\u0435\u0440\u0435\u0433\u043b\u0438 \u0432 \u0440\u0435\u0454\u0441\u0442\u0440\u0456:<\/p>\n<pre><code>&lt;?php\n\n\/**\n * Get an reference to the repository, get a reference to the PostManager\n * then you can begin working with it.\n *\/\n$this-&gt;registry = apply_filters('acmeRegistry', null);\n$this-&gt;registry-&gt;add('postManager', new PostManager());\n\n\/\/ An example call that you can make to set the title of the post.\n$postManager-&gt;updateTitle('This Is the New Title');\n<\/code><\/pre>\n<p>\u0406 \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0457\u0445 \u0442\u0430\u043a \u0441\u0430\u043c\u043e, \u044f\u043a \u0456 \u0431\u0443\u0434\u044c-\u044f\u043a\u0438\u043c \u0456\u043d\u0448\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0410\u043b\u0435 \u0446\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u044f\u0454 \u0443\u043d\u0438\u043a\u043d\u0443\u0442\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438 \u0443 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u0456 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u0456\u0432, \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0438\u0445 \u0437\u043c\u0456\u043d\u043d\u0438\u0445 \u0430\u0431\u043e \u0456\u043d\u0448\u0438\u0445 \u043d\u0435\u0431\u0435\u0437\u043f\u0435\u0447\u043d\u0438\u0445 \u0440\u0435\u0447\u0435\u0439.<\/p>\n<h2>\u041a\u0456\u043b\u044c\u043a\u0430 \u0441\u043b\u0456\u0432 \u043f\u0440\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u043d\u0456\u0441\u0442\u044c<\/h2>\n<p>\u0429\u0435 \u043e\u0434\u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u0430\u0433\u0430, \u044f\u043a\u0443 \u044f \u0431\u0430\u0447\u0443 \u0443 \u0440\u0435\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457 \u0446\u044c\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443, \u043f\u043e\u043b\u044f\u0433\u0430\u0454 \u0432 \u0442\u043e\u043c\u0443, \u0449\u043e \u0432\u0456\u043d \u043d\u0435 \u0442\u0456\u043b\u044c\u043a\u0438 \u0434\u043e\u0437\u0432\u043e\u043b\u044f\u0454 \u043b\u0435\u0433\u0448\u0435 \u043f\u0438\u0441\u0430\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0456 \u0442\u0435\u0441\u0442\u0438 \u0434\u043b\u044f \u043d\u044c\u043e\u0433\u043e, \u0430\u043b\u0435 \u0442\u0430\u043a\u043e\u0436 \u0434\u0430\u0454 \u0432\u0430\u043c \u043c\u043e\u0436\u043b\u0438\u0432\u0456\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u0438 \u0442\u0435\u0441\u0442\u0438 \u0434\u043b\u044f \u043e\u0431\u2019\u0454\u043a\u0442\u0456\u0432, \u044f\u043a\u0456 \u0432\u0456\u043d \u043c\u043e\u0436\u0435 \u043c\u0456\u0441\u0442\u0438\u0442\u0438.<\/p>\n<p>\u041f\u0456\u0434 \u0446\u0438\u043c \u044f \u043c\u0430\u044e \u043d\u0430 \u0443\u0432\u0430\u0437\u0456, \u0449\u043e \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u0438 \u0441\u0432\u043e\u0457 \u043a\u043b\u0430\u0441\u0438 \u0431\u0456\u043b\u044c\u0448 \u043d\u0435\u0437\u0430\u043b\u0435\u0436\u043d\u0438\u043c\u0438 \u0432\u0456\u0434 WordPress, \u0442\u0430\u043a\u0438\u043c \u0447\u0438\u043d\u043e\u043c \u0432\u0456\u0434\u043e\u043a\u0440\u0435\u043c\u043b\u044e\u044e\u0447\u0438 \u043b\u043e\u0433\u0456\u043a\u0443 \u0434\u043e\u043c\u0435\u043d\u0443 \u0432\u0456\u0434 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0457 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 \u0442\u0430 \u0440\u043e\u0431\u043b\u044f\u0447\u0438 \u0457\u0445 \u0431\u0456\u043b\u044c\u0448 \u0440\u0435\u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0442\u0438\u0432\u043d\u0438\u043c\u0438 \u0434\u043b\u044f \u0434\u0430\u043d\u0438\u0445, \u044f\u043a\u0456 \u0432\u043e\u043d\u0438 \u043f\u043e\u0432\u0438\u043d\u043d\u0456 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u0442\u0438.<\/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>\u0406\u0441\u043d\u0443\u044e\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u0438 \u0440\u043e\u0431\u043e\u0442\u0438 \u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u044e \u0434\u0430\u043d\u0438\u0445 \u043d\u0430\u0432\u043a\u043e\u043b\u043e \u0432\u0430\u0448\u043e\u0457 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u043e\u0441\u0442\u0456 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0438\u0445 \u0437\u043c\u0456\u043d\u043d\u0438\u0445. \u0406 \u043e\u0434\u043d\u0438\u043c \u0456\u0437 \u0442\u0430\u043a\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0456\u0432 \u0454 \u0448\u0430\u0431\u043b\u043e\u043d \u0440\u0435\u0454\u0441\u0442\u0440\u0443.<\/p>\n","protected":false},"author":1,"featured_media":163108,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[869,902,849,725],"tags":[1174],"class_list":["post-230448","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-10","category-kod-3","category-pidruchnyky","category-rozrobnyk","tag-affiai-uk"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/230448","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=230448"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/230448\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media\/163108"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media?parent=230448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/categories?post=230448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/tags?post=230448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}