WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
summariz post shortcodes to list out array (7 posts)

  1. Pam Blizzard
    Member
    Posted 1 year ago #

    I have a multi-select field called "locations" with two options, Bloomington and Pekin.

    When I use the summarize_post short codes, I put this in the post:

    Location: [+locations+]

    The output looks like this:

    Location: ["Bloomington","Pekin"]

    How do I get rid of the []'s and quotes? I've tried changing the output filter on the field, with no difference. I've looked at the documentation but I'm misssing something somewhere.

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. Pam Blizzard
    Member
    Posted 1 year ago #

    I promise I have looked at the documentation, the codex and I must not be using the right terminology to search. If anyone can point me in the direction I'd be grateful. Thanks.

  3. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    Multi-select fields (or any repeatable fields) store a list of values as a JSON array (for the geeky discussion about why I structured it this way, you can read this: http://code.google.com/p/wordpress-custom-content-type-manager/wiki/CustomFieldsDataStructure)

    The Summarize Posts shortcode is limited in that you can't easily operate on the values -- if you do this via PHP in your template file, you'll have a lot more flexibility.

    The 0.9.6.1 version (currently on the dev branch) does support advanced placeholders that let you use output filters in just this type of scenario. E.g. instead of just using [+locations+], you can operate on that value via an output filter, e.g. [+locations: formatted_list +]

    That functionality is currently in the dev version: http://downloads.wordpress.org/plugin/custom-content-type-manager.zip -- it's stable, but I haven't released it yet because I haven't finished all the documentation yet.

  4. Pam Blizzard
    Member
    Posted 1 year ago #

    Thanks for the response,I appreciate it. I'll give the dev branch version a try.

  5. Pam Blizzard
    Member
    Posted 1 year ago #

    Not sure where to post this, but I got this error when using your dev version:

    Parse error: syntax error, unexpected '}' in C:\Users\Pam\Documents\Websites\prairieland.dev\wp-content\plugins\custom-content-type-manager\includes\functions.php on line 123

    Dreamweaver flags it as well.

  6. Pam Blizzard
    Member
    Posted 1 year ago #

    Sorry, I didn't specify when the error occures:
    When I activate the plugin, I get this:

    Parse error: syntax error, unexpected '}' in C:\Users\Pam\Documents\Websites\prairieland.dev\wp-content\plugins\custom-content-type-manager\includes\functions.php on line 123

  7. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    Line 122 is missing a semi-colon:

    return $data['custom_field_defs'][$fieldname];

    Committed revision 588030.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic