WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Need Help with Custom filer-Plugin (5 posts)

  1. Thief_PL
    Member
    Posted 2 years ago #

    Hello recently i have found a hack that allowed me to remove the website field from the comment box.

    Here is the plugin:

    <?php
    /*
    Plugin Name: WordPress MOD
    */
    add_filter('comment_form_default_fields', 'url_filtered');
    function url_filtered($fields)
    {
    if(isset($fields['url']))
    unset($fields['url']);
    return $fields;
    }
    ?>

    and now is there any way i could use the similar code to remove this massage from the comment box:

    You may use these HTML tags and attributes: <abbr title=""> <acronym title=""> <b>

    <cite> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> </strong></em>

    Thx for your help!!!

  2. bcwp
    Member
    Posted 2 years ago #

    I recommend you have a look at the following thread, as it should answer your question:

    http://wordpress.org/support/topic/remove-you-may-use-these-html-tags-and-attributes?replies=21

  3. Thief_PL
    Member
    Posted 2 years ago #

    hm.. i am trying to hack it using a plugin like i did here:

    <?php
    /*
    Plugin Name: WordPress MOD
    */
    add_filter('comment_form_default_fields', 'url_filtered');
    function url_filtered($fields)
    {
    if(isset($fields['url']))
    unset($fields['url']);
    return $fields;
    }
    ?>

    The link that you gave me was showing how to edit the core of the wp.

  4. bcwp
    Member
    Posted 2 years ago #

    No, that's not what I was referring to. Rev. Voodoo was telling people NOT to edit the core. His suggested code should work for you:

    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;
    }

    Did you try it? You can use it in your plugin file instead of the theme's functions.php file.

    BTW, it's not considered hacking to filter the output via a plugin.

  5. Thief_PL
    Member
    Posted 2 years ago #

    thx man it worked!!!!!

    Here is the plugin if anyone ever needs it!!

    It removes the website field from comment box and the text that appears before the submit button!

    <?php
    /*
    Plugin Name: WordPress MOD
    */
    add_filter('comment_form_default_fields', 'url_filtered');
    function url_filtered($fields)
    {
    if(isset($fields['url']))
    unset($fields['url']);
    return $fields;
    }
    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;
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.