{"id":457823,"date":"2025-04-29T03:00:14","date_gmt":"2025-04-29T03:00:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=457823"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=457823","title":{"rendered":"<span>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u043a\u0430 WP-Seeders \u0434\u043b\u044f \u0412\u043e\u0440\u0434\u043f\u0440\u0435\u0441\u0441\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c \u043c\u0430\u0441\u0441\u043e\u0432\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u0434\u043b\u044f \u0442\u0430\u043a\u0441\u043e\u043d\u043e\u043c\u0438\u0438 \u0432 WP.<br \/>\u041f\u043e \u0431\u0430\u0437\u0435 WP-CLI \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>wp term create<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0442\u0435\u0440\u043c\u0438\u043d \u0437\u0430 \u0432\u044b\u0437\u043e\u0432.<\/p>\n<h3>\u0421\u0442\u0430\u0440\u0442: wp-seeders.php<\/h3>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 <code>wp-seeders.php<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u041d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b, \u043f\u043e\u0435\u0445\u0430\u043b\u0438.<\/p>\n<h3>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u0432\u0441\u0451 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">\u251c\u2500\u2500 includes \u2502   \u251c\u2500\u2500 Abstracts \u2502   \u2502   \u2514\u2500\u2500 AbstractCLIController.php \u2502   \u251c\u2500\u2500 Bootstrap \u2502   \u2502   \u251c\u2500\u2500 CLI.php \u2502   \u2502   \u2514\u2500\u2500 Commands.php \u2502   \u251c\u2500\u2500 Controllers \u2502   \u2502   \u251c\u2500\u2500 CLIController.php \u2502   \u2502   \u251c\u2500\u2500 SettingsController.php \u2502   \u2502   \u2514\u2500\u2500 TermsController.php \u2502   \u2514\u2500\u2500 Load.php \u251c\u2500\u2500 templates \u2502   \u2514\u2500\u2500 seeders.php \u251c\u2500\u2500 bin, tests, vendor \u2014 \u043f\u043e \u0431\u0430\u0437\u0435 \u251c\u2500\u2500 composer.json \u2514\u2500\u2500 \u0438 \u043f\u0440\u043e\u0447\u0430\u044f \u0448\u0435\u043b\u0443\u0445\u0430<\/code><\/pre>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>includes\/Controllers<\/code> \u0436\u0438\u0432\u0443\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u043b\u043e\u0433\u0438\u043a\u0438. <code>TermsController<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432. <code>SettingsController<\/code> \u2014 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 (\u0432\u0434\u0440\u0443\u0433 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0442\u043e\u043d\u043a\u043e \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c). <code>CLIController<\/code> \u0447\u0438\u0442\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0441\u0438\u0434\u0435\u0440\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u044b.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 <code>AbstractCLIController<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>\u0412 <code>includes\/Bootstrap<\/code> \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a WP-CLI (<code>Commands.php<\/code>) \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442 \u0441\u0430\u043c CLI (<code>CLI.php<\/code>). \u0412\u0441\u0451 \u043f\u043e \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443, \u0431\u0435\u0437 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0439.<\/p>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h3>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u0442\u0430\u043a\u0441\u043e\u043d\u043e\u043c\u0438\u0439 \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 100 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0448\u0442\u0443\u043a.<\/p>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b \u0441\u0438\u0434\u0435\u0440\u0430:<\/p>\n<pre><code class=\"bash\">wp seeders init<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f <code>seeder.php<\/code> \u0432 <code>wp-content\/wp-seeders<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  namespace WPSeeders;  class Seeder {   \/**    * The list of terms to be created.    *    * @var array    *\/   static public function init()   {     return [       'terms' =&gt; [         [           'taxonomy' =&gt; 'category',           'term_list' =&gt; [             \/\/ \u0441\u044e\u0434\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u044b           ],           'parent' =&gt; 0,         ]       ]     ];   } } <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0438\u0434\u0435\u0440\u043d\u043e\u0439 \u0430\u043d\u043d\u0438\u0433\u0438\u043b\u044f\u0442\u043e\u0440\u043d\u043e\u0439 \u043f\u0443\u0448\u043a\u0438 3000:<\/p>\n<pre><code class=\"bash\">wp seeders run<\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u0432\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0432\u0441\u0451.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u0447\u0451 \u0442\u0430\u043a\u043e\u0433\u043e \u0431\u044b \u0432\u043b\u0435\u043f\u0438\u0442\u044c. \u041c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u044c \u0432\u043e \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435.<\/p>\n<h3>\u0418\u0442\u043e\u0433<\/h3>\n<p>\u0421\u043e\u0431\u0440\u0430\u043b \u043f\u043b\u0430\u0433\u0438\u043d \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0437\u0430 \u0434\u0435\u043d\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041c\u043e\u0436\u0435\u0442 \u0432 WP \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0449\u0430\u0441, \u043d\u043e \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u043f\u043e\u0445\u043e\u0436\u0438\u0445, \u043d\u043e \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u0442\u0443\u0442: <a href=\"https:\/\/github.com\/aigen31\/wp-seeders\/tree\/master\" rel=\"noopener noreferrer nofollow\">github.com\/aigen31\/wp-seeders<\/a> (\u0437\u0432\u0435\u0437\u0434\u0443 \u043f\u043e\u0441\u0442\u0430\u0432\u044c, \u0437\u0440\u044f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0447\u0442\u043e-\u043b\u0438)<\/p>\n<p>\u0412\u0441\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0413\u041f\u0422<br \/>\u041c\u044b \u0432 \u044d\u043f\u043e\u0445\u0435 \u043c\u0451\u0440\u0442\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u0441\u043c\u0438\u0440\u0438\u0442\u0435\u0441\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/905318\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u041d\u043e\u0440\u043c \u0438\u0434\u0435\u044f?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">100% <\/span><span class=\"tm-article-poll__answer-label\">\u043d\u0435<\/span><span class=\"tm-article-poll__answer-votes\">2<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 100%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">0% <\/span><span class=\"tm-article-poll__answer-label\">\u043d\u0435<\/span><span class=\"tm-article-poll__answer-votes\">0<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 0%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 2 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.    \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f 1 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/905318\/\"> https:\/\/habr.com\/ru\/articles\/905318\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c \u043c\u0430\u0441\u0441\u043e\u0432\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u0434\u043b\u044f \u0442\u0430\u043a\u0441\u043e\u043d\u043e\u043c\u0438\u0438 \u0432 WP.<br \/>\u041f\u043e \u0431\u0430\u0437\u0435 WP-CLI \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>wp term create<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0442\u0435\u0440\u043c\u0438\u043d \u0437\u0430 \u0432\u044b\u0437\u043e\u0432.<\/p>\n<h3>\u0421\u0442\u0430\u0440\u0442: wp-seeders.php<\/h3>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 <code>wp-seeders.php<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u041d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b, \u043f\u043e\u0435\u0445\u0430\u043b\u0438.<\/p>\n<h3>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u0432\u0441\u0451 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">\u251c\u2500\u2500 includes \u2502   \u251c\u2500\u2500 Abstracts \u2502   \u2502   \u2514\u2500\u2500 AbstractCLIController.php \u2502   \u251c\u2500\u2500 Bootstrap \u2502   \u2502   \u251c\u2500\u2500 CLI.php \u2502   \u2502   \u2514\u2500\u2500 Commands.php \u2502   \u251c\u2500\u2500 Controllers \u2502   \u2502   \u251c\u2500\u2500 CLIController.php \u2502   \u2502   \u251c\u2500\u2500 SettingsController.php \u2502   \u2502   \u2514\u2500\u2500 TermsController.php \u2502   \u2514\u2500\u2500 Load.php \u251c\u2500\u2500 templates \u2502   \u2514\u2500\u2500 seeders.php \u251c\u2500\u2500 bin, tests, vendor \u2014 \u043f\u043e \u0431\u0430\u0437\u0435 \u251c\u2500\u2500 composer.json \u2514\u2500\u2500 \u0438 \u043f\u0440\u043e\u0447\u0430\u044f \u0448\u0435\u043b\u0443\u0445\u0430<\/code><\/pre>\n<p>\u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>includes\/Controllers<\/code> \u0436\u0438\u0432\u0443\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u043b\u043e\u0433\u0438\u043a\u0438. <code>TermsController<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432. <code>SettingsController<\/code> \u2014 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 (\u0432\u0434\u0440\u0443\u0433 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0442\u043e\u043d\u043a\u043e \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c). <code>CLIController<\/code> \u0447\u0438\u0442\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0441\u0438\u0434\u0435\u0440\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u044b.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 <code>AbstractCLIController<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>\u0412 <code>includes\/Bootstrap<\/code> \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a WP-CLI (<code>Commands.php<\/code>) \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442 \u0441\u0430\u043c CLI (<code>CLI.php<\/code>). \u0412\u0441\u0451 \u043f\u043e \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443, \u0431\u0435\u0437 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0439.<\/p>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h3>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u0442\u0430\u043a\u0441\u043e\u043d\u043e\u043c\u0438\u0439 \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 100 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0448\u0442\u0443\u043a.<\/p>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b \u0441\u0438\u0434\u0435\u0440\u0430:<\/p>\n<pre><code class=\"bash\">wp seeders init<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f <code>seeder.php<\/code> \u0432 <code>wp-content\/wp-seeders<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  namespace WPSeeders;  class Seeder {   \/**    * The list of terms to be created.    *    * @var array    *\/   static public function init()   {     return [       'terms' =&gt; [         [           'taxonomy' =&gt; 'category',           'term_list' =&gt; [             \/\/ \u0441\u044e\u0434\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u044b           ],           'parent' =&gt; 0,         ]       ]     ];   } } <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0438\u0434\u0435\u0440\u043d\u043e\u0439 \u0430\u043d\u043d\u0438\u0433\u0438\u043b\u044f\u0442\u043e\u0440\u043d\u043e\u0439 \u043f\u0443\u0448\u043a\u0438 3000:<\/p>\n<pre><code class=\"bash\">wp seeders run<\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u0432\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0432\u0441\u0451.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u0447\u0451 \u0442\u0430\u043a\u043e\u0433\u043e \u0431\u044b \u0432\u043b\u0435\u043f\u0438\u0442\u044c. \u041c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u044c \u0432\u043e \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435.<\/p>\n<h3>\u0418\u0442\u043e\u0433<\/h3>\n<p>\u0421\u043e\u0431\u0440\u0430\u043b \u043f\u043b\u0430\u0433\u0438\u043d \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0437\u0430 \u0434\u0435\u043d\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041c\u043e\u0436\u0435\u0442 \u0432 WP \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0449\u0430\u0441, \u043d\u043e \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b \u043f\u0430\u0440\u043e\u0447\u043a\u0443 \u043f\u043e\u0445\u043e\u0436\u0438\u0445, \u043d\u043e \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u0442\u0443\u0442: <a href=\"https:\/\/github.com\/aigen31\/wp-seeders\/tree\/master\" rel=\"noopener noreferrer nofollow\">github.com\/aigen31\/wp-seeders<\/a> (\u0437\u0432\u0435\u0437\u0434\u0443 \u043f\u043e\u0441\u0442\u0430\u0432\u044c, \u0437\u0440\u044f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0447\u0442\u043e-\u043b\u0438)<\/p>\n<p>\u0412\u0441\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0413\u041f\u0422<br \/>\u041c\u044b \u0432 \u044d\u043f\u043e\u0445\u0435 \u043c\u0451\u0440\u0442\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u0441\u043c\u0438\u0440\u0438\u0442\u0435\u0441\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/905318\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u041d\u043e\u0440\u043c \u0438\u0434\u0435\u044f?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">100% <\/span><span class=\"tm-article-poll__answer-label\">\u043d\u0435<\/span><span class=\"tm-article-poll__answer-votes\">2<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 100%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">0% <\/span><span class=\"tm-article-poll__answer-label\">\u043d\u0435<\/span><span class=\"tm-article-poll__answer-votes\">0<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 0%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 2 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.    \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f 1 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/905318\/\"> https:\/\/habr.com\/ru\/articles\/905318\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-457823","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/457823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=457823"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/457823\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=457823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=457823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=457823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}