Posted by Simon Goodchild at June 19th, 2012
From v12.06.23, there are a number of additional filters available to let you add content above WP Symposium content, to display your own content.
For example, the following will display some flags at the top of the profile page that if clicked on will go to specific pages (www.example.com used for the sake of this tutorial).
function my_top_of_page( $html, $uid ) {
$flags = '<div style="float:right">';
$flags .= '<a href="http://www.example.com"><img src="/wp-content/plugins/wp-symposium/tiny_mce/plugins/emotions/img/flag-uk.png" alt="English" /></a> ';
$flags .= '<a href="http://www.example.com"><img src="/wp-content/plugins/wp-symposium/tiny_mce/plugins/emotions/img/flag-france.png" alt="French" /></a> ';
$flags .= '<a href="http://www.example.com"><img src="/wp-content/plugins/wp-symposium/tiny_mce/plugins/emotions/img/flag-german.png" alt="German" /></a> ';
$flags .= '</div>';
return $flags.$html;
}
add_filter( 'symposium_profile_header_filter', 'my_top_of_page', 10, 2);
This is how you would use the other four filters:
add_filter( 'symposium_forum_topic_header_filter', 'my_top_of_page', 10, 2); add_filter( 'symposium_forum_categories_header_filter', 'my_top_of_page', 10, 2); add_filter( 'symposium_group_header_filter', 'my_top_of_page', 10, 2); add_filter( 'symposium_member_header_filter', 'my_top_of_page', 10,1);
The code should be added to your theme’s functions.php file.
The first parameter passed is always the HTML that you want to filter. The remaining parameter(s) are as follows:
| Filter | Parameters |
| symposium_profile_header_filter | ID of the user |
| symposium_forum_topic_header_filter | Topic ID |
| symposium_forum_categories_header_filter | Category ID |
| symposium_group_header_filter | Group ID |
| symposium_member_header_filter | None |
Category: Tutorials




Saving...
Leave a Reply