Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author cageehv

    (@cageehv)

    Hey Rob,

    Thanks for the feedback!

    I’ll look into it soon.

    peace,
    Rolf

    Thread Starter Matt Robinson

    (@mattyrob)

    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.

    Plugin Author cageehv

    (@cageehv)

    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

    Thread Starter Matt Robinson

    (@mattyrob)

    @rolf

    Thanks for the rapid update. Glad you found the feedback useful.

    (Matt) ??

    Plugin Author cageehv

    (@cageehv)

    Oops,

    Okay, so, thanks Matt! ??

    peace,
    Rolf

    Thread Starter Matt Robinson

    (@mattyrob)

    @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' );
    Plugin Author cageehv

    (@cageehv)

    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

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Ability to disable on mobile devices’ is closed to new replies.