• stravaiger

    (@stravaiger)


    Can anyone recommend best practice for overriding pluggable functions?

    Should the new function be put in wp-includes/pluggable-functions.php or in another file and then include that in pluggable-functions.php?

    thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • chaaban

    (@chaaban)

    why dont you just make a new function ?

    if you dont want … i think you can still search in wordpress and get the file where the function is located and edit it …

    Thread Starter stravaiger

    (@stravaiger)

    Yes, a new function but where to store it? It would be nice to keep all overriding functions in a separate file, say /extensions/pluggable-functions.php and then, at the top of wp-includes/pluggable-functions.php:
    require_once(dirname(__FILE__).’/../extensions/pluggable-functions.php’);

    chaaban

    (@chaaban)

    Hummm ,

    i’m still new in wordpress .. but look what i did .

    i made a file under the plugin folder called it functions … added the header that wordpress ask for plugins just the comments stuff and then something like this :

    if (! function_exists(“my_function”))
    {
    function my_function () { }
    }

    i Enabled the plugin in the control panel and i could call this function without any prob from pages .

    Hope this help u .

    Good Luck

    Thread Starter stravaiger

    (@stravaiger)

    Hey, that’s nice, thanks.

    Is there any way to hide a plugin in the plugin menu if a user is less than a certain level?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Override a pluggable function’ is closed to new replies.