WordPress.org

Support

Support » Plugins and Hacks » Custom Content Type Manager » [Resolved] MySql fields to Placeholders

[Resolved] MySql fields to Placeholders

  • 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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor fireproofsocks

    @fireproofsocks

    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.”

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

    Plugin Contributor fireproofsocks

    @fireproofsocks

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] MySql fields to Placeholders’ is closed to new replies.
Skip to toolbar