{"id":12187290,"date":"2020-06-01T17:21:41","date_gmt":"2020-06-01T14:21:41","guid":{"rendered":"https:\/\/ru.wordpress.org\/support\/topic\/%d1%81%d0%b2%d1%8f%d0%b7%d0%b0%d1%82%d1%8c-2-%d1%82%d0%b8%d0%bf%d1%8b-%d0%bf%d0%be%d1%81%d1%82%d0%be%d0%b2\/"},"modified":"2020-06-01T17:21:41","modified_gmt":"2020-06-01T14:21:41","slug":"%d1%81%d0%b2%d1%8f%d0%b7%d0%b0%d1%82%d1%8c-2-%d1%82%d0%b8%d0%bf%d1%8b-%d0%bf%d0%be%d1%81%d1%82%d0%be%d0%b2","status":"publish","type":"topic","link":"https:\/\/ru.wordpress.org\/support\/topic\/%d1%81%d0%b2%d1%8f%d0%b7%d0%b0%d1%82%d1%8c-2-%d1%82%d0%b8%d0%bf%d1%8b-%d0%bf%d0%be%d1%81%d1%82%d0%be%d0%b2\/","title":{"rendered":"\u0421\u0432\u044f\u0437\u0430\u0442\u044c 2 \u0442\u0438\u043f\u044b \u043f\u043e\u0441\u0442\u043e\u0432"},"content":{"rendered":"<p>\u0415\u0441\u0442\u044c 2 \u0442\u0438\u043f\u0430 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, &#8212; \u044d\u0442\u043e &#171;\u0443\u0441\u043b\u0443\u0433\u0438&#187; \u0438 &#171;\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u044b&#187;.<\/p>\n<p>\u042f \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0442\u0430\u043a\u0441\u043e\u043d\u043e\u043c\u0438\u044f\u043c. \u0412 \u0441\u0430\u043c\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0435 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 \u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u0432 \u043a\u0430\u043a\u0438\u0445 \u0442\u0430\u043a\u0441\u0430\u0445 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c 2 \u0442\u0438\u043f\u0430 \u043f\u043e\u0441\u0442\u043e\u0432 \u0438 \u043d\u0430 \u0441\u0430\u043c\u043e\u0439 \u0443\u0441\u043b\u0443\u0433\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0445\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u0441\u043f\u0435\u0446\u043e\u0432.<\/p>\n<p>\u041f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 \u0422\u0438\u043c\u0443\u0440\u0430(wp-kama) \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c 1, \u044f \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043b \u0438\u0437 radio \u0432 checkbox, \u043d\u043e \u0432\u0438\u0434\u0438\u043c\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b.<\/p>\n<p>\u0412\u043e\u0442 \u043c\u043e\u0439 \u043a\u043e\u0434, \u043a\u0430\u043a \u044f \u0434\u0435\u043b\u0430\u043b \u043f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 \u0422\u0438\u043c\u0443\u0440\u0430:<\/p>\n<pre><code>add_action(&#039;add_meta_boxes&#039;, function () {\n\tadd_meta_box( &#039;specials_prod&#039;, &#039;\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u044b&#039;, &#039;specials_prod_metabox&#039;, &#039;products&#039;, &#039;side&#039;, &#039;low&#039;  );\n}, 1);\n\nfunction specials_prod_metabox( $post ) {\n\t$teams = get_posts(array( &#039;post_type&#039;=&gt;&#039;specialists&#039;, &#039;posts_per_page&#039;=&gt;9, &#039;orderby&#039;=&gt;&#039;post_title&#039;, &#039;order&#039;=&gt;&#039;ASC&#039; ));\n\n\tif( $teams ) { ?&gt;\n\t\t&lt;div style=&quot;max-height:200px; overflow-y:auto;&quot;&gt;\n\t\t\t&lt;ul&gt;\n        \t\t&lt;?php foreach( $teams as $team ) {\n        \t\t\techo &#039;\n        \t\t\t&lt;li&gt;\n            \t\t\t&lt;input type=&quot;checkbox&quot; name=&quot;post_parent&quot; value=&quot;&#039;. $team-&gt;ID .&#039;&quot; &#039;. checked($team-&gt;ID, $post-&gt;post_parent, 0) .&#039;&gt; &#039;. esc_html($team-&gt;post_title) .&#039;\n        \t\t\t&lt;\/li&gt;\n        \t\t\t&#039;;\n        \t\t} ?&gt;\n\t\t\t&lt;\/ul&gt;\n\t\t&lt;\/div&gt;\n\t&lt;?php }\n}\n<\/code><\/pre>\n<p>\u0418 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 \u044f \u043c\u043e\u0433\u0443 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 1-\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430, \u0445\u043e\u0442\u044c \u043e\u0442\u043c\u0435\u0447\u0443 10, \u043f\u043e \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0431\u0435\u0440\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041a\u0430\u043a \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 1-\u0433\u043e?<\/p>\n","protected":false},"template":"","class_list":["post-12187290","topic","type-topic","status-publish","hentry","topic-tag-7028","topic-tag-18112"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12187290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12187290\/revisions"}],"wp:attachment":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12187290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}