Forum Replies Created
-
AuthorPosts
-
Yasmine
ParticipantOf course:
'name' => __( 'Add Resources', 'your-text-domain' ), 'id' => $prefix . 'resources_group', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'max_clone' => 3, 'fields' => [ [ 'name' => __( 'Resource Name', 'your-text-domain' ), 'id' => $prefix . 'name_of_resource', 'type' => 'text', ], [ 'name' => __( 'Resource Details', 'your-text-domain' ), 'id' => $prefix . 'resource_details', 'type' => 'textarea', 'tooltip' => [ 'icon' => '', 'position' => 'right', ], ], [ 'name' => __( 'Resource Link', 'your-text-domain' ), 'id' => $prefix . 'resource_link', 'type' => 'url', 'tooltip' => [ 'icon' => '', 'position' => 'right', ], ],Yasmine
ParticipantI still get the error, but the error did not cause the issue.
Yasmine
ParticipantOk, worked it out the code was missing a speech mark
function libs_import() { wp_enqueue_style( 'datatable-style', 'https://cdn.jsdelivr.net/npm/[email protected]/media/css/jquery.dataTables.min.css', '1.10.18', true ); wp_enqueue_script( 'datatable-script', 'https://cdn.jsdelivr.net/npm/[email protected]/media/js/jquery.dataTables.min.js', array( 'jquery' ) ); wp_enqueue_script('/*here*/ theme-script', get_template_directory_uri() . '/js/script.js' ); } add_action( 'wp_enqueue_scripts', 'libs_import' );Yasmine
ParticipantHi - this just happened to me too. All of my fields are gone.
Yasmine
Participant*back (not stuck)
Yasmine
ParticipantHi Long,
Adding the prefix got the data stuck. But it didn't fix not being able to use the
filefield in a field group - without it breaking!Many thanks,
YasmineYasmine
Participant...However after finally managing to change my post type back to my CPT, I am still unable to get my data back on the frontend. Everything is now saved in custom fields, rather than in my CPT. Changing the post type did not fix it.
Yasmine
ParticipantHi Long - just an update to this. I found the issue. I was trying to adding a
filefield within a group field. After trying to update my custom fields, it automatically saves to a 'post' post type. I tried with file upload and file. Then I tried with file advanced and the whole thing crashedYasmine
ParticipantI will contact them. But just wondering, have you ever come across the meta box custom field type getting stuck and being unable to change - and have any idea how to fix. I only ask as I disabled every plugin and the problem was still there!
Yasmine
ParticipantGot it working using
sprintf- but it turned out shouldn't have been displaying as an array in first place (a third party plugin was modifying it). So all sorted. Thanks again.Yasmine
ParticipantI did a little experiment, but was hoping was missing trick. Thank you for clarifying!
Yasmine
ParticipantActually - it is still not working.
On an admin account it outputs: string(1) "P"
And for a non-admin role it outputs: string(9) "Professor"
Can't seem to just get the "professor" part!
Yasmine
ParticipantThanks Long!
Yasmine
ParticipantFixed
Yasmine
ParticipantThank you Long, I appreciate it. There are two fields
Academic position:
add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Profile: Academic Profile', 'your-text-domain' ), 'id' => 'academic_profile', 'type' => 'user', 'fields' => [ [ [ 'name' => __( 'Academic Position', 'your-text-domain' ), 'id' => $prefix . 'academic_position', 'type' => 'select', 'options' => [ 'Distinguished Professor' => __( 'Distinguished Professor', 'your-text-domain' ), 'Honorary Professor' => __( 'Honorary Professor', 'your-text-domain' ), 'Professor' => __( 'Professor', 'your-text-domain' ), 'Associate Professor' => __( 'Associate Professor', 'your-text-domain' ), 'Assistant Professor' => __( 'Assistant Professor', 'your-text-domain' ), 'Senior Lecturer' => __( 'Senior Lecturer', 'your-text-domain' ), 'Lecturer' => __( 'Lecturer', 'your-text-domain' ), 'Associate Lecturer' => __( 'Associate Lecturer', 'your-text-domain' ), 'Junior Lecturer' => __( 'Junior Lecturer', 'your-text-domain' ), 'Postdoctoral Researcher' => __( 'Postdoctoral Researcher', 'your-text-domain' ), 'PhD Researcher' => __( 'PhD Researcher', 'your-text-domain' ), 'Reader' => __( 'Reader', 'your-text-domain' ), 'Senior Research Fellow' => __( 'Senior Research Fellow', 'your-text-domain' ), 'Research Fellow' => __( 'Research Fellow', 'your-text-domain' ), 'Research Assistant' => __( 'Research Assistant', 'your-text-domain' ), 'Research Consultant' => __( 'Research Consultant', 'your-text-domain' ), 'Researcher' => __( 'Researcher', 'your-text-domain' ), 'Journalist' => __( 'Journalist', 'your-text-domain' ), 'Writer' => __( 'Writer', 'your-text-domain' ), ], 'admin_columns' => 'after title', ], ], ]; return $meta_boxes; }And academic_title
add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Profile: About You', 'your-text-domain' ), 'id' => 'basic_profile', 'type' => 'user', 'fields' => [ [ 'name' => __( 'Academic Title', 'your-text-domain' ), 'id' => $prefix . 'academic_title', 'type' => 'select_advanced', 'options' => [ 'Dr' => __( 'Dr', 'your-text-domain' ), 'Professor' => __( 'Professor', 'your-text-domain' ), ], 'columns' => 2, ],And hard to share screenshot (although still can), but here is a copy and paste:
array(1) { [0]=> string(2) "Dr" }
NICE Test
array(1) { [0]=> string(18) "Associate Lecturer" } -
AuthorPosts