Creating a Wordpress Plugin

Discussion in 'PHP' started by M.Zeb Khan, Jul 15, 2009.

  1. #1
    Hi!

    I am trying to create a plugin that will hide the date and times for comments, pages, and posts.

    Check the plugin code here:

    
    function disable_dates($date) {
        $date = str_replace("at","",$date);
        $date = str_replace($date,"",$date);
        return $date;
    }
    
    // Remove Date & Time from Post Titles
    add_filter('the_time',disable_dates);
    add_filter('the_date',disable_dates);
    
    // Remove Date & Time from Comments
    add_filter('comment_time',disable_dates);
    add_filter('comment_date',disable_dates);
    add_filter('get_comment_time',disable_dates);
    add_filter('get_comment_date',disable_dates);
    
    PHP:
    Now, this is working pretty well, but the only problem is there is a("at") remaining in the comment link, I want to get rid of that throughthe plugin, I can do it through the comment-template.php in theincludes folder but that will be another story,

    Link to a snapshot ( check the "at" under the author's title ) : http://mzeb.com/test.jpg

    Any ideas?

    Many Thanks
     
    M.Zeb Khan, Jul 15, 2009 IP
  2. goscript

    goscript Prominent Member

    Messages:
    2,753
    Likes Received:
    306
    Best Answers:
    0
    Trophy Points:
    315
    #2
    As a wordpress plugins expert I can definitely say that you cannot accomplish this without manually editing the theme files.
     
    goscript, Jul 16, 2009 IP
  3. agilius

    agilius Well-Known Member

    Messages:
    1,021
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    100
    #3
    I don't see the point of this plugin. Why not simply exclude the date output function from a template? It's not like a 10 hour job, it's a simple select and delete from a few pages of the theme...
     
    agilius, Jul 27, 2009 IP