Example #1
0
    /**
     * Remove Fields
     *
     * @param array $args
     *
     * @return array
     */
    public function comment_form_fields($args)
    {
        if ($this->is_thread(get_post_type())) {
            if (!is_user_logged_in()) {
                wp_enqueue_script('2ch-form');
                foreach (array('author', 'email', 'url') as $key) {
                    if (isset($args[$key])) {
                        unset($args[$key]);
                    }
                }
                // Add trip
                if ($this->option->use_trip) {
                    $title = __('Hash', '2ch');
                    $place_holder = nichan_hash_description();
                    $args['trip'] = <<<HTML
<p class="comment-form-trip">
<label for="trip">{$title}</label>
<input name="trip" id="trip" type="text" value="" size="30"/>
</p>
<p class="nichan-thread__description">{$place_holder}</p>
HTML;
                }
                // Add recaptcha
                $title = esc_html__('Spam Check', '2ch');
                $key = esc_attr($this->option->recaptcha_pub_key);
                $nonce = wp_nonce_field('nichan_comment', '_nichancommentnonce', false, false);
                $id = get_the_ID();
                $args['recaptcha'] = <<<HTML
<p class="comment-form-recaptcha">
<label for="recaptcha">{$title}<span class="required">*</span></label>
</p>
<div id="nichan-recaptcha" data-post-id="{$id}" class="g-recaptcha nichan-thread__recaptcha" data-sitekey="{$key}"></div>
{$nonce}
HTML;
            }
        }
        return $args;
    }
Example #2
0
	<?php 
if ($use_hash) {
    ?>
	<div class="nichan-thread-group">
		<label class="nichan-thread__label" for="nichan-thread-trip"><?php 
    esc_html_e('Hash', '2ch');
    ?>
</label>
		<input type="text" id="nichan-thread-trip" name="trip" value=""
		       placeholder="<?php 
    esc_attr_e('Enter the words you only know', '2ch');
    ?>
">
		<p class="nichan-thread__description">
			<?php 
    echo nichan_hash_description();
    ?>
		</p>
	</div>
	<?php 
}
?>

	<!-- Taxonomies -->
	<?php 
foreach (get_object_taxonomies($post_type->name, OBJECT) as $taxonomy) {
    if ($taxonomy->public) {
        ?>
	<div class="nichan-thread__group">
		<?php 
        if ($taxonomy->hierarchical) {