diff --git a/includes/class-partnerexpo-core-user-fields.php b/includes/class-partnerexpo-core-user-fields.php index 09bdecc..aa3b529 100644 --- a/includes/class-partnerexpo-core-user-fields.php +++ b/includes/class-partnerexpo-core-user-fields.php @@ -178,15 +178,6 @@ class Partnerexpo_Core_User_Fields extends Partnerexpo_Core { 'company', sanitize_text_field($_POST['company']) ); - - if ( ! empty( $_POST['name'] ) && trim( $_POST['name'] ) != '' ) { - add_comment_meta( - $id, - 'name', - sanitize_text_field($_POST['name']) - ); - } - return true; } } diff --git a/public/class-partnerexpo-core-public.php b/public/class-partnerexpo-core-public.php index 70331a8..1e96a92 100644 --- a/public/class-partnerexpo-core-public.php +++ b/public/class-partnerexpo-core-public.php @@ -57,12 +57,19 @@ class Partnerexpo_Core_Public { return ob_get_clean(); } - public function comments_shortcode() { + public function comments_shortcode($atts) { wp_enqueue_style( $this->plugin_name . '-comments-css' ); wp_enqueue_script( $this->plugin_name . '-comments-js' ); // wp_enqueue_style( $this->plugin_name . '-multiselect-css' ); // wp_enqueue_script( $this->plugin_name . '-multiselect-js' ); + $atts = shortcode_atts( array( + 'post_id' => get_the_ID(), + ), $atts ); + + // This variable is now scoped and ready for the partial + $post_id = intval( $atts['post_id'] ); + ob_start(); include plugin_dir_path( __FILE__ ) . 'partials/partnerexpo-core-public-comments.php'; return ob_get_clean(); diff --git a/public/css/comments.css b/public/css/comments.css index 5c1092c..f6195d2 100644 --- a/public/css/comments.css +++ b/public/css/comments.css @@ -1,3 +1,13 @@ +#pexpo-custom-comment-form { + width: 100%; + padding: 20px; + box-sizing: border-box; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + .pexpo-core-comments-title { text-align: center; font-size: 2rem; @@ -105,6 +115,7 @@ border-radius: 15px; padding: 20px; height: fit-content; + margin-top: 50px; & .pexpo-core-com-form-title { margin: 0 0 20px 0; @@ -146,6 +157,24 @@ margin: 50px 0; } +.pexpo-core-submit-wrapper { + display: flex; + justify-content: center; + margin: 40px; + + & .submit { + background-image: linear-gradient(rgb(178, 34, 34) 21%, rgb(149, 0, 0) 87%); + color: white; + border: none; + border-radius: 15px; + padding: 10px 20px; + font-size: 1rem; + cursor: pointer; + transition: background-color 0.3s ease; + + } +} + @keyframes scrolling { to { diff --git a/public/js/searchbox.js b/public/js/searchbox.js index 86fe613..148bc7e 100644 --- a/public/js/searchbox.js +++ b/public/js/searchbox.js @@ -379,9 +379,11 @@ class PartnerExpoSearch { div.className = "pexpo-core-card"; div.innerHTML = `
- ${this.escapeHtml(r.title)} + + ${this.escapeHtml(r.title)} +
${this.escapeHtml(r.title)} diff --git a/public/partials/partnerexpo-core-public-comments.php b/public/partials/partnerexpo-core-public-comments.php index 8be4e1c..841a68b 100644 --- a/public/partials/partnerexpo-core-public-comments.php +++ b/public/partials/partnerexpo-core-public-comments.php @@ -9,81 +9,87 @@ * @package Partnerexpo_Core * @subpackage Partnerexpo_Core/public/partials */ + ?> -
-
-
-

-
-
- get_the_ID(), - 'status' => 'approve', - ]); - - if ( ! empty( $comments ) ) { - echo '
'; - if ( count( $comments ) < 3 ) { - $groups = 6 / count( $comments ); - } else { - $groups = 2; - } - for ($i = 0; $i < $groups; $i++) { - echo '