• js

    (@jamisoloman)


    Hi there,

    I am starting to use this plugin and I have a few suggestions for improvement:

    1. Options to set what role/level can update this – my clients have editor and author access and I would like to set that only the editor can update.

    2. If you implement suggestion 1 – please make a new menu item so it’s not a submenu of the settings

    3. It would be good to see an option to display the title and the value.

    4. Last one – Can you add the php code into the options page (either the actual code on each line so we can copy/paste or at the bottom where we can replace the ‘name’) this will help not having to go to the wordpress page to copy it each time!

    Thanks:)

    Jami

    http://wordpress.org/extend/plugins/custom-options/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter js

    (@jamisoloman)

    One more (sorry!) The ability to add an icon as well as a value. For example with a phone number, I’d like to upload my own icon to display as well.

    Thanks!

    Plugin Author Jacob Guite-St-Pierre

    (@jacobgsp)

    Hi jam,

    1. I added a filter allowing you to decide what is the capability allowed to use Custom Options. The default capability is ‘manage_options’ meaning that only Administrators can change Custom options. Here is an example of code to put in functions.php if you wish to change the default capability to Editors:

    function custom_options_capability($capability) {
    	return 'publish_pages';
    }
    add_filter('gsp_custom_options_capability', 'custom_options_capability');

    The full list of capabilities can be found here: http://codex.wordpress.org/Roles_and_Capabilities

    2. I’m not sure what you mean by “a new menu item so it’s not a submenu of the settings”. However, the true focus of this plugin is for people where I work to quickly create options that can be used in the theme and then customized by the client in the admin. Since role and capability management is not the focus of this plugin, I doubt I will consider doing more than creating filters to allow for more flexibility.

    3. I just added a new parameter so you can now use get_custom_option( $slug [, $default_value, $field ] ) and specify either “value” or “label” for the $field. The parameters $default_value and $field are optional.

    4. If you click the “Help” button in the top right corner you will see a description and examples of code.

    5. If you want to use an icon, here is the proper way to do it:

    <?php
    $value = get_custom_option('slug');
    if (!empty($value):
      echo '<div class="option">' . $option . '</div>';
    endif;
    ?>

    That way you can test if the value is empty and add the icon by CSS background on the div containing the value.

    Hope that helps!

    [Please post code or markup snippets between backticks or use the code button.]

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

The topic ‘[Plugin: Custom Options] Suggestion for Improvements’ is closed to new replies.