Can anyone help me figure this out??

  • Anonymous


    I know it’s not Graphene specific… but I was hoping someone out there might be able to help me with this final piece of the puzzle. (I get so fed up over on the wordpress forums… sigh)

    Here is the code:

    function jwl_tinycolor_css_callback_function() {
    $options = get_option('jwl_tinycolor_css_field_id');
    $items = array("Default", "Pink", "Green");
    echo "<select id='tinycolor' name='jwl_tinycolor_css_field_id[tinycolor]'>";
    foreach($items as $item) {
    $selected = ($options['tinycolor']==$item) ? 'selected="selected"' : '';
    echo "<option value='$item' $selected>$item</option>";
    echo "</select>";

    The code displays the dropdown on my settings page, populates it with the values, and saves the selection. Awesome!!

    The problem:

    How do I extract a single value and assign it to a variable? Basically I am running a stylesheet selector from within my plugin admin page. I would like to have three variables.. $default, $pink, and $green… for example. Then, I’m going to run it through an if/else statement to display the different stylesheets.

    Sooo, can anyone help me find out how to isolate these values, and assign them to a variable I can use?

    Thanks so much!!

Viewing 1 post (of 1 total)

  • You must be logged in to reply to this topic.