Home › Forums › Backend Issues (wp-admin) › error in integration
hi i have integrated acf in my theme and created the fields and exported it as php and put it in the theme function as get template part
every thing work fine accept there is problem with style
screen :
http://prntscr.com/ba90ai
2nd
i created fields for specific post types it shows in all post types like that
screen :
still loading forever even i doesn’t make it for this post type
this is the hole code for int….
define( ‘ACF_LITE’ , false );
if(!class_exists(‘acf’)){
// 1. customize ACF path
add_filter(‘acf/settings/path’, ‘my_acf_settings_path’);
function my_acf_settings_path( $path ) {
// update path
$path = get_stylesheet_directory() . ‘/acf/’;
// return
return $path;
}
// 2. customize ACF dir
add_filter(‘acf/settings/dir’, ‘my_acf_settings_dir’);
function my_acf_settings_dir( $dir ) {
// update path
$dir = get_stylesheet_directory_uri() . ‘/acf/’;
// return
return $dir;
}
// 3. Hide ACF field group menu item
add_filter(‘acf/settings/show_admin’, ‘__return_false’);
// 4. Include ACF
include_once( get_stylesheet_directory() . ‘/acf/acf.php’ );
get_template_part( ‘acf’ );
and this is the hole fields code ….
if(function_exists(“register_field_group”))
{
register_field_group(array (
‘id’ => ‘acf_%d8%a7%d9%84%d9%81%d9%8a%d8%af%d9%8a%d9%88’,
‘title’ => ‘الفيديو’,
‘fields’ => array (
array (
‘key’ => ‘field_5744b09bcb066’,
‘label’ => ‘مصدر الفيديو’,
‘name’ => ‘sourse’,
‘type’ => ‘select’,
‘choices’ => array (
‘youtube’ => ‘يوتيوب’,
‘url’ => ‘رابط خارجي’,
‘upload’ => ‘رفع ملف MP4’,
),
‘default_value’ => ‘youtube’,
‘allow_null’ => 0,
‘multiple’ => 0,
),
array (
‘key’ => ‘field_5744b114cb067’,
‘label’ => ‘رابط اليوتيوب’,
‘name’ => ‘youtube’,
‘type’ => ‘text’,
‘instructions’ => ‘<br /> اذ اخترت يوتيوب ادخل الرابط’,
‘default_value’ => ”,
‘placeholder’ => ‘https://www.youtube.com/watch?v=uypi-KGyTMY’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_5744b36acb068’,
‘label’ => ‘رابط الفيديو’,
‘name’ => ‘url’,
‘type’ => ‘text’,
‘instructions’ => ‘<br /> اذ اخترت الرابط ادخل الرابط’,
‘default_value’ => ”,
‘placeholder’ => ‘http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_5744b3b2cb069’,
‘label’ => ‘ارفع الملف’,
‘name’ => ‘upload’,
‘type’ => ‘file’,
‘save_format’ => ‘url’,
‘library’ => ‘all’,
),
),
‘location’ => array (
array (
array (
‘param’ => ‘post_type’,
‘operator’ => ‘==’,
‘value’ => ‘vedio’,
‘order_no’ => 0,
‘group_no’ => 0,
),
),
),
‘options’ => array (
‘position’ => ‘acf_after_title’,
‘layout’ => ‘normal’,
‘hide_on_screen’ => array (
),
),
‘menu_order’ => 0,
));
register_field_group(array (
‘id’ => ‘acf_%d8%a7%d8%b9%d8%af%d8%a7%d8%af%d8%a7%d8%aa-%d8%a7%d9%84%d8%b9%d8%b6%d9%88-%d8%a7%d9%84%d8%a7%d8%b6%d8%a7%d9%81%d9%8a%d8%a9’,
‘title’ => ‘اعدادات العضو الاضافية’,
‘fields’ => array (
array (
‘key’ => ‘field_574c5efd71ede’,
‘label’ => ‘صورة العضو’,
‘name’ => ‘avattar’,
‘type’ => ‘image’,
‘save_format’ => ‘url’,
‘preview_size’ => ‘full’,
‘library’ => ‘all’,
),
array (
‘key’ => ‘field_574c5f1e71edf’,
‘label’ => ‘السيرة الزاتية’,
‘name’ => ‘about’,
‘type’ => ‘wysiwyg’,
‘default_value’ => ”,
‘toolbar’ => ‘full’,
‘media_upload’ => ‘yes’,
),
array (
‘key’ => ‘field_574c5f4171ee0’,
‘label’ => ‘رابط فيسبوك’,
‘name’ => ‘رابط_فيسبوك’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ‘facebook’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c5f5671ee1’,
‘label’ => ‘رابط تويتر’,
‘name’ => ‘رابط_تويتر’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ‘twitter’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c5f6671ee2’,
‘label’ => ‘رابط جوجل بلس’,
‘name’ => ‘رابط_جوجل_بلس’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ‘google plus’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c5f7e71ee3’,
‘label’ => ‘رابط يوتيوب’,
‘name’ => ‘رابط_يوتيوب’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ‘youtube’,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c601c42f93’,
‘label’ => ‘رتبة العضو الشرفية’,
‘name’ => ‘رتبة_العضو_الشرفية’,
‘type’ => ‘wysiwyg’,
‘default_value’ => ”,
‘toolbar’ => ‘full’,
‘media_upload’ => ‘yes’,
),
),
‘location’ => array (
array (
array (
‘param’ => ‘ef_user’,
‘operator’ => ‘==’,
‘value’ => ‘all’,
‘order_no’ => 0,
‘group_no’ => 0,
),
),
),
‘options’ => array (
‘position’ => ‘normal’,
‘layout’ => ‘no_box’,
‘hide_on_screen’ => array (
),
),
‘menu_order’ => 0,
));
register_field_group(array (
‘id’ => ‘acf_%d8%a7%d8%b9%d8%af%d8%a7%d8%af%d8%a7%d8%aa-%d8%a7%d9%84%d9%85%d9%82%d8%a7%d9%84’,
‘title’ => ‘اعدادات المقال’,
‘fields’ => array (
array (
‘key’ => ‘field_574c63d8a640f’,
‘label’ => ‘العنوان الثان’,
‘name’ => ‘sc’,
‘type’ => ‘text’,
‘default_value’ => ”,
‘placeholder’ => ”,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_574c63e7a6410’,
‘label’ => ‘اسم الكاتب’,
‘name’ => ‘user_w’,
‘type’ => ‘text’,
‘instructions’ => ‘اتركها فارغه اذ كنت تريد اظهار الكاتب الاساسى ‘,
‘default_value’ => ”,
‘placeholder’ => ”,
‘prepend’ => ”,
‘append’ => ”,
‘formatting’ => ‘html’,
‘maxlength’ => ”,
),
),
‘location’ => array (
array (
array (
‘param’ => ‘post_type’,
‘operator’ => ‘==’,
‘value’ => ‘post’,
‘order_no’ => 0,
‘group_no’ => 0,
),
),
array (
array (
‘param’ => ‘post_type’,
‘operator’ => ‘==’,
‘value’ => ‘vedio’,
‘order_no’ => 0,
‘group_no’ => 1,
),
),
array (
array (
‘param’ => ‘post_type’,
‘operator’ => ‘==’,
‘value’ => ‘photo’,
‘order_no’ => 0,
‘group_no’ => 2,
),
),
),
‘options’ => array (
‘position’ => ‘acf_after_title’,
‘layout’ => ‘default’,
‘hide_on_screen’ => array (
),
),
‘menu_order’ => 0,
));
}
Hi @shokry055
Could you please make sure that there’s no conflict on your site that caused the issue? You can check it by trying to reproduce the issue on one of the WordPress’ stock themes (like Twenty Fifteen) with other plugins deactivated. If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.
Thanks 🙂
i have copied my code to twentysixteen theme
the last wordpress version
clean install
no plugins
the same problem in all themes
Hi @shokry055
Could you please open a new ticket here: https://support.advancedcustomfields.com/new-ticket and explain the issue again? Don’t forget to provide temporary admin credentials to your site (or your staging/development site if you have it) and the links where the problem occurs?
Thanks 🙂
the problem in group id not English
register_field_group(array (
‘id’ => ‘acf_%d8%a7%d9%84%d9%81%d9%8a%d8%af%d9%8a%d9%88’,
when i changed the id to English chars it works 🙂
The topic ‘error in integration’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.