How to write an if statement which reads: ‘if is this custom post type or a child of it do the following’?

I accidentally got the answer: <?php global $post; $the_post_parent = $post->post_parent; $the_post_ID = $post->ID; $cat_posts = get_posts(‘post_type=bbp_forum&posts_per_page=-1’); print_r($post_parent); ?> <?php foreach ( $cat_posts as $post ) : ?> <li <?php if ( $post->ID == $the_post_ID || $post->ID == $the_post_parent ) echo ‘class=”current”‘; ?>> <a href=”https://wordpress.stackexchange.com/questions/13966/<?php the_permalink(); ?>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), … Read more

bbPress plugin – How do I add a forum description?

Are you using the standalone, or the plugin? I’m not sure if there is a difference honestly, I’ve never touched the standalone. Anyway, I have the plugin going From my admin panel I have the option of adding/editing forums/topics/replies Clicking on Add New for forum brings up a standard WP post screen The title is … Read more

phpBB 3 to bbPress

Never mind now. Fortunately (in this case) I have found an alternative solution to bbPress for WordPress – Simple:Press! I personally think that Simple:Press is much better not only because it allowed me to import everything from phpBB very easily but also because it seems much more comprehensive and well put together; – more comparable … Read more

Form validation on user profile edit

I worked it out. add_action( ‘user_profile_update_errors’, ‘validate_steamid_field’ ); function validate_steamid_field(&$errors, $update = null, &$user = null) { if (!preg_match(“/^STEAM_[0-5]:[01]:\d+$/”, $_POST[‘_bbp_steamid’])) { $errors->add(’empty_steamid’, “<strong>ERROR</strong>: Please Enter a valid SteamID”); } }

Where To Find bb_profile_data(); In bbPress?

From this reference you get the following info: Function and Method Cross Reference bb_profile_data() Defined at: /bb-includes/functions.bb-template.php -> line 2405 Referenced 1 times: /bb-templates/kakumei/profile.php -> line 30 so you should check your profile template. If you have ssh access to your site, try # grep “bb_profile_data” -R /the/path/to/your/site/ in the shell command line, to search … Read more

WordPress editor, change code wrap (bbpress?)

put this code in functions.php add_action(‘wp_footer’,’ravs_codeTag_fix’); function ravs_codeTag_fix(){ if ( bbp_use_wp_editor() ) : ?> <script> jQuery(document).ready( function() { /* Use <code> instead of backticks for the Code button in the editor */ if ( typeof( edButtons ) !== ‘undefined’ ) { edButtons[110] = new QTags.TagButton( ‘code’, ‘code’, ‘<code>’, ‘</code>’, ‘c’ ); QTags._buttonsInit(); } }); </script> … Read more