tomwhita
Forum Replies Created
-
Forum: Plugins
In reply to: [More Privacy Options] Site Visibility | Visible only to ‘ROLE’Check out the members plugin by Justin Tadlock for this behaviour.
Forum: Plugins
In reply to: [More Privacy Options] Can I Alter The Appearance of Access Denied Page?Just bumping to see if the support thread is still being monitored…
Forum: Plugins
In reply to: [iOS images fixer] Doesn't work for Gravity Forms uploadsAny update on this?
Forum: Plugins
In reply to: [Carbon Fields] Inserting values via Gravity FormsCan I hire you to help me populate the right value in my gravity forms function when adding associations? I just need this done and I can’t figure it out. Let me know.
Forum: Plugins
In reply to: [Carbon Fields] Inserting values via Gravity FormsI ended up just changing the association field to a plain text field that will store the ID of the foreman. Since the user won’t be accessing the wordpress admin, the fancy association UI wasn’t needed. I would’ve liked to have figured this out but I have to move on to other things.
Thanks again for all your help.
TW
Forum: Plugins
In reply to: [Carbon Fields] Inserting values via Gravity FormsI got it!!!!
I used:
$foreman_association = carbon_get_post_meta( $post->ID, 'foreman_association', 'association' ); $foreman = get_user_by('id', $foreman_association[0]['id']); echo esc_html($foreman->display_name);
I’m still hung up on inserting association values though. I’m trying to insert a user association when I submit a form to create a new project. The gravity form has a drop down field with the display name of the foreman and a value of:
"user:user:' . $User->ID . '"
This doesn’t work at all. I can’t find any documentation for gravity forms about submitting values as arrays. Can you suggest anything else?
Forum: Plugins
In reply to: [Carbon Fields] Inserting values via Gravity FormsOnce you have the ID, get_user_by($id) will work properly and retrieve the user object. Note: association data is returned as an array, so you would probably have to call $project_users[0][‘id’] in the get_user_by() call.
I don’t undertand. Here is what I’ve tried. This doesn’t work:
$foremanid = carbon_get_post_meta( $post->ID, 'foreman_association', 'association' ); $foreman = get_user_by( $foremanid[0]['id'] ); echo esc_html($foreman->display_name)
Please help. I’m so close to being finished with this feature.
Thanks
TW
Forum: Plugins
In reply to: [Carbon Fields] Inserting values via Gravity FormsI really appreciate your patience with me. I’m trying to push my limits as a developer a little…
The way I’ve been able to create an association when submitting a form is by sending the unserialize value. Like this:
'"post:project:' . $post->ID . '"'
But like I said, the association doesn’t show up in the Admin panel. Though i’m able to see associated data on my page template if I pull it using:$args = array( 'post_type' => array('document'), 'post_status' => array('publish'), 'meta_query' => array( array( 'key' => '_doc_project_association', 'compare' => 'LIKE', 'value' => '"post:project:'.$post->ID.'"', ), ), ); $docs = get_posts($args);
When I try to use:
array( 'post:project:$post->ID' )
to set the field variable, it does not work.What am I doing wrong?
Also, can you go one step further in the get_user_by() reference. For example, would it be
get_user_by(project_users->ID)
?Forum: Plugins
In reply to: [Carbon Fields] Inserting values via Gravity FormsThanks. I’m having lots of fun with this project so far ??
I have successfully managed to insert an association value using a gravity form but the association is not shown in the carbon fields UI in the admin. Do you know why this might happen?
Also, how do I now retrieve data from an association field in a usable way? For example, I have associated users with the custom post type “Project”. How can I show the display name of the user on my page template?
TW
Forum: Plugins
In reply to: [Carbon Fields] query posts based on carbon fields valueThanks again. I actually added the documents before changing the data setting and so they were still storing the ID. I updated them and everything works.
I really appreciate your help.
Forum: Plugins
In reply to: [Gravity Forms + Custom Post Types] Can't seem to save private meta fieldsI have the same problem….trying to use gravity forms and + CPT plugin to allow front end creation of a CPT with hidden meta fields. Did you find a resolution?
Forum: Plugins
In reply to: [Carbon Fields] query posts based on carbon fields valueThis is great. Thank you so much.
Just one final question…How do I echo the url of the file in ‘doc_file’?
I’ve already changed the field declaration to:
Field::make('file', 'doc_file', 'File (PDF)') ->set_value_type (url),
And I’m attempting to call it via:
$docs = get_posts($args); foreach ($docs as $post) : $doclink = carbon_get_post_meta ($post->ID,'doc_file'); setup_postdata($post); ?> <div class="mdl-list__item"> <span class="mdl-list__item-primary-content"><i class="material-icons mdl-list__item-avatar ion-document-text"></i> <span><a href=<?php echo $doclink; ?> target="_blank"> <?php the_title(); ?></a></span> </span> </div>
It outputs a link but its the link to the “project” post in the loop. I want to link to the file that associated with the project.
Forum: Plugins
In reply to: [Carbon Fields] query posts based on carbon fields valueContainer::make('post_meta', __('Document Information')) ->show_on_post_type('document') ->add_fields(array( Field::make('text', 'doc_description', 'Description'), Field::make('file', 'doc_file', 'File (PDF)'), Field::make('association', 'doc_project_association', 'Assign To Project') ->set_types(array( array( 'type' => 'post', 'post_type' => 'project', ), )), ));
Forum: Plugins
In reply to: [Carbon Fields] Retrieving values using get_post_metaThanks. This makes sense. I wasn’t able to find the answer in your docs. Was it in there? Perhaps I missed it.
I changed the code to your preferred solution and it works. I also added an esc_html. Below is the complete solution for showing a field value within a loop in case anyone is interested:
Assumes you’ve already fetched the posts:
<?php $yourfieldvariable = carbon_get_post_meta($post->ID, 'your_field_key'); echo esc_html( $yourfieldvariable ); ?>