{"id":233541,"date":"2023-02-16T09:57:00","date_gmt":"2023-02-16T06:57:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=233541"},"modified":"2022-11-11T00:14:36","modified_gmt":"2022-11-10T21:14:36","slug":"dodajte-specialne-nalashtuvannja-postijnogo-posilannja-dlja-svogo-specialnogo-tipu-publikacii-v-wordpress","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/uk\/dodajte-specialne-nalashtuvannja-postijnogo-posilannja-dlja-svogo-specialnogo-tipu-publikacii-v-wordpress\/","title":{"rendered":"\u0414\u043e\u0434\u0430\u0439\u0442\u0435 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u0434\u043b\u044f \u0441\u0432\u043e\u0433\u043e \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0432 WordPress"},"content":{"rendered":"\n<p>\u0426\u0435 \u043d\u0430\u0432\u0447\u0430\u043b\u044c\u043d\u0438\u0439 \u043f\u043e\u0441\u0456\u0431\u043d\u0438\u043a \u043f\u0440\u043e \u0442\u0435, \u044f\u043a \u0434\u043e\u0434\u0430\u0442\u0438 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0443 \u0430\u0434\u043c\u0456\u043d\u0456\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 WordPress \u00ab\u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f &gt; \u041f\u043e\u0441\u0442\u0456\u0439\u043d\u0456 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f\u00bb, \u0449\u043e\u0431 \u0432\u0438\u0437\u043d\u0430\u0447\u0438\u0442\u0438 \u0441\u043b\u0430\u0433 \u0434\u043b\u044f \u0432\u0430\u0448\u043e\u0433\u043e \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457. \u042f\u043a\u0449\u043e \u0432\u0438 \u0440\u043e\u0437\u0440\u043e\u0431\u043b\u044f\u0454\u0442\u0435 \u0442\u0435\u043c\u0443 \u0430\u0431\u043e \u043f\u043b\u0430\u0433\u0456\u043d \u0434\u043b\u044f \u0456\u043d\u0448\u0438\u0445, \u044f\u043a\u0456 \u043c\u0430\u044e\u0442\u044c \u0432\u0431\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u0438\u0439 \u0442\u0438\u043f \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457, \u0434\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0446\u044c\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0431\u0443\u0434\u0435 \u0432\u0434\u044f\u0447\u043d\u043e \u043e\u0446\u0456\u043d\u0435\u043d\u043e \u0439\u043e\u0433\u043e \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430\u043c\u0438, \u043e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u0432\u043e\u043d\u0438 \u0434\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c \u0457\u043c \u0432\u0438\u0437\u043d\u0430\u0447\u0438\u0442\u0438 \u0432\u043b\u0430\u0441\u043d\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 URL-\u0430\u0434\u0440\u0435\u0441\u0438 \u0442\u0438\u043f\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457.<\/p>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0443\u0432\u0430\u0442\u0438, \u044f\u043a \u0434\u043e\u0434\u0430\u0442\u0438 \u0432\u043b\u0430\u0441\u043d\u0438\u0439 \u0442\u0438\u043f \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457; \u044f\u043a\u0449\u043e \u0432\u0438 \u043d\u0435 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0434\u0438\u0432\u0438\u0442\u0438\u0441\u044f, <a href=\"https:\/\/awhitepixel.com\/blog\/how-to-create-custom-post-types-and-custom-taxonomies\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u044f\u043a \u0434\u043e\u0434\u0430\u0442\u0438 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u0438\u0439 \u0442\u0438\u043f \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457<\/a>.<\/p>\n<p>\u041f\u0440\u0438\u043f\u0443\u0441\u0442\u0456\u043c\u043e, \u0449\u043e \u0443 \u0432\u0430\u0441 \u0454 \u0442\u0430\u043a\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u0454\u0441\u0442\u0440\u0430\u0446\u0456\u0457 \u0432\u043b\u0430\u0441\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457:<\/p>\n<pre><code>add_action('init', function() {\n    register_post_type('reference', [\n        'label' =&gt; __('References', 'txtdomain'),\n        'public' =&gt; true,\n        'menu_position' =&gt; 5,\n        'menu_icon' =&gt; 'dashicons-book',\n        'supports' =&gt; ['title', 'editor', 'thumbnail', 'author', 'custom-fields', 'revisions'],\n        'show_in_rest' =&gt; true,\n        'rewrite' =&gt; [\n            'slug' =&gt; 'reference',\n            'with_front' =&gt; false\n        ],\n        'labels' =&gt; [\n            'singular_name' =&gt; __('Reference', 'txtdomain'),\n            'add_new_item' =&gt; __('Add new reference', 'txtdomain'),\n            'new_item' =&gt; __('New reference', 'txtdomain'),\n            'view_item' =&gt; __('View reference', 'txtdomain'),\n            'not_found' =&gt; __('No references found', 'txtdomain'),\n            'not_found_in_trash' =&gt; __('No references found in trash', 'txtdomain'),\n            'all_items' =&gt; __('All references', 'txtdomain'),\n            'insert_into_item' =&gt; __('Insert into reference', 'txtdomain')\n        ],      \n    ]);\n});<\/code><\/pre>\n<p>\u041d\u0430\u0441 \u0446\u0456\u043a\u0430\u0432\u0438\u0442\u044c <code>rewrite<\/code>\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442. \u0422\u0443\u0442 \u043c\u0438 \u0432\u0438\u0437\u043d\u0430\u0447\u0430\u0454\u043c\u043e, \u044f\u043a\u0438\u0439 \u0441\u043b\u0430\u0433 \u0431\u0443\u0434\u0435 \u043e\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u0442\u0438 \u043f\u0435\u0440\u0435\u0434 \u0443\u0441\u0456\u043c\u0430 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u044f\u043c\u0438. \u0412\u0430\u0448 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u0454\u0441\u0442\u0440\u0430\u0446\u0456\u0457 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u043c\u043e\u0436\u0435 \u0434\u0435\u0449\u043e \u0432\u0456\u0434\u0440\u0456\u0437\u043d\u044f\u0442\u0438\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0431\u0435\u0437 \u00ab<code>with_front<\/code>\u00bb, \u0430\u043b\u0435 \u043d\u0430\u0441 \u0446\u0456\u043a\u0430\u0432\u0438\u0442\u044c \u00ab<code>slug<\/code>\u00bb:<\/p>\n<pre><code>'rewrite' =&gt; [\n    'slug' =&gt; 'reference',\n    'with_front' =&gt; false\n]<\/code><\/pre>\n<p>\u0417\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0446\u044c\u043e\u0433\u043e \u043a\u043e\u0434\u0443 \u0432\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u043e \u0436\u043e\u0440\u0441\u0442\u043a\u043e \u0437\u0430\u0434\u0430\u0454\u0442\u0435, \u044f\u043a\u0438\u043c \u0431\u0443\u0434\u0435 \u0441\u043b\u0430\u0433 \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457. \u0422\u0438\u043f \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0434\u043b\u044f \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u044c \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0434\u043b\u044f \u0431\u0430\u0433\u0430\u0442\u044c\u043e\u0445 \u0442\u0438\u043f\u0456\u0432 \u0432\u043c\u0456\u0441\u0442\u0443 \u0442\u0430 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0456\u0432 \u0442\u0435\u043c; \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u043f\u0440\u043e\u0435\u043a\u0442, \u043f\u043e\u0440\u0442\u0444\u043e\u043b\u0456\u043e, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0456\u0457 \u043a\u043b\u0456\u0454\u043d\u0442\u0456\u0432, \u043a\u043e\u043c\u043f\u0430\u043d\u0456\u0457 \u0442\u043e\u0449\u043e. \u0429\u043e\u0431 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 \u0432\u0430\u0448\u0443 \u0442\u0435\u043c\u0443 \u0433\u043d\u0443\u0447\u043a\u043e\u044e, \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u0438 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0435\u0432\u0456 \u0442\u0435\u043c\u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u0456\u0439\u043d\u043e \u0432\u0438\u0440\u0456\u0448\u0443\u0432\u0430\u0442\u0438 \u0442\u0438\u043f \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f.<\/p>\n<p>\u0422\u043e\u0436 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u043e\u0437\u0433\u043b\u044f\u043d\u0435\u043c\u043e, \u044f\u043a \u0446\u0435 \u0437\u0440\u043e\u0431\u0438\u0442\u0438!<\/p>\n<h2>\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0442\u0430 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043d\u044f \u043f\u043e\u043b\u044f<\/h2>\n<p>\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f API \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c WordPress \u0434\u0435\u0449\u043e \u0441\u043f\u0440\u043e\u0449\u0443\u0454 \u0446\u0435 \u0434\u043b\u044f \u043d\u0430\u0441. \u0412\u0441\u0435, \u0449\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e, \u0446\u0435 \u0434\u043e\u0434\u0430\u0442\u0438 \u043f\u043e\u043b\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c \u0456 \u0432\u043a\u0430\u0437\u0430\u0442\u0438 WordPress, \u043d\u0430 \u044f\u043a\u0456\u0439 \u0441\u0442\u043e\u0440\u0456\u043d\u0446\u0456 \u0430\u0434\u043c\u0456\u043d\u0456\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u043c\u0438 \u0445\u043e\u0447\u0435\u043c\u043e, \u0449\u043e\u0431 \u0432\u043e\u043d\u043e \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u043e\u0441\u044f \u2013 \u0443 \u043d\u0430\u0448\u043e\u043c\u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u0446\u0456 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u0438\u0445 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u044c. \u041c\u0430\u0439\u0442\u0435 \u043d\u0430 \u0443\u0432\u0430\u0437\u0456, \u0449\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0456\u044e, \u044f\u043a\u0430 \u0444\u0430\u043a\u0442\u0438\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0436 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u0454 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f, \u0449\u043e \u043c\u0438 \u0437\u0440\u043e\u0431\u0438\u043c\u043e \u0432 \u043a\u0456\u043d\u0446\u0456.<\/p>\n<p>\u041c\u0438 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0430\u0454\u043c\u043e \u043d\u0430\u0448\u0443 \u0444\u0443\u043d\u043a\u0446\u0456\u044e \u0434\u043e <code>admin_init<\/code>\u0433\u0430\u0447\u043a\u0430 \u0442\u0430 \u0440\u0435\u0454\u0441\u0442\u0440\u0443\u0454\u043c\u043e \u043d\u0430\u0448\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f. \u041a\u043e\u043b\u0438 \u043c\u0438 \u0440\u0435\u0454\u0441\u0442\u0440\u0443\u0454\u043c\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043c\u0438 \u0432\u0438\u0437\u043d\u0430\u0447\u0430\u0454\u043c\u043e, \u044f\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0456\u044e \u0432\u0456\u043d \u043c\u0430\u0454 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u0434\u043b\u044f \u0432\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<pre><code>add_action('admin_init', function() {\n    add_settings_field('mytheme_reference_slug', __('References base', 'txtdomain'), 'mytest_reference_slug_output', 'permalink', 'optional');\n});<\/code><\/pre>\n<p>\u0427\u0435\u0442\u0432\u0435\u0440\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443 <code>[add_settings_field](https:\/\/developer.wordpress.org\/reference\/functions\/add_settings_field\/)()<\/code>to <code>'permalink'<\/code>\u0432\u043a\u0430\u0437\u0443\u0454 WordPress \u0434\u043e\u0434\u0430\u0442\u0438 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0443 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u0438\u0445 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u044c. \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0440\u0438 \u2014 \u0446\u0435 \u0444\u0443\u043d\u043a\u0446\u0456\u044f, \u044f\u043a\u0443 WordPress \u043c\u0430\u0454 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u0438 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0432\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0456\u0432 \u2014 \u0444\u0443\u043d\u043a\u0446\u0456\u044f, \u044f\u043a\u0443 \u043c\u0438 \u0432\u0438\u0437\u043d\u0430\u0447\u0430\u0454\u043c\u043e \u0434\u0430\u043b\u0456 (\u043f\u043e\u0437\u0430 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e\u044e \u0444\u0443\u043d\u043a\u0446\u0456\u0454\u044e):<\/p>\n<pre><code>function mytest_reference_slug_output() {\n    ?&gt;\n    &lt;input name=\"mytheme_reference_slug\" type=\"text\" class=\"regular-text code\" value=\"&lt;?php echo esc_attr(get_option('mytheme_reference_slug')); ?&gt;\" placeholder=\"&lt;?php echo 'reference'; ?&gt;\" \/&gt;\n    &lt;?php\n}<\/code><\/pre>\n<p>\u0423 \u0446\u0456\u0439 \u0444\u0443\u043d\u043a\u0446\u0456\u0457 \u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0438\u0432\u043e\u0434\u0438\u043c\u043e \u0431\u0430\u0437\u043e\u0432\u0438\u0439 \u0442\u0435\u043a\u0441\u0442 \u0444\u043e\u0440\u043c\u0438 <code>&lt;input&gt;<\/code>. \u0414\u043b\u044f \u0439\u043e\u0433\u043e <code>value<\/code>\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043c\u0438 \u043e\u0442\u0440\u0438\u043c\u0443\u0454\u043c\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e <code>[get_option](https:\/\/developer.wordpress.org\/reference\/functions\/get_option\/)()<\/code>. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 <code>placeholder<\/code>\u0454 \u043d\u0435\u043e\u0431\u043e\u0432&#8217;\u044f\u0437\u043a\u043e\u0432\u0438\u043c, \u0430\u043b\u0435 \u0434\u043e\u0446\u0456\u043b\u044c\u043d\u043e \u0440\u043e\u0437\u043c\u0456\u0449\u0443\u0432\u0430\u0442\u0438 \u0439\u043e\u0433\u043e \u0432 \u0431\u0430\u0437\u0456 \u0441\u043b\u0430\u0433\u0456\u0432 \u0437\u0430 \u0437\u0430\u043c\u043e\u0432\u0447\u0443\u0432\u0430\u043d\u043d\u044f\u043c, \u0449\u043e\u0431 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447 \u0442\u0435\u043c\u0438 \u0437\u043d\u0430\u0432, \u0447\u0438 \u0445\u043e\u0447\u0435 \u0432\u0456\u043d \u0437\u043c\u0456\u043d\u0438\u0442\u0438 \u0439\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0447\u0438 \u043d\u0456.<\/p>\n<p>\u042f\u043a\u0449\u043e \u0432\u0438 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u0442\u0435 \u0441\u0432\u0456\u0439 \u043a\u043e\u0434 \u0456 \u0437\u0430\u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u0442\u0435 \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0443 \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u0438\u0445 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u044c WordPress, \u0432\u0438 \u043f\u043e\u0431\u0430\u0447\u0438\u0442\u0435 \u0441\u0432\u043e\u0454 \u043f\u043e\u043b\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c\u0443 \u043a\u0456\u043d\u0446\u0456:<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-152961-61e500224b55a.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-152961-61e500224b55a.png\" alt=\"\u0414\u043e\u0434\u0430\u0439\u0442\u0435 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u0434\u043b\u044f \u0441\u0432\u043e\u0433\u043e \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0432 WordPress\" ><\/a><\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043d\u0435 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u0454 \u0441\u0432\u043e\u0454 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f, \u0446\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u0439 \u043a\u0440\u043e\u043a.<\/p>\n<p>\u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0434\u043e\u0434\u0430\u0442\u0438 \u0449\u0435 \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0456\u044e, <code>admin_init<\/code>\u044f\u043a\u0430 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u044f\u0454, \u0447\u0438 \u043d\u0430\u0434\u0456\u0441\u043b\u0430\u043d\u043e \u043d\u0430\u0448\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0443 \u0444\u043e\u0440\u043c\u0456 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438 \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f. \u0406 \u044f\u043a\u0449\u043e \u0442\u0430\u043a, \u0442\u043e \u0439\u043e\u0433\u043e \u0441\u043b\u0456\u0434 \u0437\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e <code>[update_option](https:\/\/developer.wordpress.org\/reference\/functions\/update_option\/)()<\/code>.<\/p>\n<pre><code>add_action('admin_init', function() {\n    if (isset($_POST['permalink_structure'])) {\n        update_option('mytheme_reference_slug', trim($_POST['mytheme_reference_slug']));\n    }\n});<\/code><\/pre>\n<p>\u041f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043d\u044f \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u0438\u0445 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u044c \u043d\u0430\u0434\u0441\u0438\u043b\u0430\u0454\u0442\u044c\u0441\u044f \u0444\u043e\u0440\u043c\u0430, \u0442\u043e\u043c\u0443 \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0447\u0435\u0440\u0435\u0437 <code>$_POST<\/code>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443 \u0437\u043c\u0456\u043d\u043d\u0443 PHP. \u041d\u0430\u0434\u0456\u0441\u043b\u0430\u043d\u0456 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437 \u0444\u043e\u0440\u043c\u0438 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u044e\u0442\u044c\u0441\u044f \u0443 \u0432\u0438\u0433\u043b\u044f\u0434\u0456 \u043c\u0430\u0441\u0438\u0432\u0443 \u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u0456\u043c\u0435\u043d\u0456 \u0432\u0445\u0456\u0434\u043d\u0438\u0445 \u0434\u0430\u043d\u0438\u0445 \u044f\u043a \u043a\u043b\u044e\u0447\u0430\u043c\u0438. \u0423 \u043d\u0430\u0448\u043e\u043c\u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u043c\u0438 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0454\u043c\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0456\u043c\u0435\u043d\u0456 &#8216; <code>mytheme_reference_slug<\/code>&#8216; \u0434\u043b\u044f \u043d\u0430\u0448\u043e\u0433\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044f, \u0449\u043e\u0431 \u043c\u0438 \u043c\u043e\u0433\u043b\u0438 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u043d\u0430\u0434\u0456\u0441\u043b\u0430\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e <code>$_POST['mytheme_reference_slug']<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043c\u0430\u0454 \u043f\u043e\u0432\u043d\u0456\u0441\u0442\u044e \u0444\u0443\u043d\u043a\u0446\u0456\u043e\u043d\u0443\u0432\u0430\u0442\u0438 \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u0446\u0456 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f. \u041e\u0441\u0442\u0430\u043d\u043d\u044c\u043e\u044e \u0447\u0430\u0441\u0442\u0438\u043d\u043e\u044e \u0454 \u0434\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0446\u044c\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0434\u043e \u043d\u0430\u0448\u043e\u0433\u043e \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457.<\/p>\n<h2>\u0412\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 \u0434\u043e\u043f\u0438\u0441\u0443 \u0437 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f\u043c \u043d\u0430\u0448\u0438\u0445 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c<\/h2>\n<p>\u0429\u043e\u0431 \u043d\u0430\u0448 \u0432\u043b\u0430\u0441\u043d\u0438\u0439 \u0442\u0438\u043f \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0432 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044c\u043a\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u043d\u0430\u0448\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043c\u0438 \u043f\u043e\u0432\u0435\u0440\u0442\u0430\u0454\u043c\u043e\u0441\u044f \u0434\u043e <code>register_post_type()<\/code>\u0432\u0438\u043a\u043b\u0438\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0456\u0457 \u0442\u0430 \u0437\u043c\u0456\u043d\u044e\u0454\u043c\u043e <code>rewrite<\/code>\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u0430 \u0449\u043e\u0441\u044c \u043f\u043e\u0434\u0456\u0431\u043d\u0435:<\/p>\n<pre><code>'rewrite' =&gt; [\n    'slug' =&gt; (!empty(get_option('mytheme_reference_slug')))? get_option('mytheme_reference_slug'): 'reference',\n    'with_front' =&gt; false\n]<\/code><\/pre>\n<p>\u0412\u0441\u0435, \u0449\u043e \u043c\u0438 \u0442\u0443\u0442 \u0440\u043e\u0431\u0438\u043c\u043e, \u0446\u0435 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u043d\u0430\u0448\u043e\u0457 \u043d\u043e\u0432\u043e\u0457 \u043e\u043f\u0446\u0456\u0457. \u042f\u043a\u0449\u043e \u0432\u0456\u043d \u043f\u0443\u0441\u0442\u0438\u0439 <code>'reference'<\/code>, \u0431\u0443\u0434\u0435 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0437\u0430 \u0443\u043c\u043e\u0432\u0447\u0430\u043d\u043d\u044f\u043c ().<\/p>\n<p>\u0406 \u0446\u0435 \u0432\u0441\u0435! \u0422\u0435\u043f\u0435\u0440 \u0432\u0430\u0448 \u0432\u043b\u0430\u0441\u043d\u0438\u0439 \u0442\u0438\u043f \u0434\u043e\u043f\u0438\u0441\u0443 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438\u043c\u0435 \u0431\u0443\u0434\u044c-\u044f\u043a\u0443 \u0431\u0430\u0437\u0443 \u0441\u043b\u0438\u043a\u0456\u0432, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0443 \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u0446\u0456 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c \u043f\u043e\u0441\u0442\u0456\u0439\u043d\u0438\u0445 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u044c. \u0422\u0430\u043a\u0438\u043c \u0436\u0435 \u0447\u0438\u043d\u043e\u043c \u043c\u043e\u0436\u043d\u0430 \u0434\u043e\u0434\u0430\u0442\u0438 \u0431\u0456\u043b\u044c\u0448\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c, \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0434\u043b\u044f \u0432\u043b\u0430\u0441\u043d\u0438\u0445 \u0442\u0430\u043a\u0441\u043e\u043d\u043e\u043c\u0456\u0439.<\/p>\n<h2>\u041f\u043e\u0432\u043d\u0438\u0439 \u043a\u043e\u0434<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440 \u0443\u0441\u0456 \u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code>\/\/ Register custom post type\nadd_action('init', function() {\n    register_post_type('reference', [\n        'label' =&gt; __('References', 'txtdomain'),\n        'public' =&gt; true,\n        'menu_position' =&gt; 5,\n        'menu_icon' =&gt; 'dashicons-book',\n        'supports' =&gt; ['title', 'editor', 'thumbnail', 'author', 'custom-fields', 'revisions'],\n        'show_in_rest' =&gt; true,\n        'rewrite' =&gt; [\n            'slug' =&gt; (!empty(get_option('mytheme_reference_slug')))? get_option('mytheme_reference_slug'): 'reference',\n            'with_front' =&gt; false\n        ],\n        'labels' =&gt; [\n            'singular_name' =&gt; __('Reference', 'txtdomain'),\n            'add_new_item' =&gt; __('Add new reference', 'txtdomain'),\n            'new_item' =&gt; __('New reference', 'txtdomain'),\n            'view_item' =&gt; __('View reference', 'txtdomain'),\n            'not_found' =&gt; __('No references found', 'txtdomain'),\n            'not_found_in_trash' =&gt; __('No references found in trash', 'txtdomain'),\n            'all_items' =&gt; __('All references', 'txtdomain'),\n            'insert_into_item' =&gt; __('Insert into reference', 'txtdomain')\n        ],      \n    ]);\n});\n\u00a0\n\/\/ Add setting\nadd_action('admin_init', function() {\n    add_settings_field('mytheme_reference_slug', __('References base', 'txtdomain'), 'mytest_reference_slug_output', 'permalink', 'optional');\n});\n\u00a0\n\/\/ Setting output\nfunction mytest_reference_slug_output() {\n    ?&gt;\n    &lt;input name=\"mytheme_reference_slug\" type=\"text\" class=\"regular-text code\" value=\"&lt;?php echo esc_attr(get_option('mytheme_reference_slug')); ?&gt;\" placeholder=\"&lt;?php echo 'reference'; ?&gt;\" \/&gt;\n    &lt;?php\n}\n\u00a0\n\/\/ Save setting\nadd_action('admin_init', function() {\n    if (isset($_POST['permalink_structure'])) {\n        update_option('mytheme_reference_slug', trim($_POST['mytheme_reference_slug']));\n    }\n});<\/code><\/pre>\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=\"\/\/awhitepixel.com\" class=\"external external_icon\">awhitepixel.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0426\u0435 \u043d\u0430\u0432\u0447\u0430\u043b\u044c\u043d\u0438\u0439 \u043f\u043e\u0441\u0456\u0431\u043d\u0438\u043a \u043f\u0440\u043e \u0442\u0435, \u044f\u043a \u0434\u043e\u0434\u0430\u0442\u0438 \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0443 \u0430\u0434\u043c\u0456\u043d\u0456\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 WordPress \u00ab\u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f > \u041f\u043e\u0441\u0442\u0456\u0439\u043d\u0456 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f\u00bb \u0434\u043b\u044f \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0441\u043b\u0430\u0433\u0430 \u0434\u043b\u044f \u0432\u0430\u0448\u043e\u0433\u043e \u0441\u043f\u0435\u0446\u0456\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0443 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u0457.<\/p>\n","protected":false},"author":1,"featured_media":152962,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[902,725,1110,808,808,839,849,869,869,839,902,849,725],"tags":[1174],"class_list":{"0":"post-233541","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-kod-3","8":"category-rozrobnyk","9":"category-n-a","10":"category-php-10","12":"category-kerivnytstvo-dlia-pochatkivtsiv","13":"category-pidruchnyky","14":"category-wordpress-10","20":"tag-affiai-uk"},"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/233541","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=233541"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/233541\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media\/152962"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media?parent=233541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/categories?post=233541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/tags?post=233541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}