Support » Themes and Templates » Disable Theme Activation if WP Version is lower than 3.5

  • Note: Im a starter in wordpress development but have some PHP knowledge.

    Hi there,

    Currently i’m building a wp theme from scratch.
    I used some functions that only works after version 3.5.

    I could give the user a message in the dashboard that the current theme is not working on the WP version the user used. But want to do it in a different way if possible.

    The question:
    Is it better to disable the activation if the version is lower than 3.5, or just give a error message when the theme is activated on an incompatible WP version?

    If disable activation is an option, where do i need to start to make such a function like:
    When a user activates it.
    The activation will fail.
    Give an error message and reactivate the last activated theme..

    *going back to Google and search further 😉

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Hendrikx

    (@cahe)

    hmm. Cannot edit my last post?? Then i will dubble post 😛

    Now im solving it with an error message in the backend and load another page on the wp frontend, but hope that someone knows an awnser to previous question….

    Thread Starter Hendrikx

    (@cahe)

    Hmm its not a difficult question 😉

    I solved it in the backend with:

    if ( $wp_version < $version_needed ) {
    // add_action(load_error_stuff)
    } else {
    // add_action(load_stuff)
    }

    On the frontend with my compatibility_check function that loads an error_fronpage that shows messages of the errors when user can edit theme options.

    For now solved but again: Is there a better way to do this?

    I dont want that people break there database if its not compatible..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable Theme Activation if WP Version is lower than 3.5’ is closed to new replies.