Skip to content

Instantly share code, notes, and snippets.

View iledcom's full-sized avatar

Konstantyn iledcom

View GitHub Profile
@iledcom
iledcom / add_settings_section
Last active March 7, 2017 16:04
Add a block of options to the basic page "General" WP
// ------------------------------------------------------------------
// Вешаем все блоки, поля и опции на хук admin_init
// ------------------------------------------------------------------
//
add_action( 'admin_init', 'site_name_api_init' );
function site_name_api_init() {
// Добавляем блок опций на базовую страницу "Общие"
add_settings_section(
'site_name_section', // секция
'Настройки шапки сайта',
@iledcom
iledcom / Output of an custom field
Created March 9, 2017 14:27
WP/Output of an custom field
// Необходимо вывести поле содержащее текст "Подробнее"
//Произвольные поля
//Имя: more
//Значение: Подробнее
$more = get_post_custom_values('more');
<?php echo $more[0];?>