WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
[resolved] MySql fields to Placeholders (4 posts)

  1. jakat
    Member
    Posted 1 year ago #

    Might come out as a really stupid question, but I'll shoot anyway... Is there a way to configure a [+placeholder+] to display elements from another table in the WP database. Namely, I am using ai1ec to present events. It stores event dates in its own table (under 'start') and it would be great if I could display it in a custom post widget using a placeholder. Possible? Difficult?

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

  2. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    The placeholder approach is just find/replace stuff. So the question confuses me -- how are you retrieving the data? If you're using PHP in your templates, do whatever you want -- print_r is your friend. If you're using a shortcode (e.g. Summarize Posts: http://code.google.com/p/wordpress-custom-content-type-manager/wiki/summarize_posts_shortcode) then you are only querying data in the wp_posts table, not in a custom table. I don't think it does you much good here, but generally the answer is "yes, you can use the CCTM::parse() function to find and replace any placeholders with values contained in a corresponding associative array."

  3. jakat
    Member
    Posted 1 year ago #

    Thanks I will follow your advices although I have already figured a workaround to this issue.

  4. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    Glad you figured a workaround -- sorry I did not fully grasp the problem. You may want to look at my PHP-Snippets plugin: http://wordpress.org/extend/plugins/php-snippets/

    It lets you put PHP into your posts and pages via shortcodes ... maybe you can create the PHP code you need using that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic