Alex Howes
Forum Replies Created
-
AuthorPosts
-
Alternatively it would be fine to make the old listing expire if a user creates a new one, if there was a way to do this.
Update: I think I need to add an extra (hidden) field to the form, containing the post ID. I’ve been looking for a way to do this for ages, but with no success 🙁
Update: I used the first part of the Formidable Forms code to add a tab and form to the listing details page. This works 🙂
I’ve added some code as a snippet to try to send the email to the listing owner when the form is submitted. It works if, as a test, I put in any old email address:
add_filter( ‘caldera_forms_mailer’, function( $mail, $data, $form ) {
if( ‘CF5ad9d7’ == $form[ ‘ID’ ] ) {
$mail[ ‘recipients’ ][] = ‘[email protected]’;
}
return $mail;
}, 10, 3 );However when I try to obtain the listing owner’s email, it doesn’t work:
add_filter( ‘caldera_forms_mailer’, function( $mail, $data, $form ) {
if( ‘CF5ad9d7’ == $form[ ‘ID’ ] ) {
$post_id = (isset($_POST[‘gd_place_id’]) && $_POST[‘gd_place_id’]) ? absint($_POST[‘gd_place_id’]) : ”;
if ($post_id) {
$place_email = geodir_get_post_meta($post_id, ‘geodir_email’);
}
if ($place_email) {
$mail[ ‘recipients’ ][] = $place_email;
}
}
return $mail;
}, 10, 3 );Any help would be much appreciated 🙂
Ok fair enough, thanks 🙂
This reply has been marked as private.Great, thank you! 🙂
When I log in as a user in GD and go the detail page of a listing I’ve claimed, it says “author: [my name]” (see attached image). Does this not correspond with the WP ‘author’ role?
Hi Alex,
Thanks for that. I’ll look into it if I can’t find a simpler way.
I already have a plugin that offers “role visibility” and I’ve set some content on the listing detail page to be visible only to the author. When I log in as the listing owner, the listing detail page says “Author: [my name]” but the content still isn’t visible.
Upon further investigation it seems that when a person claims a listing, they are given author capabilities and not an author role. Is this correct? Is there a way to assign them an author role for that listing so that I can show content only to them?
Thanks 🙂
This reply has been marked as private.Hi Kor,
I think you’re misunderstanding me. I am using the shortcode [gd_listings post_author=current_user] in two places on my website. One is as the main content on a page, and one is in the sidebar on another page. When it’s in the sidebar, I only want to display the picture and name.
Alex
Hi Kor,
I just want to display a reduced version of the list in the sidebar, so I only want to remove some information on certain pages when I display the listings in the sidebar.
Thanks.
I only want to remove the elements of the listing when I display them in the sidebar. Wouldn’t CSS change it everywhere?
Update: I see that you can change the width using CSS geodir_wrapper_content. Is there a way to keep it at 100% if there isn’t a sidebar, and change it to 60% if there is? The only page I want a sidebar on is the job listing details page.
Ok, thanks. I’ve had a look through the API- there seem to be functions that do things like extract information from listings. Are there also ways to add new listings and to add new reviews to listings? I’m thinking of using it in combination with the Caldera forms action.
When will GDv2 be available?
Thanks 🙂
AlexOk, cool, thanks. What is this API and where do I find it?
-
AuthorPosts