How to add my custom fields to user submitted posts?
-
Hello. I want to add my custom fields on user submitted posts… when guests posts articles to complete my fields too and datas save in database…
i exported to php my fields and are looking like this :
if(function_exists(“register_field_group”))
{
register_field_group(array (
‘id’ => ‘acf_locatie’,
‘title’ => ‘Locatie’,
‘fields’ => array (
array (
‘key’ => ‘field_5692a6651b7c9’,
‘label’ => ‘Tipul de anunt’,
‘name’ => ‘tipuldeanunt’,
‘type’ => ‘select’,
‘instructions’ => ‘Aici selectati ce tip de anunt folositi :-Doriti sa cautati un loc de munca repede si sigur ? Bifati “caut loc de munca”
-Aveti nevoie de personal , puteti oferi un loc de munca , ati vazut un anunt ce ar putea interesa pe cineva? Bifati “ofer loc de munca”
-Aveti nevoie de un zugrav, un zidar, un electrician , o bona, un meditator , o persoana sa va plimbe cainele sau orice altceva? Bifati “caut servicii”
-Sunteti specializat intr-un domeniu si nu aveti de lucru deoarece nu sunteti cunoscut? Bifati “ofer servicii”‘,
‘required’ => 1,
‘choices’ => array (
‘Caut loc de munca’ => ‘Caut loc de munca’,
‘Ofer loc de munca’ => ‘Ofer loc de munca’,
‘Caut servicii’ => ‘Caut servicii’,
‘Ofer servicii’ => ‘Ofer servicii’,
),
‘default_value’ => ”,
‘allow_null’ => 1,
‘multiple’ => 0,
),
array (
‘key’ => ‘field_566594550f5c6’,
‘label’ => ‘Locatie’,
‘name’ => ‘locatie’,
‘type’ => ‘select’,
‘instructions’ => ‘Selectati locatia’,
‘required’ => 1,
‘choices’ => array (
‘Alba’ => ‘Alba’,
‘Arad’ => ‘Arad’,
‘Arges’ => ‘Arges’,
‘Bacau’ => ‘Bacau’,
‘Bihor’ => ‘Bihor’,
‘Bistrita-Nasaud’ => ‘Bistrita-Nasaud’,
‘Botosani’ => ‘Botosani’,
‘Braila’ => ‘Braila’,
‘Brasov’ => ‘Brasov’,
‘Bucuresti-Ilfov’ => ‘Bucuresti-Ilfov’,
‘Calarasi’ => ‘Calarasi’,
‘Caras-Severin’ => ‘Caras-Severin’,
‘Cluj’ => ‘Cluj’,
‘Constanta’ => ‘Constanta’,
‘Covasna’ => ‘Covasna’,
‘Dambovita’ => ‘Dambovita’,
‘Dolj’ => ‘Dolj’,
‘Galati’ => ‘Galati’,
‘Giurgiu’ => ‘Giurgiu’,
‘Gorj’ => ‘Gorj’,
‘Harghita’ => ‘Harghita’,
‘Hunedoara’ => ‘Hunedoara’,
‘Ialomita’ => ‘Ialomita’,
‘Iasi’ => ‘Iasi’,
‘Maramures’ => ‘Maramures’,
‘Mehedinti’ => ‘Mehedinti’,
‘Mures’ => ‘Mures’,
‘Neamt’ => ‘Neamt’,
‘Olt’ => ‘Olt’,
‘Prahova’ => ‘Prahova’,
‘Salaj’ => ‘Salaj’,
‘Satu Mare’ => ‘Satu Mare’,
‘Sibiu’ => ‘Sibiu’,
‘Suceava’ => ‘Suceava’,
‘Teleorman’ => ‘Teleorman’,
‘Timis’ => ‘Timis’,
‘Tulcea’ => ‘Tulcea’,
‘Valcea’ => ‘Valcea’,
‘Vaslui’ => ‘Vaslui’,
),
‘default_value’ => ”,
‘allow_null’ => 1,
‘multiple’ => 0,
),
),
‘location’ => array (
array (
array (
‘param’ => ‘user_type’,
‘operator’ => ‘!=’,
‘value’ => ‘subscriber’,
‘order_no’ => 0,
‘group_no’ => 0,
),
),
),
‘options’ => array (
‘position’ => ‘normal’,
‘layout’ => ‘default’,
‘hide_on_screen’ => array (
0 => ‘permalink’,
1 => ‘excerpt’,
2 => ‘custom_fields’,
3 => ‘discussion’,
4 => ‘comments’,
5 => ‘revisions’,
6 => ‘slug’,
7 => ‘format’,
8 => ‘featured_image’,
9 => ‘tags’,
10 => ‘send-trackbacks’,
),
),
‘menu_order’ => 0,
));
}How can i modify this to appear on my user submitted posts? Please help me..i’m searching from 2 days and used all custom fields plugins…and i tried anything… please help me..
I need them to save in database because it’s a criteria for my search..how you can see here
they are searching articles from next criterias :location
typeofarticle
categorySorry for my bad english , i hope you understand what i want to say.
I want these custom fields : to appear here
- The topic ‘How to add my custom fields to user submitted posts?’ is closed to new replies.