WordPress.org

Ready to get started?Download WordPress

Forums

Simple Fields
[resolved] Get Simple Fields Field Name or Description (4 posts)

  1. iammary
    Member
    Posted 1 year ago #

    Hello!

    First and foremost, I would like to thank you for this amazing plugin.

    I have one question though. Is there a way that we could pull up the field name or description based on the slug parameter? Just like simple_fields_value(slug) option.

    Thanks again! :)

    http://wordpress.org/extend/plugins/simple-fields/

  2. Pär Thernström
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the kind words. Remember to give it a nice rating if you like it! :)

    And for your question, you could try this:

    // Fetch field info using a method in the simple fields class
    global $sf;
    $field_info = $sf->get_field_by_slug($your_field_slug, $your_fieldgroup_slug);
    
    // Show the output. Somewhere there the description should be...
    print_r($field_info);

    Maybe I should add the field name and description automatically to the output when using Extended Return Values. Probably more users/developers than you who need that info. Anyway, let me know if you get it to work or if you run into any problems!

  3. iammary
    Member
    Posted 1 year ago #

    Hello!

    Thank you for the prompt response. I tested it and it worked! You saved my life! Thanks a lot.

    P.S. Already gave the plugin a 5-star rating.

    Thanks again!!!

  4. sugardaddy
    Member
    Posted 11 months ago #

    Thank you for this trick.
    Actually, I tried it for a checkbox list and this doesn't work.

    Help is appreciated...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.