tazar64
Forum Replies Created
-
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Add to RelationshipThe User extended POD has the relationship field:
acces_user_expand
wpcw_course POD has the bi-directional field:acces_user_exp-backForum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Add to RelationshipThank you for your response. Unfortunately, it does not work the other way around either. The code now is:
add_action(‘wpcw_enroll_student’, function($student_id, $course_ids) {
if (is_array($course_ids) && !empty($course_ids)) {
foreach ($course_ids as $course_id) {
$course_pod = pods(‘wpcw_course’, $course_id);
$course_pod->add_to(‘acces_user_exp-back’, $student_id);
}
}
}, 10, 2);I have tested by updating other fields, and that worked fine. Could you please advise what might be wrong?
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] pods_field_display issue$course_id was different than post ID. My confusion.
Thank you very much!
After adding that function, I have tried the shortcode like this:
[pods name="cpt-with-more-authors" ...] ... by {@post_author,get_the_author_by_id} [/pods]and it returns the username of the author as I wanted :).
So, is this the right method? as I haven’t seen it documented anywhere.- This reply was modified 3 years, 6 months ago by tazar64.
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Delete unused relationshipOoops, that means I super-bloated my websites’ databases with a ton of fields and relationships while I was learning and testing 🙁
I didn’t plan before I build…
- This reply was modified 3 years, 6 months ago by tazar64.
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Delete unused relationship*repair = clean of unused/deleted fields/relationships.
As I said, I have one more website which had the same problem.
I have done the same ‘operation’ as described above AND have made the change toget_the_ID()and it works 🙂Thank you very much!
It seems that it got back to normal and works again.
I had unticked “Additional User Capabilities” and then ticked it back.
Now, with my initial code, users (contributors now) see ‘delete’ button only when it’s their post and can delete it.However, I feel that something is not quite right and such mysterious issues can come back.
- This reply was modified 3 years, 7 months ago by tazar64.
@pdclark , yes, it’s a single select field. Your code works indeed for the Administrator. As you have said in your first reply it may need further work to work for other roles too. It doesn’t work for contributor either.
I have changed the subscribers to contributors but there is no improvement in my case.
I have also changed toget_the_ID()but it didn’t help either.I have no idea what I can do further. Probably it’s some misconfiguration or plugin conflict as it worked until some update – I cannot know what update. The same thing happened to another website without any intervention by me, just automatic updates.
How can I “downdate” PODS to try again with 2.8.8?- This reply was modified 3 years, 7 months ago by tazar64.
Thank you, @pdclark ! Your detailed answer helps me understand better how things work.
Now, I have (re-)enabled ‘author’ box in my PODS CPT.
Moreover, I had set the permissions/capabilities for the subscribers using User Role editor plugin. I gave them the right to edit and delete their own story. They also have access to wp-admin for that WP functionality to work.<?php if (current_user_can( 'delete_story', $post->ID) ) { ?> <a onclick="return confirm('Are you sure you want to delete this post?')" href="<?php echo get_delete_post_link( $post->ID ); ?>">Delete Post</a> <?php } ?>The code above is working well to allow users to delete their own posts only. However, it shows ‘delete post’ in case of all posts, by ALL users 🙁 – however, clicking delete will delete the right posts only.
Is any explanation for that?I have tried your code but it didn’t work for me now (it doesn’t show anything). I have just replaced
'authors'with my field name'by_user'.Thank you for your time!
Thank you @keraweb
I’ll definitely check that as the small php code was the simplest solution.
However, is any chance to do that check, as explained above, using some PODS shortcode?Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Shortcode Pagination not workingWow! I have copied the code with those quotes from somewhere and never thought they are different and can affect the result.
It works as expected now. Thank you a lot!
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] shortcode to check the _totalHi
I thought this was solved, but I tested again and it’s not working.
Or please indicate some documentation where we can see the exact syntax.Thank you.
Wow, that’s fantastic! Great plugin, support, documentation… everything’s perfect.
Thank you a lot.Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] CPT as author of Posts?Thank you, Jory.
I wanted to be sure that I don’t miss something. Relationship works very well too.