(\w+):/", get_asset_html, $text ); return $text; } /* ************************** */ function get_asset_html($matches) { global $post_meta_cache; $postid = $matches[1]; $action = $matches[2]; $out = ''; // get stuff about this post $post = get_postdata($postid); switch( $action ) { case "all": // recursive call to get_asset_html as if called from callback // (mock up args as if coming in as $matches) $title = get_asset_html( array( "", "$postid", "title" ) ); $image = get_asset_html( array( "", "$postid", "image" ) ); $footer = get_asset_html( array( "", "$postid", "footer" ) ); $out .= "$title $image
$footer"; break; case "image": $title = str_replace( '\"', '"', $post["Title"] ); $desc = $post["Content"]; $url_image = $post_meta_cache[$postid]["url_image"][0]; $url_thumb = $post_meta_cache[$postid]["url_thumb"][0]; //$out .= "$title"; $out .= "$title"; break; case "title"; $out .= str_replace( '\"', '"', $post["Title"] ); break; case "footer"; // category and comment links $out .= "
"; $out .= "Tags: " . the_category( ' ', '', false ) . " – "; $out .= comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'), '', 'Comments Off', false ); $out .= "
"; break; } return $out; } /* ************************** */ // Add filters add_filter('the_content', 'expand_image_asset', 4); add_filter('the_excerpt', 'expand_image_asset', 4); add_filter('comment_text', 'expand_image_asset', 4); ?>