Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello Tom,
    I d like to do the same. Did you find the trick, by any chance?

    I would like to get it above comment button too.

    Find and comment this code in plugin.php

    add_action('comment_form', 'commentimage_comment_form', 99);
    function commentimage_comment_form()
    {
        //if (!is_single() && !is_page()) return;
        if (!is_singular()) {
            return;
        }
    
        $options = get_option('commentimage');
        if ($options['field'] == 0)
        {
            $images = $options['images'];
            if (!isset($images) || !is_numeric($images)) $images = 1;
            for ($i=0; $i<$images; $i++)
            {
                echo '<p style="clear: both"><input style="width: auto" type="file" name="image' . ($i==0?'':$i) .'"/> ' . htmlspecialchars($options['label']) . '</p>';
            }
        }
    }

    and add this code:

    function add_comment_fields($fields) {
    	//if (!is_single() && !is_page()) return;
        if (!is_singular()) {
            return;
        }
    
        $options = get_option('commentimage');
        if ($options['field'] == 0)
        {
            $images = $options['images'];
            if (!isset($images) || !is_numeric($images)) $images = 1;
            for ($i=0; $i<$images; $i++)
            {
                echo '<p style="clear: both"><input style="width: auto" type="file" name="image' . ($i==0?'':$i) .'"/> ' . htmlspecialchars($options['label']) . '</p>';
    
            }
        }
    
        return $fields;
    
    }
    add_filter('comment_form_default_fields','add_comment_fields');

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘can it move above comment button’ is closed to new replies.