• The content of a plugin to erase any thing in ‘comment_notes_after’ can be this:

    function mytheme_init() {
    add_filter('comment_form_defaults','mytheme_comments_form_defaults');
    }
    add_action('after_setup_theme','mytheme_init');
    function mytheme_comments_form_defaults($default) {
    	unset($default['comment_notes_after']);
    	return $default;
    }

    But don’t works on any theme. In the default theme “Twenty Ten”, works fine, but in the Suffusion don’t works. The theme overwrite this filter. What can I do to override the choices of the theme?
    What hook can I use to overwrite options of the theme?

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php comment_form(array('comment_notes_after' => '')); ?>

    Try this in comments.php.

    Go to Back-end Settings → Custom Includes → Custom Styles and put in this:
    .form-allowed-tags { display: none; }

    Thread Starter Artur Bezerra

    (@scriptman)

    Thank you for the answers, but I think that I went misunderstood.

    The method I’m using is working fine, but isn’t working in any theme.

    I want to do this by an method that is called by an hook, as I mentioned just above, through a plugin that can be applied to any theme, whithout modifying any file of theme. The goal is find a hook that solve this problem.
    Again, the function that remove the comment_notes_after is working fine, but the hook that I using don’t work to all themes. What hook can I use that not will be replaced by the theme?

    @scriptman,
    Whether the function works for a theme or not is dependent entirely on the mechanism in which the theme calls certain functions. Typically a theme does this:

    comment_form($arguments);

    In the above $arguments is an array that might contain comment_notes_after. If so, then the filter will have no effect whatsoever on the field display. That is because behind the scenes WP takes all the input arguments (i.e. the $arguments parameter above), merges them with a set of defaults, then displays the comment form. The filter you are using simply removes the comment_notes_after from the defaults, but since $arguments has it, WP merges the two arrays and the net result has comment_notes_after.

    My advice would be to make a copy of comments.php in your child theme, and simply remove the line that includes comment_notes_after in that file (in addition to having your filter). Since you are anyway running a child theme, this should be quite easily done.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unset comment_notes_after for any theme’ is closed to new replies.