Support

Php support...

Our Support Desk is where our clients and community come together to find solutions.

0
0

Hi,

This plugin is awesome. :)

If I knew how to code such I would do this myself, so I will submit it to you.

It would be nice if php support was added similar to the body classes.

So, something like…

.firefox-47

in php could be used like…

if ( is_firefox_47( '' ) ) {

     // Then we can run some code here... 

}

Thoughts?

  • Ray
    Hi Noahj – I guess you are talking about the browsers ( https://wordpress.org/plugins/browsers/ ) plugin – in which case what you need to try to do is to create a single is_browsers() function – I’ll post an answer with a suggestion.
  • Noahj Champion
    Ray Q, thanks for the response. Yes I’m talking about that wonderful plugin. :) And that sounds like something I can wrap my head around. I’m newer to php but something like that I can get started with, with a little help. What I was thinking originally was more complicated than running a is_browsers() function. I started to use the mobiledetect platform, but then thought about browsers as browser is already more advanced with more option scope then any of those mobile detect platforms. I would greatly appreciate your suggestion in creating the is_browsers() function.
  • You must to post comments
0
0

Hi,

My bad on the delay, I marked the reply notification emails so I will be sure to get them when they come.

This is bas ass, isn’t it? :)

I tested this out and it is working great.

In testing though, I foresee the issue of having to specify the version and os in the is_browser()
array. I tried something like…

if ( is_browsers( array( "client" => "firefox", "version" => "", "os" => "" ) ) ) {

and something like…

if ( is_browsers( array( "client" => "firefox" ) ) ) {

but that prevented is_browsers from running correctly.

Just off the top, I was thinking maybe some other options like the following would be good….

if ( is_browsers( array( "client" => "firefox", "version" => "any", "os" => "any" ) ) ) {

or…

if ( is_browsers( array( "client" => "firefox", "version" => "all", "os" => "all" ) ) ) {

and perhaps these so Browsers can help target backwards compatibility issues without having to load assets or functions where not needed…

if ( is_browsers( array( "client" => "firefox", "version" => "before_43", "os" => "any" ) ) ) {}
if ( is_browsers( array( "client" => "firefox", "version" => "after_43", "os" => "any" ) ) ) {}

Thoughts?
(NOTE: if you want or it’s more convenient I can post/comment via Github instead. If you want to push it there. Just let me know.)

  • Ray
    Good news that this working for you – and good suggestions, but this is not a function I need, so if you need more changes, you are going to need to get into the code and play :) -feel free to fork the repo on github and submit change requests when you have something working how you want it.
  • Noahj Champion
    Thanks Ray. Will do and appreciate it!
  • You must to post comments
0
0

We added a simple function, which will need some more work, to the development version of this plugin on Github:
https://github.com/qstudio/browsers/blob/master/browsers.php

Here is a simple example of how to use it:

if ( is_browsers( array( "client" => "chrome", "version" => "48", "os" => "windows" ) ) ) {

    // Then we can run some code here... 
    echo( "hell yeh!!" );

}

Please install this version on a test site somewhere and do some testing and let us know.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Why not Search Our Work or Get in Touch