Compare commits

..

5 Commits

Author SHA1 Message Date
55a1871a25 forgot to change version number again 2026-03-14 19:32:34 +01:00
ef7c5ccec8 replaced comment form for a custom one 2026-03-14 19:31:12 +01:00
00c23b43de the previous one is a fatal error 2026-03-14 13:44:41 +01:00
fb08e2adad previous one didnt work, maybe this 2026-03-14 13:42:19 +01:00
4809603a2f possibly fixed comment form 2026-03-14 13:38:19 +01:00
6 changed files with 126 additions and 82 deletions

View File

@@ -28,6 +28,15 @@ class Partnerexpo_Core_User_Fields extends Partnerexpo_Core {
$this->loader->add_filter( 'registration_errors', $this, 'registration_errors', 10, 3 );
$this->loader->add_filter( 'comment_post', $this, 'validate_comment' );
$this->loader->add_action( 'init', $this, 'remove_filters' );
}
public function remove_filters() {
remove_all_filters('comment_form_defaults');
remove_all_filters('comment_form_top');
remove_all_filters('comment_form_before');
remove_all_filters('comment_form_after');
}
public function add_user_new_fields() {
@@ -169,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;
}
}

View File

@@ -9,7 +9,7 @@
* Plugin Name: PartnerExpo Core
* Plugin URI: https://partnerexpo.eu
* Description: A PartnerEXPO oldal belső pluginja
* Version: 1.1.8
* Version: 1.1.9
* Author: Juhász Levente
* Author URI: https://github.com/Duskell/
* License: GPL-2.0+
@@ -23,7 +23,7 @@ if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'PARTNEREXPO_CORE_VERSION', '1.1.8' );
define( 'PARTNEREXPO_CORE_VERSION', '1.1.9' );
function activate_partnerexpo_core() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php';

View File

@@ -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();

View File

@@ -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 {

View File

@@ -379,9 +379,11 @@ class PartnerExpoSearch {
div.className = "pexpo-core-card";
div.innerHTML = `
<div class="pexpo-core-imageWrap">
<a href="${this.escapeHtml(r.url)}" target="_self" rel="noopener noreferrer">
<img src="${this.escapeHtml(r.image || '')}"
alt="${this.escapeHtml(r.title)}"
style="width:100%; border-radius:10px; object-fit:cover;" />
</a>
</div>
<div class="pexpo-core-cardTop">
<a href="${this.escapeHtml(r.url)}" class="pexpo-core-title">${this.escapeHtml(r.title)}</a>

View File

@@ -9,9 +9,9 @@
* @package Partnerexpo_Core
* @subpackage Partnerexpo_Core/public/partials
*/
?>
<div class="pexpo-core-root pexpo-core-shell" id="pexpo-core-comments-shell">
<div class="pexpo-core-comments" id="pexpo-core-comments">
<div class="pexpo-core-comments-header">
<h2 class="pexpo-core-comments-title"><?php echo esc_html__('Visszajelzések', 'partnerexpo-core'); ?></h2>
@@ -40,9 +40,9 @@
<?php echo get_comment_text( $comment ); ?>
</div>
<div class="pexpo-core-comment-said_by">
<?php if ( get_comment_meta( $comment->comment_ID, 'name', true ) ): ?>
<?php if ( get_comment_meta( $comment->comment_ID, 'author', true ) ): ?>
<div class="pexpo-core-comment-author">
<p><?php echo get_comment_meta( $comment->comment_ID, 'name', true ); ?></p>
<p><?php echo get_comment_meta( $comment->comment_ID, 'author', true ); ?></p>
</div>
<p>-</p>
<?php endif; ?>
@@ -64,26 +64,32 @@
}
?>
</div>
<?php
$comments_args = array(
'label_submit' => __( 'Küldés', 'partnerexpo-core' ),
'title_reply' => '',
'comment_notes_after' => '',
'must_log_in' => '',
'logged_in_as' => '',
'comment_field' => '
<form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="pexpo-custom-comment-form">
<div class="pexpo-core-com-form-wrapper">
<h2 class="pexpo-core-com-form-title">' . _x( 'Visszajelzés küldése', 'partnerexpo_core' ) . '</h2>
<p class="pexpo-core-com-field"><label for="name">' . _x( 'Kitöltő neve', 'partnerexpo_core' ) . '</label><br />
<input type="text" id="name" name="name" aria-required="true"></p>
<p class="pexpo-core-com-field"><label for="company">' . _x( 'Cég név', 'partnerexpo_core' ) . '</label><br />
<input type="text" id="company" name="company" aria-required="true"></p>
<p class="pexpo-core-com-field"><label for="comment">' . _x( 'Hozzászólás', 'partnerexpo_core' ) . '</label><br />
<textarea id="comment" name="comment" aria-required="true" maxlength="600"></textarea></p>
<h2 class="pexpo-core-com-form-title"><?php echo esc_html_x( 'Visszajelzés küldése', 'partnerexpo_core' ); ?></h2>
<div class="pexpo-core-com-field">
<label for="author"><?php echo esc_html_x( 'Kitöltő neve', 'partnerexpo_core' ); ?></label><br />
<input type="text" id="author" name="author" aria-required="true" required>
</div>
',
);
comment_form( $comments_args );
?>
<div class="pexpo-core-com-field">
<label for="company"><?php echo esc_html_x( 'Cég név', 'partnerexpo_core' ); ?></label><br />
<input type="text" id="company" name="company" aria-required="true" required>
</div>
<div class="pexpo-core-com-field">
<label for="comment"><?php echo esc_html_x( 'Hozzászólás / Visszajelzés', 'partnerexpo_core' ); ?></label><br />
<textarea id="comment" name="comment" aria-required="true" maxlength="600" required></textarea>
</div>
<div><input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $post_id ); ?>" id="comment_post_ID"></div>
<div><input type="hidden" name="comment_parent" id="comment_parent" value="0"></div>
</div>
<div class="pexpo-core-submit-wrapper">
<button type="submit" name="submit" id="submit" class="submit"><?php _e( 'Küldés', 'partnerexpo-core' ); ?></button>
</div>
</form>
</div>