Suggestion… if functions exists in functions.php

  • Posted in : Readme
  • broheim
    Participant

    Might I make a suggestion. Can you wrap your functions with the ability to check if a functions exists? function_exists(‘functionname’)

    I tweaked the password form a little and had to comment out the entire function pixelwars_theme_password_form() in the parent theme functions.php. Now I have to remember every time the theme is upgraded.

    Mehmet S.
    Keymaster

    Hi, the pixelwars_theme_password_form() function is already exist in the functions.php file.

    Thanks

    broheim
    Participant

    Are we looking at the same functions.php? http://smri.io/_/public/01432.png

    I do not see a check to see if this function already exists.

    broheim
    Participant

    I did resolve this myself by simply adding my own filter.
    add_filter( 'the_password_form', 'my_password_form',99);

    Mehmet S.
    Keymaster

    Ok. Good luck.

    broheim
    Participant

    I would still suggest wrapping those functions with if functions exists. I think it is good practice for themes.

    Mehmet S.
    Keymaster

    I think, it is a good practice when you call a core function of WordPress. But, it is my own function defined and over there in the file.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register