{"id":228540,"date":"2022-10-17T12:33:00","date_gmt":"2022-10-17T09:33:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=228540"},"modified":"2022-11-09T02:55:08","modified_gmt":"2022-11-08T23:55:08","slug":"wp_get_attachment_image-redaktor-blokiv-wordpress-gutenberg-ekvivalent-getmedia","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/uk\/wp_get_attachment_image-redaktor-blokiv-wordpress-gutenberg-ekvivalent-getmedia\/","title":{"rendered":"wp_get_attachment_image \u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0431\u043b\u043e\u043a\u0456\u0432 WordPress (Gutenberg) \u0415\u043a\u0432\u0456\u0432\u0430\u043b\u0435\u043d\u0442 getMedia"},"content":{"rendered":"<p>\u0428\u0443\u043a\u0430\u0454\u0442\u0435, \u044f\u043a \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043c\u0456\u043d\u0456\u0430\u0442\u044e\u0440\u0443 \u0434\u043e\u043f\u0438\u0441\u0443 \u0430\u0431\u043e URL-\u0430\u0434\u0440\u0435\u0441\u0443 \u0432\u043a\u043b\u0430\u0434\u0435\u043d\u043d\u044f \u0437\u0430 \u0439\u043e\u0433\u043e \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0443 WordPress gutenberg?<\/p>\n<p>\u0412\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/wholesomecode.ltd\/blog\/wp_query-gutenberg-equivalent-getentityrecords\/#the-javascript-post-object\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u0438 \u043e\u0431\u2019\u0454\u043a\u0442 post, \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u044e\u0447\u0438 \u0435\u043a\u0432\u0456\u0432\u0430\u043b\u0435\u043d\u0442 WordPress Gutenberg WP_Query<\/a> (\u0430\u0431\u043e <a href=\"https:\/\/wholesomecode.ltd\/blog\/get_post-gutenberg-equivalent-getentityrecord\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0435\u043a\u0432\u0456\u0432\u0430\u043b\u0435\u043d\u0442 WordPress Gutenberg get_post<\/a> ).<\/p>\n<p>\u0417\u0430\u0443\u0432\u0430\u0436\u0442\u0435, \u0449\u043e \u0432 \u043e\u0431\u2019\u0454\u043a\u0442\u0456 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u0456\u0430, \u044f\u043a\u0438\u0439 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u0454\u0442\u044c\u0441\u044f \u0443 <code>featured_media<\/code>\u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456.<\/p>\n<p>\u041f\u043e\u0442\u0456\u043c \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438, <code>getMedia<\/code>\u0449\u043e\u0431 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u043e\u0441\u0442\u0456 \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0432\u043a\u043b\u0430\u0434\u0435\u043d\u043d\u044f \u0437\u0430 \u0439\u043e\u0433\u043e \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434:<\/p>\n<pre><code>wp.data.select( 'core' ).getMedia( 42 );\n<\/code><\/pre>\n<p>\u041e\u0441\u044c \u0446\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0456:<\/p>\n<p>\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f getMedia \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0456.<\/p>\n<p>\u041c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0434\u043e\u0441\u043b\u0456\u0434\u0438\u0442\u0438 \u043e\u0431\u2019\u0454\u043a\u0442 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f, \u044f\u043a\u0438\u0439 \u043f\u043e\u0432\u0435\u0440\u0442\u0430\u0454\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0456, \u0456 \u043f\u043e\u0431\u0430\u0447\u0438\u0442\u0438, \u0449\u043e \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0432\u0441\u0456 \u0434\u0430\u043d\u0456, \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043c\u0456\u0449\u0435\u043d\u043d\u044f, \u043c\u0435\u0442\u0430 \u0442\u0430 \u0440\u043e\u0437\u043c\u0456\u0440\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f, \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u0456 \u0434\u043b\u044f \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f.<\/p>\n<p>\u0417\u0430\u0443\u0432\u0430\u0436\u0442\u0435, \u0449\u043e \u0440\u043e\u0437\u043c\u0456\u0440\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0443 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0445 \u043d\u0438\u0436\u0447\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u0430\u0445 \u0434\u0430\u043d\u0438\u0445 \u0431\u0443\u043b\u0438 \u0441\u043a\u043e\u0440\u043e\u0447\u0435\u043d\u0456, \u0456\u043d\u0430\u043a\u0448\u0435 \u0432\u043e\u043d\u0438 \u0442\u0440\u0438\u0432\u0430\u0442\u0438\u043c\u0443\u0442\u044c \u0434\u043e\u0441\u0438\u0442\u044c \u0434\u043e\u0432\u0433\u043e.<\/p>\n<pre><code>id: 101\ndate: \"2020-03-21T14:02:00\"\ndate_gmt: \"2020-03-21T14:02:00\"\nguid: {\n    rendered: \"https:\/\/wholesomecode.ltd\/wp-content\/uploads\/2020\/03\/Code-Example.png\"\n    raw: \"https:\/\/wholesomecode.ltd\/wp-content\/uploads\/2020\/03\/Code-Example.png\"\n}\nmodified: \"2020-03-21T14:02:00\"\nmodified_gmt: \"2020-03-21T14:02:00\"\nslug: \"code-example\"\nstatus: \"inherit\"\ntype: \"attachment\"\nlink: \"https:\/\/wholesomecode.ltd\/code-example\/\"\ntitle: {\n    raw: \"Code Example\"\n    rendered: \"Code Example\"\n}\nauthor: 1\ncomment_status: \"closed\"\nping_status: \"closed\"\ntemplate: \"\"\nmeta: {\n    _wcltd_meta_example_1: \"1\"         \n    _wcltd_meta_example_2: \"Hello\"\n}\npermalink_template: \"https:\/\/wholesomecode.ltd\/wp-content\/uploads\/2020\/03\/Code-Example.png\/?attachment_id=101\"\ngenerated_slug: \"code-example\"\ndescription: {\n    raw: \"Code Example\"\n    rendered: \"...\"\n}\ncaption: {\n    raw: \"Code Example\"\n    rendered: \"&lt;p&gt;Code Example&lt;\/p&gt;\u21b5\"\n}\nalt_text: \"Code Example\"\nmedia_type: \"image\"\nmime_type: \"image\/png\"\nmedia_details: {\n    width: 2310\n    height: 1400\n    file: \"2020\/03\/Code-Example.png\"\n    sizes: {\n        ...\n        large: {\n            file: \"Code-Example-1024x621.png\"\n            width: 1024\n            height: 621\n            mime_type: \"image\/png\"\n            source_url: \"https:\/\/wholesomecode.ltd\/wp-content\/uploads\/2020\/03\/Code-Example-1024x621.png\"\n        }\n    }\n    image_meta: {\n        aperture: \"0\"\n        credit: \"\"\n        camera: \"\"\n        caption: \"\"\n        created_timestamp: \"0\"\n        copyright: \"\"\n        focal_length: \"0\"\n        iso: \"0\"\n        shutter_speed: \"0\"\n        title: \"\"\n        orientation: \"0\"\n    }\n}\npost: null\nsource_url: \"https:\/\/wholesomecode.ltdwp-content\/uploads\/2020\/03\/Code-Example.png\"\n<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0433\u043b\u044f\u043d\u044c\u0442\u0435 \u0446\u0435 \u0432 \u0434\u0456\u0457 \u043d\u0430 <a href=\"https:\/\/wholesomecode.ltd\/blog\/wp_query-gutenberg-equivalent-getentityrecords\/#gutenberg-post-loop\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043f\u0440\u0438\u043a\u043b\u0430\u0434\u0456 \u0446\u0438\u043a\u043b\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 WordPress Gutenberg<\/a>.<\/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=\"\/\/wholesomecode.ltd\" class=\"external external_icon\">wholesomecode.ltd<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0428\u0443\u043a\u0430\u0454\u0442\u0435, \u044f\u043a \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043c\u0456\u043d\u0456\u0430\u0442\u044e\u0440\u0443 \u0434\u043e\u043f\u0438\u0441\u0443 \u0430\u0431\u043e URL-\u0430\u0434\u0440\u0435\u0441\u0443 \u0432\u043a\u043b\u0430\u0434\u0435\u043d\u043d\u044f \u0437\u0430 \u0439\u043e\u0433\u043e \u0456\u0434\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0443 WordPress gutenberg? \u0412\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u0438 \u043e\u0431\u2019\u0454\u043a\u0442 \u0434\u043e\u043f\u0438\u0441\u0443, \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u044e\u0447\u0438 \u0435\u043a\u0432\u0456\u0432\u0430\u043b\u0435\u043d\u0442 WordPress Gutenberg&#8230;<\/p>\n","protected":false},"author":1,"featured_media":223619,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[943,869,902,725],"tags":[1174],"class_list":["post-228540","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gutenberg-10","category-wordpress-10","category-kod-3","category-rozrobnyk","tag-affiai-uk"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/228540","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=228540"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/228540\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media\/223619"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media?parent=228540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/categories?post=228540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/tags?post=228540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}