Rolf
Thanks for the response, I managed this on my site with a little hack to your code.
// v1.1.2
if (fttb_is_regular_page())
{ // FRONT END - LOAD JAVASCRIPT FILES
if ( wp_is_mobile() ) { return; } // THIS IS THE NEW BIT
function fttb_fe_scripts()
You may want to expand that into an option, it’s your plugin so I’ll leave it to you to decide but thought I’d share my hack to hopefully save you a little bit of time at least.
Hey Rob(?),
Thanks for your feedback and help!
I decided to add it as a new option in v1.2.0, which I just released.
Enjoy!
peace,
Rolf
@rolf
Thanks for the rapid update. Glad you found the feedback useful.
(Matt) 🙂
@cageehv / Rolf
No problem – I’ve been called worse!
Just a thought, you could add a similar check to the fttb_styles() as the style doesn’t need enqueued on mobile devices if the setting is disabled.
I have done this:
// v1.1.4
function fttb_styles()
{
$fttb_disable_mobile = get_option('fttb_disable_mobile');
if ($fttb_disable_mobile == "Y" && wp_is_mobile()) { return; }
wp_register_style( 'plugin-style', plugins_url('css/float-to-top-button.css', __FILE__) );
wp_enqueue_style( 'plugin-style' );
} // fttb_styles()
add_action( 'init', 'fttb_styles' );
Hey,
Good plan, not loading the style sheets!
I’ve added your change and just released it (v1.2.1).
Thanks for your feedback!
peace,
Rolf