Compare commits
5 Commits
cdc45c2114
...
55a1871a25
| Author | SHA1 | Date | |
|---|---|---|---|
| 55a1871a25 | |||
| ef7c5ccec8 | |||
| 00c23b43de | |||
| fb08e2adad | |||
| 4809603a2f |
@@ -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( 'registration_errors', $this, 'registration_errors', 10, 3 );
|
||||||
$this->loader->add_filter( 'comment_post', $this, 'validate_comment' );
|
$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() {
|
public function add_user_new_fields() {
|
||||||
@@ -169,15 +178,6 @@ class Partnerexpo_Core_User_Fields extends Partnerexpo_Core {
|
|||||||
'company',
|
'company',
|
||||||
sanitize_text_field($_POST['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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Plugin Name: PartnerExpo Core
|
* Plugin Name: PartnerExpo Core
|
||||||
* Plugin URI: https://partnerexpo.eu
|
* Plugin URI: https://partnerexpo.eu
|
||||||
* Description: A PartnerEXPO oldal belső pluginja
|
* Description: A PartnerEXPO oldal belső pluginja
|
||||||
* Version: 1.1.8
|
* Version: 1.1.9
|
||||||
* Author: Juhász Levente
|
* Author: Juhász Levente
|
||||||
* Author URI: https://github.com/Duskell/
|
* Author URI: https://github.com/Duskell/
|
||||||
* License: GPL-2.0+
|
* License: GPL-2.0+
|
||||||
@@ -23,7 +23,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
define( 'PARTNEREXPO_CORE_VERSION', '1.1.8' );
|
define( 'PARTNEREXPO_CORE_VERSION', '1.1.9' );
|
||||||
|
|
||||||
function activate_partnerexpo_core() {
|
function activate_partnerexpo_core() {
|
||||||
require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php';
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-partnerexpo-core-activator.php';
|
||||||
|
|||||||
@@ -57,12 +57,19 @@ class Partnerexpo_Core_Public {
|
|||||||
return ob_get_clean();
|
return ob_get_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function comments_shortcode() {
|
public function comments_shortcode($atts) {
|
||||||
wp_enqueue_style( $this->plugin_name . '-comments-css' );
|
wp_enqueue_style( $this->plugin_name . '-comments-css' );
|
||||||
wp_enqueue_script( $this->plugin_name . '-comments-js' );
|
wp_enqueue_script( $this->plugin_name . '-comments-js' );
|
||||||
// wp_enqueue_style( $this->plugin_name . '-multiselect-css' );
|
// wp_enqueue_style( $this->plugin_name . '-multiselect-css' );
|
||||||
// wp_enqueue_script( $this->plugin_name . '-multiselect-js' );
|
// 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();
|
ob_start();
|
||||||
include plugin_dir_path( __FILE__ ) . 'partials/partnerexpo-core-public-comments.php';
|
include plugin_dir_path( __FILE__ ) . 'partials/partnerexpo-core-public-comments.php';
|
||||||
return ob_get_clean();
|
return ob_get_clean();
|
||||||
|
|||||||
@@ -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 {
|
.pexpo-core-comments-title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
@@ -105,6 +115,7 @@
|
|||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
|
margin-top: 50px;
|
||||||
|
|
||||||
& .pexpo-core-com-form-title {
|
& .pexpo-core-com-form-title {
|
||||||
margin: 0 0 20px 0;
|
margin: 0 0 20px 0;
|
||||||
@@ -146,6 +157,24 @@
|
|||||||
margin: 50px 0;
|
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 {
|
@keyframes scrolling {
|
||||||
to {
|
to {
|
||||||
|
|||||||
@@ -379,9 +379,11 @@ class PartnerExpoSearch {
|
|||||||
div.className = "pexpo-core-card";
|
div.className = "pexpo-core-card";
|
||||||
div.innerHTML = `
|
div.innerHTML = `
|
||||||
<div class="pexpo-core-imageWrap">
|
<div class="pexpo-core-imageWrap">
|
||||||
|
<a href="${this.escapeHtml(r.url)}" target="_self" rel="noopener noreferrer">
|
||||||
<img src="${this.escapeHtml(r.image || '')}"
|
<img src="${this.escapeHtml(r.image || '')}"
|
||||||
alt="${this.escapeHtml(r.title)}"
|
alt="${this.escapeHtml(r.title)}"
|
||||||
style="width:100%; border-radius:10px; object-fit:cover;" />
|
style="width:100%; border-radius:10px; object-fit:cover;" />
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="pexpo-core-cardTop">
|
<div class="pexpo-core-cardTop">
|
||||||
<a href="${this.escapeHtml(r.url)}" class="pexpo-core-title">${this.escapeHtml(r.title)}</a>
|
<a href="${this.escapeHtml(r.url)}" class="pexpo-core-title">${this.escapeHtml(r.title)}</a>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
* @package Partnerexpo_Core
|
* @package Partnerexpo_Core
|
||||||
* @subpackage Partnerexpo_Core/public/partials
|
* @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" id="pexpo-core-comments">
|
|
||||||
<div class="pexpo-core-comments-header">
|
<div class="pexpo-core-comments-header">
|
||||||
<h2 class="pexpo-core-comments-title"><?php echo esc_html__('Visszajelzések', 'partnerexpo-core'); ?></h2>
|
<h2 class="pexpo-core-comments-title"><?php echo esc_html__('Visszajelzések', 'partnerexpo-core'); ?></h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -40,9 +40,9 @@
|
|||||||
<?php echo get_comment_text( $comment ); ?>
|
<?php echo get_comment_text( $comment ); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="pexpo-core-comment-said_by">
|
<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">
|
<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>
|
</div>
|
||||||
<p>-</p>
|
<p>-</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@@ -64,26 +64,32 @@
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
|
||||||
$comments_args = array(
|
<form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="pexpo-custom-comment-form">
|
||||||
'label_submit' => __( 'Küldés', 'partnerexpo-core' ),
|
|
||||||
'title_reply' => '',
|
|
||||||
'comment_notes_after' => '',
|
|
||||||
'must_log_in' => '',
|
|
||||||
'logged_in_as' => '',
|
|
||||||
'comment_field' => '
|
|
||||||
<div class="pexpo-core-com-form-wrapper">
|
<div class="pexpo-core-com-form-wrapper">
|
||||||
<h2 class="pexpo-core-com-form-title">' . _x( 'Visszajelzés küldése', 'partnerexpo_core' ) . '</h2>
|
<h2 class="pexpo-core-com-form-title"><?php echo esc_html_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 />
|
<div class="pexpo-core-com-field">
|
||||||
<input type="text" id="name" name="name" aria-required="true"></p>
|
<label for="author"><?php echo esc_html_x( 'Kitöltő neve', 'partnerexpo_core' ); ?></label><br />
|
||||||
<p class="pexpo-core-com-field"><label for="company">' . _x( 'Cég név', 'partnerexpo_core' ) . '</label><br />
|
<input type="text" id="author" name="author" aria-required="true" required>
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
',
|
|
||||||
);
|
<div class="pexpo-core-com-field">
|
||||||
comment_form( $comments_args );
|
<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>
|
||||||
|
|
||||||
|
<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>
|
</div>
|
||||||
Reference in New Issue
Block a user