WordPress Expert Question: What if there is no hook for your plugin?

by Trivum
4 replies
I have someone making a custom plugin for me. It involves comments. He says there is no hook for the plugin, so I need to hack the core code and insert some PHP in order to get the plugin working.

As this person is new to WordPress and might not know, I was wondering if there is a way to do this without hacking the core code.

While searching for a solution, I found the following online. It seems this person was able to do it for his situation, but I don't know if it would work in all situations.

It is not possible to add the enctype into the form declaration via WordPress as there is no hook or action to do this. So the only alternative (rather than hack the source code) is to add the attribute using JavaScript, and as we have JQuery already loaded we can utilise that.

plugin development - can I prevent WP users (even admin) from deleting custom categories? - WordPress - Stack Exchange
#expert #hook #plugin #question #wordpress
  • Profile picture of the author SteveJohnson
    There are very few things in WP that can't be hooked into or filtered.

    I don't know which form you're talking about, but if you can't add something to it, you can probably replace it completely.

    Need some more detail as to what you're wanting to accomplish, you haven't really given enough to go on.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3650114].message }}
    • Profile picture of the author Trivum
      Thanks for the reply.

      Here's the situation. I have a multi-author blog. I am trying restrict authors (not admins and editors) from seeing comments in the admin area left on posts by other authors. As it is now, they have to wade through comments left on posts that they didn't write.

      My coder, as I mentioned, said that there wasn't a hook for the plugin he wrote to hook into, so his solution was to do the following:

      In the edit-comments.php file, after this line ...

      $wp_list_table->prepare_items

      place this following line:

      apply_filters('personal_comment_filter',$wp_list_t able);
      {{ DiscussionBoard.errors[3650412].message }}
  • Profile picture of the author msaqib301
    Hey, nice share it some1 is making plug ins for you, you should be happy
    {{ DiscussionBoard.errors[3658460].message }}
    • Profile picture of the author Trivum
      Originally Posted by msaqib301 View Post

      Hey, nice share it some1 is making plug ins for you, you should be happy
      Can you re-phrase that?
      {{ DiscussionBoard.errors[3660871].message }}

Trending Topics