Modifying functions within capabilities.php - possible via plugin? (2 posts)

  1. mychances
    Posted 7 years ago #

    I'd like to modify just one function in capabilities.php. Specifically, I intend to modify the function "has_cap".

    I don't want to modify capabilities.php directly, since by doing so, every upgrade will break my wordpress modifications. Is there a way to modify the functions in capabilities.php via plugin, or by any other way that won't break during an upgrade?

  2. kaigou
    Posted 7 years ago #

    Can you do it via the functions.php file in your theme? I think that's loaded after the core functions, or at least that's my guess -- I've done a handful of additional functions in my theme that modify existing ones.

    Well, more precisely: I've copied the function from the core, changed it to suit me, gave it a different name, and then called that function instead. Not sure if that'd work for whatever you're trying to do.

Topic Closed

This topic has been closed to new replies.

About this Topic