WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Pre Set Settings Idea

[Resolved] Pre Set Settings Idea

  • Sorry if this is the wrong place for this, I don’t see where feature requests would go, neither could I find an email.

    Since this plugin is super useful for theme developers, why not make it so that settings can be imported, or pre-set for a theme? Meaning, make it so I can hard code in the options in the settings > responsive images area in my theme. (I use a plugin auto installer on theme installation, TGMPA to be exact, and I might make my own.)

    Maybe a warning that can be put up by theme developers to the user not to change things unless the user knows what they’re doing, and making the defaults button set it back to the theme’s pre-set settings?

    It would be a great feature IMO, and it would be even more complete than it already is.

    (Also, does this work locally, meaning would it work on localhost on my windows computer?)

    http://wordpress.org/extend/plugins/pb-responsive-images/

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’ll just add to this question, it’s not working on localhost on windows, but it should work on any linux hosting right? Are there any file permissions I should keep in mind if it doesn’t work then either? (uploading to free hosting now for checking purposes.)

    ^ NEVER MIND the above post, so sorry, it’s working on localhost. -_-

    Plugin Author Jacob Dunn

    @spacemanspud

    Heh – you should be good to go on all points in the thread, actually ^_^

    If you want to manually set options for this plugin in your theme, all you have to do is specify them via the RIP::set_options($options); method.

    Example:

    $formats = array(
       array("media"=>"" ,"query"=>"w368","fallback"=>true),
       array("media"=>"(min-device-pixel-ratio:2)" ,"query"=>"w736"),
       array("media"=>"(min-width:420px)" ,"query"=>"w833"),
       array("media"=>"(min-width:420px) and (min-device-pixel-ratio:2)" ,"query"=>"w1000"),
       array("media"=>"(min-width:885px)","query"=>"w1000"),
    );
    
    RIP::set_options($formats);

    There’s also a RIP::reset_options(); function, if you’d like to reset settings to what’s in the admin, similar to how wp_reset_query() resets the query after a custom loop.

    However, if you want to disable the admin page, the following code should do the trick:

    $config = RIPConfig::get_instance();
    remove_action('admin_menu',array(&$config,'admin_menu'));

    You may have to execute that in the init hook, so keep in that in mind, as I haven’t tested it.

    Let me know if that works!

    **stealth edit: fixed code, syntactical sugar.

    Plugin Author Jacob Dunn

    @spacemanspud

    Also,

    • A.) This is totally the place for feature requests – let me know if you have any other ideas here, contributions are always welcome.
    • B.) I really wish this editor had a preview pane. I edited the crap out of that last message post publish – so ignore whatever you may have seen in the notification email… 😀

    Enjoy!
    Jake

    Thanks for the quick reply and the awesome plugin!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Pre Set Settings Idea’ is closed to new replies.