8ответ(ов) в теме
Необходимо было добавить произвольное поле публикации с помощью rcl_public_form_fields, но при сохранении значения не сохраняются. Создание дефолтного поля не подходит, так как передаю свою переменную в массив values.
Андрей кажется упоминал недавно, что функция в бете, может возможно все же заставить ее работать?
Тестировал все с кодом, что брал из примера
Вы не можете просматривать опубликованные ссылки
:
add_filter('rcl_public_form_fields','add_custom_field_public_form',10,2);
function add_custom_field_public_form($fields,$form){
//добавляем проверку на нужный тип записи в форме публикации
//которой будем выводить наше поле
if($form->post_type != 'post') return $fields;
$fields[] = array(
'type' => 'text',
'slug' => 'my-text-field',
'title' => 'Заголовок текстового поля',
'notice' => 'напишите что то в текстовом поле'
);
$fields[] = array(
'type' => 'checkbox',
'slug' => 'my-checkbox-field',
'title' => 'Заголовок поля',
'notice' => 'укажите одно из значений нашего поля',
'values' => array(
'первое значение',
'второе значение',
'третье значение'
)
);
return $fields;
}
Fatal error: Uncaught Error: Call to undefined function ads_get_box() in /var/www/www-root/data/www/codeseller.ru/wp-content/themes/codeseller/includes/adv.php:15 Stack trace: #0 /var/www/www-root/data/www/codeseller.ru/wp-includes/class-wp-hook.php(310): add_adv_content_after_first_forum_post('pfm-single-post...', '/var/www/www-ro...') #1 /var/www/www-root/data/www/codeseller.ru/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters('', Array) #2 /var/www/www-root/data/www/codeseller.ru/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #3 /var/www/www-root/data/www/codeseller.ru/wp-content/plugins/wp-recall/functions/files.php(57): do_action('rcl_include_tem...', 'pfm-single-post...', '/var/www/www-ro...') #4 /var/www/www-root/data/www/codeseller.ru/wp-content/plugins/wp-recall/add-on/prime-forum/functions-templates.php(117): rcl_include_template('pfm-single-post...', '/var/www/www-ro...') #5 /var/www/www-root/data/www/codeseller.ru/wp-content/plugins/wp-recall/add-on/prime-forum/themes/prime-first/templates/pfm in /var/www/www-root/data/www/codeseller.ru/wp-content/themes/codeseller/includes/adv.php on line 15