plugin_url() . '/assets/css/review/frontend_style.css', [], A2WL()->version ); wp_enqueue_script( 'a2wl-fancybox', A2WL()->plugin_url() . '/assets/js/fancybox/fancybox.umd.js', [], A2WL()->version, true ); wp_enqueue_style( 'a2wl-fancybox-style', A2WL()->plugin_url() . '/assets/css/fancybox/fancybox.css', [], A2WL()->version ); wp_enqueue_script( 'a2wl-review-frontend-script', A2WL()->plugin_url() . '/assets/js/review/frontend_script.js', [], A2WL()->version, true ); } } function comment_text($comment_text, $comment = null) { if (is_null($comment)) { return $comment_text; } if (get_setting('review_show_image_list')) { $thumb_width = get_setting('review_thumb_width') . "px"; $image_list = Review::get_comment_photos($comment->comment_ID); if ($image_list) { $comment_text .= "
"; } } return $comment_text; } function get_avatar_url($url, $id_or_email, $args) { if ($id_or_email instanceof \WP_Comment) { $comment = $id_or_email; $comment_id = $comment->comment_ID; $image_path = get_comment_meta($comment_id, 'a2wl_avatar', true); $no_avatar_image = get_setting('review_noavatar_photo', A2WL()->plugin_url() . '/assets/img/noavatar.png'); if (empty($image_path) || is_null($image_path)) { $image_path = $no_avatar_image; }else{ if (is_numeric($image_path)){ //todo: maybe check url scheme too? $photo_id = $image_path; $image_path = wp_get_attachment_image_src($photo_id, 'thumbnail'); $image_path = $image_path ? $image_path[0] : $no_avatar_image; } else { $image_path = set_url_scheme($image_path, 'https'); } } return $image_path; } return $url; } }