Forum Replies Created
-
AuthorPosts
-
Yasmine
ParticipantThat's great thank you. I found one more issue. When I make a meta box group section with a photo. I get a real error that stops my single post template from fully functioning. Here is the group field code that caused this new error:
'name' => __( 'Add Co-Author', 'your-text-domain' ), 'id' => $prefix . 'add_co_author', 'type' => 'group', 'clone' => true, 'fields' => [ [ 'name' => __( 'Co-author Full Name', 'your-text-domain' ), 'id' => $prefix . 'co-author_full_name', 'type' => 'text', 'clone' => true, ], [ 'name' => __( 'Co-author Email', 'your-text-domain' ), 'id' => $prefix . 'co-author_email', 'type' => 'email', 'clone' => true, ], [ 'name' => __( 'Co-author - Lead_YN', 'your-text-domain' ), 'id' => $prefix . 'co-author_lead_yn', 'type' => 'radio', 'options' => [ 'y' => __( 'Lead author', 'your-text-domain' ), 'n' => __( 'Not lead author', 'your-text-domain' ), ], 'clone' => true, 'inline' => false, ],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
-
AuthorPosts