- This topic has 3 replies, 2 voices, and was last updated 2 years, 6 months ago by .
-
Topic
-
Hello,
I hope you will be able to help me on this. I created for my project a few meta boxes with a number of custom fields a few month ago. Today I wanted to extend one of them with addition custom field (url link). I added it to the code as I did it before but nothing has been displayed unfortunately. It looks like the new field is not “accepted”. I am enclosing the code for your attention below.
I will appropriate any help on this matter.
Thanks!<?php // meta box for Homepage - Benefits Section $meta_boxes[] = [ 'title' => esc_html__( 'Benefits Section', 'lhk' ), 'post_types' => [ 'page', ], 'context' => 'after_title', 'priority' => 'default', 'autosave' => false, 'include' => [ 'relation' => 'AND', 'template' => [ 'templates/template-homepage.php', ], ], 'fields' => [ [ 'id' => 'benefits_h1', 'type' => 'text', 'name' => esc_html__('Heading Text', 'lhk'), 'desc' => esc_html__('Please insert your text in the box.','lhk'), 'size' => 85, ], [ 'id' => 'benefits_text', 'type' => 'textarea', 'name' => esc_html__('Description', 'lhk'), 'desc' => esc_html__('Please insert your text in the box.','lhk'), ], //***** This is a new custom field I wanted to add [ 'id' => 'benefits_button_heading', 'type' => 'text', 'name' => esc_html__('See more Features', 'lhk'), 'size' => 85, ], [ 'id' => 'benefits_button_url', 'type' => 'url', 'name' => esc_html__('Redirection URL', 'lhk'), 'desc' => esc_html__('Please insert URL address in the box','lhk'), 'size' => 85, ], //***** [ 'id' => 'group_benefits', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'collapsible' => true, 'add_button' => esc_html__( 'Add FlipBox', 'lhk' ), 'group_title' => esc_html__( 'Flip Box', 'lhk' ), // ID of the subfield 'save_state' => true, 'fields' => [ [ 'id' => 'benefits_image', 'type' => 'single_image', 'name' => esc_html__('Icon/Image', 'lhk'), 'desc' => esc_html__('Please upload your image.','lhk'), ], [ 'id' => 'benefits_front', 'type' => 'text', 'name' => esc_html__('Flipbox - Front', 'lhk'), 'desc' => esc_html__('Please insert your text in the box.','lhk'), 'size' => 85, ], [ 'id' => 'benefits_back', 'type' => 'text', 'name' => esc_html__('Flipbox - Back', 'lhk'), 'desc' => esc_html__('Please insert your text in the box.','lhk'), 'size' => 85, ], ], ], ], ];
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.