@clivesmith
If you fine with code, then this is how I would go about it
1. create a split in topic & replies, so you have a place to put the ‘featured reply’
Use this piece of code in your functions file
bbp_show_lead_topic
2. then you’ll need a flag for the featured reply.
This code does an ‘advert’ flag for a topic, but has much of the code you’d need to do a flag for a reply to show it is featured – I’ll leave you to work out which bits you’ll need, but the key is the hook to
add_action( 'bbp_theme_before_topic_form_submit_wrapper', 'at_checkbox' );
change this to
add_action( 'bbp_theme_before_reply_form_submit_wrapper', 'at_checkbox' );
amend the references from topic to reply
and add some if(bbp_keymaster() ) to make it only show for you, and you will be most of the way there
// show the "Mark if it is an advert" checkbox on topic form
add_action( 'bbp_theme_before_topic_form_submit_wrapper', 'at_checkbox' );
function at_checkbox() {
// Text for the topic form
global $topic_advert_text ;
?>
<p>
<input name="at_advert" id="at_advert" type="checkbox"<?php checked( '1', at_is_advert( bbp_get_topic_id() ) ); ?> value="1" tabindex="<?php bbp_tab_index(); ?>" />
<?php if ( bbp_is_topic_edit() && ( get_the_author_meta( 'ID' ) != bbp_get_current_user_id() ) ) : ?>
<label for="at_advert"><?php echo '<span class="dashicons dashicons-awards"></span>'.$topic_advert_text.'</label>' ;?>
<?php else : ?>
<label for="at_advert"><?php echo '<span class="dashicons dashicons-awards"></span>'.$topic_advert_text.'</label>' ;?>
<?php endif; ?>
</p>
<?php
}
//check if topic is advert
function at_is_advert( $topic_id = 0 ) {
$retval = false;
if ( ! empty( $topic_id ) ) {
$retval = get_post_meta( $topic_id, 'at_topic_is_advert', true );
}
return (bool) apply_filters( 'at_is_advert', (bool) $retval, $topic_id );
}
// save the advert state
add_action( 'bbp_new_topic', 'at_update_topic' );
add_action( 'bbp_edit_topic', 'at_update_topic' );
//update topic
function at_update_topic( $topic_id = 0 ) {
if( isset( $_POST['at_advert'] ) )
update_post_meta( $topic_id, 'at_topic_is_advert', '1' );
else
delete_post_meta( $topic_id, 'at_topic_is_advert' );
}
3. amend content-single-topic-lead.php in your child theme’s bbpress directory.
by
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/content-single-topic-lead.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/content-single-topic-lead.phpbbPress will now use this template instead of the original and you can amend this
This then you can use to add some code
if (at_is_advert( $reply_id )) then….. display this reply
and you should be there
so
the reply form will show a checkbox to make a reply featured available only to say keymaster, and as keymaster you can edit a topic to make it a featured
the content_single_topic_lead will check if a reply is featured and then show it if it is
I wish I had the time to code this all for you, but please if you do work oyt some code, post back here for other to benefit