Sunday, 15 April 2012

How to check older WordPress versions? -


I want to know how a version establishment is less than some version, we say that I want to know that someone WordPress installation is 3.4 below.

How do I do this?

What's important here is that anything like a version 4.1.1 , which is not float.

How do I check whether the version current version 4.1.1 ?

   

bloginfo ('version') returns the WordPress version.

So depending on your comments, what can you do in this specific case

$ wp_version = bloginfo ('version'); $ Wp_version = substr ('$ wp_version', 0, 2); & Lt; - $ wp_version_num = get the X.x points to compare floatval ($ wp_version); If ($ wp_version_num & lt; = 3.4) {echo "minimize"; } And {echo "big"; }

What I did here, the string had cut it down to a decimal and then turned it into a float as you wanted.


No comments:

Post a Comment