Support

Account

Home Forums Search Search Results for 'display youtube video from text area'

Search Results for 'display youtube video from text area'

topic

  • Unread

    How do you add ACF custom fields to Post Add/Edit screen?

    Hello. My coding experience is somewhat limited, so kindly bear with me as I try to explain my scenario.

    Note that I’m using the ACF Free version at the time of this post. It’s not clear whether I can achieve what I’m looking for with this version or whether an upgrade to Pro is needed. Kindly review the scenario and advise whether this can be achieved with the free version. If not, we’ll need to upgrade.

    I have created a field group that collects the following:
    format: PDF or YouTube video (select one or the other) as we occasionally embed these in our posts

    if format is a PDF, we’re asking for:
    filesize: numberic field, with “MB” appended after
    number of pages: numeric fiel

    if format is a YouTube video, we’re asking for:
    length: text area, limited to 8 chars for hh:mm:ss

    My question is this:
    The conditional logic is already built in, and the above-named fields are part of a field group called “post-media-data”, with location rules as follows:

    set rule to: Post Taxonomy if Category is equal to x OR … OR … etc.

    I’m having trouble now figuring out:
    how to add these field groups to the add new post/edit post edit screens and, subsequently, when displaying the post lists for a particular category. The intention is to allow users to see resources related to the content page (e.g., Learning about bafflegab, What is Gobbledygook, What you can do about Doublespeak):

    A list of related resources might looks like this:

      – Q&A with an expert (YouTube vidwo; 43:14)
      – Webinar presentation (YouTue video: 29:42)
      – Frequently Asked Questions (PDF, 4MB, 8pages)
      – Annual report—English (PDF, 3MB, 32 pages)
      – Annual report—Gibberish (PDF, 2MB 36 pages)

    Each of these would link to the associated post with the corresponding media embedded in the conded as is the usual way with WordPress block editor.

    Also, in which files would the PHP codes generated need to go?

    I hope this is clear. I’d like contributors to have an easy method of entering this data when modifying the posts. As they may be staff or volunteers with very limited knowledge, I’d like the interface for Add/Edit post to be as intuitive as possible.

  • Helping

    PHP Fatal error: api-field.php

    Just made a new group that is a flexible content with a repeater inside. I’m getting this error in my debug.log. This seems to happen if there is not content in the repeater. I can test more and offer more insight later, but it is saving data correctly.

    [11-Aug-2016 17:51:36 UTC] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 4456448 bytes) in /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/api/api-field.php on line 615
    [11-Aug-2016 17:51:36 UTC] PHP Stack trace:
    [11-Aug-2016 17:51:36 UTC] PHP   1. {main}() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-admin/post.php:0
    [11-Aug-2016 17:51:36 UTC] PHP   2. include() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-admin/post.php:173
    [11-Aug-2016 17:51:36 UTC] PHP   3. do_action() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-admin/edit-form-advanced.php:609
    [11-Aug-2016 17:51:36 UTC] PHP   4. call_user_func_array:{/Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-includes/plugin.php:525}() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-includes/plugin.php:525
    [11-Aug-2016 17:51:36 UTC] PHP   5. acf_form_post->edit_form_after_title() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-includes/plugin.php:525
    [11-Aug-2016 17:51:36 UTC] PHP   6. do_meta_boxes() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/forms/post.php:259
    [11-Aug-2016 17:51:36 UTC] PHP   7. call_user_func:{/Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-admin/includes/template.php:1037}() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-admin/includes/template.php:1037
    [11-Aug-2016 17:51:36 UTC] PHP   8. acf_form_post->render_meta_box() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-admin/includes/template.php:1037
    [11-Aug-2016 17:51:36 UTC] PHP   9. acf_render_fields() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/forms/post.php:316
    [11-Aug-2016 17:51:36 UTC] PHP  10. acf_render_field_wrap() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/api/api-field.php:415
    [11-Aug-2016 17:51:36 UTC] PHP  11. acf_render_field() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/api/api-field.php:604
    [11-Aug-2016 17:51:36 UTC] PHP  12. do_action() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/api/api-field.php:451
    [11-Aug-2016 17:51:36 UTC] PHP  13. call_user_func_array:{/Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-includes/plugin.php:525}() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-includes/plugin.php:525
    [11-Aug-2016 17:51:36 UTC] PHP  14. acf_field_flexible_content->render_field() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-includes/plugin.php:525
    [11-Aug-2016 17:51:36 UTC] PHP  15. acf_field_flexible_content->render_layout() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php:244
    [11-Aug-2016 17:51:36 UTC] PHP  16. acf_render_field_wrap() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php:432
    [11-Aug-2016 17:51:36 UTC] PHP  17. acf_render_field() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/api/api-field.php:604
    [11-Aug-2016 17:51:36 UTC] PHP  18. do_action() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/api/api-field.php:451
    [11-Aug-2016 17:51:36 UTC] PHP  19. call_user_func_array:{/Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-includes/plugin.php:525}() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-includes/plugin.php:525
    [11-Aug-2016 17:51:36 UTC] PHP  20. acf_field_repeater->render_field() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-includes/plugin.php:525
    [11-Aug-2016 17:51:36 UTC] PHP  21. acf_render_field_wrap() /Users/alabarge/Dropbox/Sites/httpdocs/calqualitycare-wp/wp-content/plugins/advanced-custom-fields-pro/pro/fields/repeater.php:341

    Here are the fields groups – this has happened since adding a repeater in a flexible content area in the Learn field group.

    if( function_exists('acf_add_local_field_group') ):
    
    acf_add_local_field_group(array (
    	'key' => 'group_577197245909e',
    	'title' => 'Homepage',
    	'fields' => array (
    		array (
    			'key' => 'field_57a25ead92a18',
    			'label' => 'Provider Ranking Fields',
    			'name' => '',
    			'type' => 'tab',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'placement' => 'left',
    			'endpoint' => 0,
    		),
    		array (
    			'key' => 'field_57a25ecb92a19',
    			'label' => 'Provider Ranking Section Title',
    			'name' => 'provider_ranking_section_title',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_57a25edb92a1a',
    			'label' => 'Provider Ranking Section Blurb',
    			'name' => 'provider_ranking_section_blurb',
    			'type' => 'textarea',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'maxlength' => '',
    			'rows' => 2,
    			'new_lines' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_57719731d301a',
    			'label' => 'Learning Left Column',
    			'name' => '',
    			'type' => 'tab',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'placement' => 'left',
    			'endpoint' => 0,
    		),
    		array (
    			'key' => 'field_577197a491a7c',
    			'label' => 'Left Column Image',
    			'name' => 'left_column_image',
    			'type' => 'image',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'return_format' => 'url',
    			'preview_size' => 'medium',
    			'library' => 'all',
    			'min_width' => '',
    			'min_height' => '',
    			'min_size' => '',
    			'max_width' => '',
    			'max_height' => '',
    			'max_size' => '',
    			'mime_types' => '',
    		),
    		array (
    			'key' => 'field_579a46158b8b9',
    			'label' => 'Left Column Is Video',
    			'name' => 'left_column_is_video',
    			'type' => 'checkbox',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'choices' => array (
    				'Yes' => 'Yes',
    			),
    			'default_value' => array (
    			),
    			'layout' => 'vertical',
    			'toggle' => 0,
    		),
    		array (
    			'key' => 'field_579a462b8b8ba',
    			'label' => 'Left Column Video ID',
    			'name' => 'left_column_video_id',
    			'type' => 'text',
    			'instructions' => '<small>Enter YouTube video ID here.</small>',
    			'required' => 0,
    			'conditional_logic' => array (
    				array (
    					array (
    						'field' => 'field_579a46158b8b9',
    						'operator' => '==',
    						'value' => 'Yes',
    					),
    				),
    			),
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_577197c691a7d',
    			'label' => 'Left Column Title',
    			'name' => 'left_column_title',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_577197cc91a7e',
    			'label' => 'Left Column Content',
    			'name' => 'left_column_content',
    			'type' => 'textarea',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'maxlength' => '',
    			'rows' => 2,
    			'new_lines' => 'br',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_5771997f6d11c',
    			'label' => 'Left Column Link Text',
    			'name' => 'left_column_link_text',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_577199886d11d',
    			'label' => 'Left Column Link URl',
    			'name' => 'left_column_link_url',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_579a3fe30684e',
    			'label' => 'Learning Center Column',
    			'name' => '',
    			'type' => 'tab',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'placement' => 'left',
    			'endpoint' => 0,
    		),
    		array (
    			'key' => 'field_579a3ff90684f',
    			'label' => 'Ribbon Layers',
    			'name' => 'ribbon_layers',
    			'type' => 'repeater',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'collapsed' => '',
    			'min' => 1,
    			'max' => 5,
    			'layout' => 'table',
    			'button_label' => 'Add Row',
    			'sub_fields' => array (
    				array (
    					'key' => 'field_579a400306850',
    					'label' => 'Ribbon Layer Title',
    					'name' => 'ribbon_layer_title',
    					'type' => 'text',
    					'instructions' => '',
    					'required' => 0,
    					'conditional_logic' => 0,
    					'wrapper' => array (
    						'width' => '',
    						'class' => '',
    						'id' => '',
    					),
    					'default_value' => '',
    					'placeholder' => '',
    					'prepend' => '',
    					'append' => '',
    					'maxlength' => '',
    					'readonly' => 0,
    					'disabled' => 0,
    				),
    				array (
    					'key' => 'field_579a402206852',
    					'label' => 'Ribbon Title Link',
    					'name' => 'ribbon_title_link',
    					'type' => 'text',
    					'instructions' => '<small>Example: http://google.com</small>',
    					'required' => 0,
    					'conditional_logic' => 0,
    					'wrapper' => array (
    						'width' => '',
    						'class' => '',
    						'id' => '',
    					),
    					'default_value' => '',
    					'placeholder' => '',
    					'prepend' => '',
    					'append' => '',
    					'maxlength' => '',
    					'readonly' => 0,
    					'disabled' => 0,
    				),
    				array (
    					'key' => 'field_579a400d06851',
    					'label' => 'Ribbon Layer Content',
    					'name' => 'ribbon_layer_content',
    					'type' => 'textarea',
    					'instructions' => '',
    					'required' => 0,
    					'conditional_logic' => 0,
    					'wrapper' => array (
    						'width' => '',
    						'class' => '',
    						'id' => '',
    					),
    					'default_value' => '',
    					'placeholder' => '',
    					'maxlength' => '',
    					'rows' => 2,
    					'new_lines' => '',
    					'readonly' => 0,
    					'disabled' => 0,
    				),
    			),
    		),
    		array (
    			'key' => 'field_577199a46d11e',
    			'label' => 'Learning Right Column',
    			'name' => '',
    			'type' => 'tab',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'placement' => 'left',
    			'endpoint' => 0,
    		),
    		array (
    			'key' => 'field_577197e3c7bd3',
    			'label' => 'Right Column Image',
    			'name' => 'right_column_image',
    			'type' => 'image',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'return_format' => 'url',
    			'preview_size' => 'medium',
    			'library' => 'all',
    			'min_width' => '',
    			'min_height' => '',
    			'min_size' => '',
    			'max_width' => '',
    			'max_height' => '',
    			'max_size' => '',
    			'mime_types' => '',
    		),
    		array (
    			'key' => 'field_579a459f8b8b7',
    			'label' => 'Right Column Is Video',
    			'name' => 'right_column_is_video',
    			'type' => 'checkbox',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'choices' => array (
    				'Yes' => 'Yes',
    			),
    			'default_value' => array (
    			),
    			'layout' => 'vertical',
    			'toggle' => 0,
    		),
    		array (
    			'key' => 'field_57719f692c80e',
    			'label' => 'Right Column Video ID',
    			'name' => 'right_column_video_id',
    			'type' => 'text',
    			'instructions' => '<small>Enter the YouTube Video ID here.</small>',
    			'required' => 0,
    			'conditional_logic' => array (
    				array (
    					array (
    						'field' => 'field_579a459f8b8b7',
    						'operator' => '==',
    						'value' => 'Yes',
    					),
    				),
    			),
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_577197ecc7bd4',
    			'label' => 'Right Column Title',
    			'name' => 'right_column_title',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_577197f5c7bd5',
    			'label' => 'Right Column Content',
    			'name' => 'right_column_content',
    			'type' => 'textarea',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'maxlength' => '',
    			'rows' => 2,
    			'new_lines' => 'br',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_577199696d11a',
    			'label' => 'Right Column Link Text',
    			'name' => 'right_column_link_text',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_577199766d11b',
    			'label' => 'Right Column Link URL',
    			'name' => 'right_column_link_url',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    	),
    	'location' => array (
    		array (
    			array (
    				'param' => 'page_template',
    				'operator' => '==',
    				'value' => 'page-homepage.php',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'acf_after_title',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => array (
    		0 => 'permalink',
    		1 => 'the_content',
    		2 => 'excerpt',
    		3 => 'custom_fields',
    		4 => 'discussion',
    		5 => 'comments',
    		6 => 'revisions',
    		7 => 'author',
    		8 => 'format',
    		9 => 'page_attributes',
    		10 => 'featured_image',
    		11 => 'categories',
    		12 => 'tags',
    		13 => 'send-trackbacks',
    	),
    	'active' => 1,
    	'description' => '',
    ));
    
    acf_add_local_field_group(array (
    	'key' => 'group_57acb659a3fd4',
    	'title' => 'Learn',
    	'fields' => array (
    		array (
    			'key' => 'field_57acb67c95bdd',
    			'label' => 'Layers',
    			'name' => 'layers',
    			'type' => 'flexible_content',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'button_label' => 'Add Row',
    			'min' => '',
    			'max' => '',
    			'layouts' => array (
    				array (
    					'key' => '57acb6861d5e7',
    					'name' => 'layer',
    					'label' => 'Layer',
    					'display' => 'block',
    					'sub_fields' => array (
    						array (
    							'key' => 'field_57acb6a195bde',
    							'label' => 'Left Side Image',
    							'name' => 'left_side_image',
    							'type' => 'image',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'return_format' => 'url',
    							'preview_size' => 'thumbnail',
    							'library' => 'all',
    							'min_width' => '',
    							'min_height' => '',
    							'min_size' => '',
    							'max_width' => '',
    							'max_height' => '',
    							'max_size' => '',
    							'mime_types' => '',
    						),
    						array (
    							'key' => 'field_57acba99f70d3',
    							'label' => 'Menu Links',
    							'name' => 'menu_links',
    							'type' => 'repeater',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'collapsed' => '',
    							'min' => '',
    							'max' => '',
    							'layout' => 'table',
    							'button_label' => 'Add Row',
    							'sub_fields' => array (
    								array (
    									'key' => 'field_57acbabe7af6a',
    									'label' => 'The Menu Item',
    									'name' => 'the_menu_item',
    									'type' => 'post_object',
    									'instructions' => '',
    									'required' => 1,
    									'conditional_logic' => 0,
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'post_type' => array (
    									),
    									'taxonomy' => array (
    									),
    									'allow_null' => 0,
    									'multiple' => 0,
    									'return_format' => 'object',
    									'ui' => 1,
    								),
    							),
    						),
    					),
    					'min' => '',
    					'max' => '',
    				),
    			),
    		),
    	),
    	'location' => array (
    		array (
    			array (
    				'param' => 'page_template',
    				'operator' => '==',
    				'value' => 'page-learn.php',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'acf_after_title',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    	'active' => 1,
    	'description' => '',
    ));
    
    acf_add_local_field_group(array (
    	'key' => 'group_576da90e47691',
    	'title' => 'Profile',
    	'fields' => array (
    		array (
    			'key' => 'field_5772f8a58ed5a',
    			'label' => 'Profile Intro Text First Paragraph',
    			'name' => 'profile_intro_text_first_paragraph',
    			'type' => 'wysiwyg',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'tabs' => 'all',
    			'toolbar' => 'full',
    			'media_upload' => 1,
    		),
    		array (
    			'key' => 'field_5772fe0471f67',
    			'label' => 'Profile Intro Text Full Text',
    			'name' => 'profile_intro_text_full_text',
    			'type' => 'wysiwyg',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'tabs' => 'all',
    			'toolbar' => 'full',
    			'media_upload' => 1,
    		),
    		array (
    			'key' => 'field_577440a30fe70',
    			'label' => 'Meta Title Add On',
    			'name' => 'meta_title_add_on',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_577440b70fe71',
    			'label' => 'Meta Description',
    			'name' => 'meta_description',
    			'type' => 'textarea',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'maxlength' => '',
    			'rows' => '',
    			'new_lines' => 'wpautop',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_577ebb1befa01',
    			'label' => 'State Website URL',
    			'name' => 'state_link_url',
    			'type' => 'url',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    		),
    		array (
    			'key' => 'field_576da998d45d9',
    			'label' => 'Tabs',
    			'name' => 'tabs',
    			'type' => 'repeater',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => 'tab',
    				'id' => '',
    			),
    			'collapsed' => 'field_576daa11457f7',
    			'min' => '',
    			'max' => '',
    			'layout' => 'block',
    			'button_label' => 'Add Tab',
    			'sub_fields' => array (
    				array (
    					'key' => 'field_576daa11457f7',
    					'label' => 'Title',
    					'name' => 'title',
    					'type' => 'text',
    					'instructions' => '',
    					'required' => '',
    					'conditional_logic' => '',
    					'wrapper' => array (
    						'width' => '',
    						'class' => '',
    						'id' => '',
    					),
    					'default_value' => '',
    					'placeholder' => '',
    					'prepend' => '',
    					'append' => '',
    					'maxlength' => '',
    					'readonly' => 0,
    					'disabled' => 0,
    				),
    				array (
    					'key' => 'field_576daa37d668d',
    					'label' => 'Hidden',
    					'name' => 'hidden',
    					'type' => 'checkbox',
    					'instructions' => '',
    					'required' => '',
    					'conditional_logic' => '',
    					'wrapper' => array (
    						'width' => '',
    						'class' => '',
    						'id' => '',
    					),
    					'choices' => array (
    						'Hide' => 'Hide',
    					),
    					'default_value' => array (
    					),
    					'layout' => 'vertical',
    					'toggle' => 0,
    				),
    				array (
    					'key' => 'field_5772e24ae0647',
    					'label' => 'Tab Level Text',
    					'name' => 'tab_level_text',
    					'type' => 'text',
    					'instructions' => '',
    					'required' => 0,
    					'conditional_logic' => 0,
    					'wrapper' => array (
    						'width' => '',
    						'class' => '',
    						'id' => '',
    					),
    					'default_value' => '',
    					'placeholder' => '',
    					'prepend' => '',
    					'append' => '',
    					'maxlength' => '',
    					'readonly' => 0,
    					'disabled' => 0,
    				),
    				array (
    					'key' => 'field_576daacaae33c',
    					'label' => 'Section',
    					'name' => 'section',
    					'type' => 'repeater',
    					'instructions' => '',
    					'required' => 0,
    					'conditional_logic' => 0,
    					'wrapper' => array (
    						'width' => '',
    						'class' => 'section',
    						'id' => '',
    					),
    					'collapsed' => 'field_576daad5ae33d',
    					'min' => '',
    					'max' => '',
    					'layout' => 'row',
    					'button_label' => 'Add Section',
    					'sub_fields' => array (
    						array (
    							'key' => 'field_576daad5ae33d',
    							'label' => 'Section Title',
    							'name' => 'section_title',
    							'type' => 'text',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => '',
    							'placeholder' => '',
    							'prepend' => '',
    							'append' => '',
    							'maxlength' => '',
    							'readonly' => 0,
    							'disabled' => 0,
    						),
    						array (
    							'key' => 'field_5774403b1c13c',
    							'label' => 'Section Modal Text - Start',
    							'name' => 'modal_text',
    							'type' => 'wysiwyg',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => '',
    							'tabs' => 'all',
    							'toolbar' => 'full',
    							'media_upload' => 1,
    						),
    						array (
    							'key' => 'field_577ee6719da6d',
    							'label' => 'Section Modal Text - End',
    							'name' => 'modal_text_end',
    							'type' => 'wysiwyg',
    							'instructions' => '',
    							'required' => '',
    							'conditional_logic' => '',
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => '',
    							'tabs' => 'all',
    							'toolbar' => 'full',
    							'media_upload' => 1,
    						),
    						array (
    							'key' => 'field_5779ede086dc4',
    							'label' => 'Footer Text',
    							'name' => 'footer_text',
    							'type' => 'text',
    							'instructions' => '',
    							'required' => '',
    							'conditional_logic' => '',
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => '',
    							'placeholder' => '',
    							'prepend' => '',
    							'append' => '',
    							'maxlength' => '',
    							'readonly' => 0,
    							'disabled' => 0,
    						),
    						array (
    							'key' => 'field_576daaeeae33f',
    							'label' => 'Has Trend Data',
    							'name' => 'has_trend_data',
    							'type' => 'true_false',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'message' => '',
    							'default_value' => 0,
    						),
    						array (
    							'key' => 'field_5775809bc2cd2',
    							'label' => 'Latest Trend Year',
    							'name' => 'latest_trend_year',
    							'type' => 'number',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => array (
    								array (
    									array (
    										'field' => 'field_576daaeeae33f',
    										'operator' => '==',
    										'value' => '1',
    									),
    								),
    							),
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => '',
    							'placeholder' => '',
    							'prepend' => '',
    							'append' => '',
    							'min' => '',
    							'max' => '',
    							'step' => '',
    							'readonly' => 0,
    							'disabled' => 0,
    						),
    						array (
    							'key' => 'field_577580abc2cd3',
    							'label' => 'Number of Trend Years',
    							'name' => 'number_of_trend_years',
    							'type' => 'number',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => array (
    								array (
    									array (
    										'field' => 'field_576daaeeae33f',
    										'operator' => '==',
    										'value' => '1',
    									),
    								),
    							),
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'default_value' => '',
    							'placeholder' => '',
    							'prepend' => '',
    							'append' => '',
    							'min' => '',
    							'max' => '',
    							'step' => '',
    							'readonly' => 0,
    							'disabled' => 0,
    						),
    						array (
    							'key' => 'field_577591f5a769b',
    							'label' => 'Number or Percentage',
    							'name' => 'number_or_percentage',
    							'type' => 'radio',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => array (
    								array (
    									array (
    										'field' => 'field_576daaeeae33f',
    										'operator' => '==',
    										'value' => '1',
    									),
    								),
    							),
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'choices' => array (
    								'number' => 'number',
    								'percentage' => 'percentage',
    							),
    							'allow_null' => 0,
    							'other_choice' => 0,
    							'save_other_choice' => 0,
    							'default_value' => 'number',
    							'layout' => 'vertical',
    						),
    						array (
    							'key' => 'field_5772e188e0643',
    							'label' => 'Lower Is Better',
    							'name' => 'lower_is_better',
    							'type' => 'true_false',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'message' => '',
    							'default_value' => 0,
    						),
    						array (
    							'key' => 'field_577580f1c2cd4',
    							'label' => 'Statewide Link',
    							'name' => 'statewide_link',
    							'type' => 'true_false',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'message' => '',
    							'default_value' => 0,
    						),
    						array (
    							'key' => 'field_5772e1b8e0644',
    							'label' => 'Show state average column',
    							'name' => 'state_average',
    							'type' => 'true_false',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'message' => '',
    							'default_value' => 1,
    						),
    						array (
    							'key' => 'field_5772e2e4b9e91',
    							'label' => 'Show US average column',
    							'name' => 'us_average',
    							'type' => 'true_false',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => '',
    								'id' => '',
    							),
    							'message' => '',
    							'default_value' => 1,
    						),
    						array (
    							'key' => 'field_576dabe5191ff',
    							'label' => 'Items',
    							'name' => 'items',
    							'type' => 'repeater',
    							'instructions' => '',
    							'required' => 0,
    							'conditional_logic' => 0,
    							'wrapper' => array (
    								'width' => '',
    								'class' => 'item',
    								'id' => '',
    							),
    							'collapsed' => 'field_576daca9f24ee',
    							'min' => '',
    							'max' => '',
    							'layout' => 'row',
    							'button_label' => 'Add Item',
    							'sub_fields' => array (
    								array (
    									'key' => 'field_576daca9f24ee',
    									'label' => 'Item Title',
    									'name' => 'item_title',
    									'type' => 'text',
    									'instructions' => '',
    									'required' => 0,
    									'conditional_logic' => 0,
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'default_value' => '',
    									'placeholder' => '',
    									'prepend' => '',
    									'append' => '',
    									'maxlength' => '',
    									'readonly' => 0,
    									'disabled' => 0,
    								),
    								array (
    									'key' => 'field_576dacb6f24ef',
    									'label' => 'Measure ID',
    									'name' => 'measure_id',
    									'type' => 'text',
    									'instructions' => '',
    									'required' => 0,
    									'conditional_logic' => array (
    										array (
    											array (
    												'field' => 'field_576dace6ef380',
    												'operator' => '!=',
    												'value' => 'Start',
    											),
    											array (
    												'field' => 'field_576dad05ef381',
    												'operator' => '!=',
    												'value' => 'End',
    											),
    										),
    									),
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'default_value' => '',
    									'placeholder' => '',
    									'prepend' => '',
    									'append' => '',
    									'maxlength' => '',
    									'readonly' => 0,
    									'disabled' => 0,
    								),
    								array (
    									'key' => 'field_576dace6ef380',
    									'label' => 'Start Expander',
    									'name' => 'start_expander',
    									'type' => 'checkbox',
    									'instructions' => '',
    									'required' => 0,
    									'conditional_logic' => array (
    										array (
    											array (
    												'field' => 'field_576dad05ef381',
    												'operator' => '!=',
    												'value' => 'End',
    											),
    										),
    									),
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'choices' => array (
    										'Start' => 'Start',
    									),
    									'default_value' => array (
    									),
    									'layout' => 'vertical',
    									'toggle' => 0,
    								),
    								array (
    									'key' => 'field_5776aa5d59c79',
    									'label' => 'Initial Expander State',
    									'name' => 'expander_state',
    									'type' => 'radio',
    									'instructions' => '',
    									'required' => 0,
    									'conditional_logic' => array (
    										array (
    											array (
    												'field' => 'field_576dace6ef380',
    												'operator' => '==',
    												'value' => 'Start',
    											),
    										),
    									),
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'choices' => array (
    										'open' => 'open',
    										'closed' => 'closed',
    									),
    									'allow_null' => 0,
    									'other_choice' => 0,
    									'save_other_choice' => 0,
    									'default_value' => 'closed',
    									'layout' => 'vertical',
    								),
    								array (
    									'key' => 'field_576dad05ef381',
    									'label' => 'End Expander',
    									'name' => 'end_expander',
    									'type' => 'checkbox',
    									'instructions' => '',
    									'required' => 0,
    									'conditional_logic' => array (
    										array (
    											array (
    												'field' => 'field_576dace6ef380',
    												'operator' => '!=',
    												'value' => 'Start',
    											),
    										),
    									),
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'choices' => array (
    										'End' => 'End',
    									),
    									'default_value' => array (
    									),
    									'layout' => 'vertical',
    									'toggle' => 0,
    								),
    								array (
    									'key' => 'field_577438264cae0',
    									'label' => 'Modal Text',
    									'name' => 'modal_text',
    									'type' => 'wysiwyg',
    									'instructions' => '',
    									'required' => 0,
    									'conditional_logic' => 0,
    									'wrapper' => array (
    										'width' => '',
    										'class' => '',
    										'id' => '',
    									),
    									'default_value' => '',
    									'tabs' => 'all',
    									'toolbar' => 'full',
    									'media_upload' => 1,
    								),
    							),
    						),
    					),
    				),
    			),
    		),
    	),
    	'location' => array (
    		array (
    			array (
    				'param' => 'post_type',
    				'operator' => '==',
    				'value' => 'profiles',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'acf_after_title',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    	'active' => 1,
    	'description' => '',
    ));
    
    acf_add_local_field_group(array (
    	'key' => 'group_579fc1b6c5b41',
    	'title' => 'Theme Options',
    	'fields' => array (
    		array (
    			'key' => 'field_57aa23b760105',
    			'label' => 'PDF/Printing',
    			'name' => 'pdfprinting',
    			'type' => 'tab',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'placement' => 'top',
    			'endpoint' => 0,
    		),
    		array (
    			'key' => 'field_57aa22da572ea',
    			'label' => 'Disclaimer Text',
    			'name' => 'disclaimer_text',
    			'type' => 'wysiwyg',
    			'instructions' => 'This is the text that appears at the top of PDFs',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'tabs' => 'all',
    			'toolbar' => 'full',
    			'media_upload' => 1,
    		),
    		array (
    			'key' => 'field_579fc1bef2c73',
    			'label' => 'Contact Us Form',
    			'name' => '',
    			'type' => 'tab',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'placement' => 'top',
    			'endpoint' => 0,
    		),
    		array (
    			'key' => 'field_579fc1c9f2c74',
    			'label' => 'Send Contact Emails To',
    			'name' => 'send_contact_emails_to',
    			'type' => 'text',
    			'instructions' => '</small>Enter a comma separated list of emails that the Contact Us form submit should notify.</small>',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    		array (
    			'key' => 'field_579fd96df388a',
    			'label' => 'Thank you message',
    			'name' => 'thank_you_message',
    			'type' => 'textarea',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'maxlength' => '',
    			'rows' => 2,
    			'new_lines' => 'wpautop',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    	),
    	'location' => array (
    		array (
    			array (
    				'param' => 'options_page',
    				'operator' => '==',
    				'value' => 'calqualitycare-theme-options',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'normal',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    	'active' => 1,
    	'description' => '',
    ));
    
    endif;
  • Solved

    html code into textarea

    Hi,

    I’m using a textarea field to store a youtube embed code, like this:

    <iframe width="1280" height="720" src="//www.youtube.com/embed/3f7l-Z4NF70?rel=0" frameborder="0" allowfullscreen></iframe>

    in front end I’m using the following code:

    $video = get_field('textarea');
    echo $video;

    But it will display the string as plain text, not as html code.
    How can I echo this field so that I can show the video in front-end?

    Thank you very much in advance.

  • Solved

    Single field for youtube, vimeo, or video URL on server?

    I’m planning on doing the following and wondering if there is a field to simplify the code. I’ll use a text area field which will take either youtube, or vimeo embed snippets, youtube or vimeo video URLs, or a URL to a video uploaded to the server mp4 or any other format.

    Conditional statements in the post templates will check the field, and if a snippet is used output the snippet. If a URL to a youtube/vimeo video or mp4 or other format is in the field use an HTML5 player.

    Is there a field type which would display a drop down and based on the drop down selection show either a text input, or text area so that my conditionals would only need to check if fields were empty or not rather than checking if they contain a URL or snippet which is a little more coding?

    Thanks

reply

Viewing 8 results - 1 through 8 (of 8 total)