• Could someone indicate how to retrieve a specific option value from a Plugin which has serialized values.

    For example. A Plugin has a row in the options table “my_plugin_options”.

    It has serialized data but we know the unserialized form is:
    themecolor: red
    sidebarwidth: 300px
    headerimage: apples

    This does not work:

    echo get_option (my_plugin_options_themecolor)

    like it does for non serialized options. I have studied themes and plugins but to no avail.

    Many thanks.

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

    (@cognitions)

    Discovered it through trial and error>

    $my_site_options = get_option('my_site');
    echo( $my_site_options['option_name'] );

    Hope that is useful for someone.

    Hmm. I’m trying to pull serialized data out of custom filed. Would you have any suggestions on how to use this method in that kind of set up?

    http://wordpress.org/support/topic/394398

    using the get_post_meta() just comes back blank:

    <?php
    		$my_grade = get_post_meta($post->ID, 'lesson-type', true);
    		echo( $my_grade['Secondary'] );
    		?>

    Thanks for posting your trial and error findings btw. 🙂

    Nadine

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to get a serialized option’ is closed to new replies.