lspoe2
Forum Replies Created
-
Forum: Plugins
In reply to: [Code Snippets] PHP WarningGreat. I have found it!
Thanks for your help.
Forum: Plugins
In reply to: [Site Reviews] Ajax submit spinner not workingHi,
I disabled all my plugins and also changed themes, however the spinner still doesn’t show on submit.
Any ideas what may be going on here?
Thanks
Forum: Plugins
In reply to: [Site Reviews] Remove the read more tag from admin viewI found a solution to this.
Thanks
Forum: Plugins
In reply to: [Site Reviews] Remove the read more tag from admin viewHi,
The screenshot is over a review in the backend area (/wp-admin/edit.php?post_type=site-review) when in extended view mode.
I tried disabling all my plugins and It didn’t change anything. Would this be default WordPress behaviour?
Thanks
Forum: Plugins
In reply to: [Site Reviews] Hide the assigned post column by default for certain user roleThank you!
Forum: Plugins
In reply to: [Site Reviews] Send email to post author if their review was cancelled.Thanks.
Just another question about email sending, I’d like to send emails when the old status is publish. I’m using the below, is that fine as it is? It seems to be working:
if (!empty($author_email) && !$alreadySentNotification && 21084 == $review->form && $oldStatus == 'publish') { if ($sent = wp_mail($author_email, $subject, $message)) { update_post_meta($post->ID, $metaKey, true); } else { apply_filters('glsr_log', null, 'The notification to <'.$author_email.'> was not sent. Please verify that your server is able to send emails correctly through WordPress.'); } } }, 10, 3);Thanks for your help.
Forum: Plugins
In reply to: [Site Reviews] Send email to post author if their review was cancelled.Hi,
I tried this, however it doesn’t work:
$assignedPostIds = $review->assigned_posts; $author_id = get_post_field( 'post_author', $assignedPostIds ); $author_email = get_the_author_meta( 'user_email', $author_id );Do you have any suggestions?
Also, when do you plan to release the notifications add on?
I’ll definitely be buying if I can organise all my emails sending that way.Thanks
Forum: Plugins
In reply to: [Site Reviews] Add link to review author nameI tried the code in the link and also the one below, but both don’t seem to work:
add_filter( 'site-reviews/review/value/author', function( $review, $post ) { if( $user = get_userdata( $review->user_id )) { $authorUrl = get_author_posts_url( $user->ID ); $review->author = '<a href="'.$authorUrl.'">'.$review->author.'</a>'; } return $review; }, 10, 2 );I’m using the forms add on. Not sure if that could be the issue?
Thanks
- This reply was modified 4 years, 7 months ago by lspoe2.
Forum: Plugins
In reply to: [Site Reviews] Dynamic Review TitleJust noticed my mistake… I didn’t define the post ID in the date shortcode.
Still haven’t been able to figure our how to get this to only work with a certain form ID though. Is it even possible?
Thanks for your help.
Forum: Plugins
In reply to: [Site Reviews] Limiting Reviews – How does it work?Oh, ok.
Although on my site it seem to be the case that it gets reset, which for me isn’t such a bad thing though.
I’ll look further into it.
Thanks
Forum: Plugins
In reply to: [Site Reviews] Dynamic Review TitleThanks.
I was able to put together the below code.
I’m trying to make the title from the $city, $region and $dates fields on my post.$city and $region are working great. Only the $dates isn’t working. I did contact support of the plugin I’m using for custom post types and they said they see nothing wrong with the code and the $dates should be outputting.
Do you have any suggestions?
On another note, how could I make sure the below only applies to the form with ID 21084, the below if statement doesn’t seem to work
/** * Modifies the review values before they are saved * Paste this in your active theme's functions.php file. * @param array $values * @return array */ add_filter('site-reviews/create/review-values', function ($values) { if ('21084' != $review->form) { $authordata = get_userdata( fep_get_message_field( 'mgs_author' ) ); $user = wp_get_current_user(); $mypost_id = url_to_postid( 'https://www.xyz.com/' . $user->user_nicename ); $post = get_post( $mypost_id ); $region = geodir_get_post_meta( $post->ID, 'region', true ); $city = geodir_get_post_meta( $post->ID, 'city', true ); $dates = do_shortcode( '[geodir_event_schedules type="upcoming" number="1" template="{start_date} - {end_date}" use_current="1"]' ) ; $values['title'] = $city . ', ' . $region. ', ' .$date; return $values; }});Thanks for your help.
Forum: Plugins
In reply to: [Site Reviews] Link to author profile no longer working in backendI will have a look.
On another note, I’m trying to show different messages for different forms when review is already submitted. I tried the below, however it doesn’t work:
add_filter('site-reviews/rendered/template/reviews-form', function ($template, $data) { if ('site-review' != $post->post_type || '21084' != $review->form) { $request = glsr()->request($data['args']); return glsr('Modules\Validator\ReviewLimitsValidator', ['request' => $request])->isValid() ? $template : sprintf('<p><i class="fas fa-check-circle"></i> %s</p>', __('Thanks for your review.')); }}, 10, 2);Any suggestions?
Thanks
Forum: Plugins
In reply to: [Site Reviews] Assigned links noreferrerThanks
Forum: Plugins
In reply to: [Site Reviews] Assigned links noreferrerSorry, please disregard the above.
I’d like to do the following instead:
Show {{ assigned_links }} and add target=”_blank” and rel=”noreferrer” to the link.
Show {{assigned_users}}, but only the first assigned user and link their name to their author profile.
Thanks
Forum: Plugins
In reply to: [Site Reviews] Different Emails based on the form usedThis seems to be working:
if (empty( $review->email) || ‘17297’ != $review->form) {