• Resolved noahj-champion

    (@noahj-champion)


    Hi,

    Great plugin!

    I just wanted to send you this concept, maybe you can tweak it a bit, if needed.

    I tried a couple solutions and couldn’t get your plugin asset files to only load on it’s admin pages. Well, I did get one solution, the one that works without fail. So I wanted to provide you that code, because the assets truly only need to load on the plugin admin pages, since the plugin is only used on those pages.

    See the code difference @ https://www.diffchecker.com/d7rj3wbd

    Thoughts?

    https://ww.wp.xz.cn/plugins/media-from-ftp/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    Hi Noahj Champion,

    Thank you for a very meaningful hack.
    It is also available to my other plug-ins. Thank you very much.
    I will issue a modified version in the near future.

    There is an error in the 13 Line.
    False || $ _GET [‘page’] == ‘mediafromftp-seearch-register’
    True || $ _GET [‘page’] == ‘mediafromftp-search-register’

    Thread Starter noahj-champion

    (@noahj-champion)

    Katsushi,

    You’re welcome and thanks for the update!

    There are many other ways you can do this too.

    Here is the main reference link from WP Tuts
    @ http://code.tutsplus.com/articles/quick-tip-conditionally-including-js-and-css-with-get_current_screen–wp-25378

    There are some ideas in there as well. But if you want to know some other methods, some that might suit your personal way of coding better, let me know your email and I will send you some.

    Normally, looking at other plugins you can find other ways.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Code Mod > Loading assets only on the plugin admin pages’ is closed to new replies.