Home › Forums › Backend Issues (wp-admin) › error in integration › Reply To: error in integration
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,
));
}
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.