bbp_filter_modify_page_title

Add the topic title to the if viewing a single group forum topic.</p> </section> <section id="description"><h2>Description</h2><pre><div><em>(string)</em> bbp_filter_modify_page_title( <span class="param">(string)</span> <a href="#" class="param" data-type="(string) " data-desc="The title to filter." data-depr="" data-opt="1" title="The title to filter.">$new_title = ''</a>, <span class="param">(string)</span> <a href="#" class="param" data-type="(string) " data-desc="The old title." data-depr="" data-opt="1" title="The old title.">$old_title = ''</a>, <span class="param">(string)</span> <a href="#" class="param" data-type="(string) " data-desc="The separator to use." data-depr="" data-opt="1" title="The separator to use.">$sep = ''</a> ); </div></pre></section> <section id="returns"><h2>Returns <span class="count">(string)</span></h2><p>The possibly modified title</p> </section> <section id="params"><h2>Parameters <span class="count">(3)</span></h2><dl><dt> <span class="index">0.</span> <span class="param"> $new_title </span> — Optional. <span class="type">(string)</span> => <code>''</code></dt><dd> The title to filter</dd><dt> <span class="index">1.</span> <span class="param"> $old_title </span> — Optional. <span class="type">(string)</span> => <code>''</code></dt><dd> The old title.</dd><dt> <span class="index">2.</span> <span class="param"> $sep </span> — Optional. <span class="type">(string)</span> => <code>''</code></dt><dd> The separator to use</dd></dl> </section><hr /> <section id="usage"><h2>Usage</h2><pre><ol><li><div>if ( !function_exists( '<span class="func">bbp_filter_modify_page_title</span>' ) ) { </div></li><li><div> require_once ABSPATH . PLUGINDIR . 'bbpress/includes/extend/buddypress/functions.php'; </div></li><li><div>} </div></li><li><div>  </div></li><li><div><span class="comment">// The title to filter</span> </div></li><li><div><span class="param">$new_title</span> = ''; </div></li><li><div>  </div></li><li><div><span class="comment">// The old title.</span> </div></li><li><div><span class="param">$old_title</span> = ''; </div></li><li><div>  </div></li><li><div><span class="comment">// The separator to use</span> </div></li><li><div><span class="param">$sep</span> = ''; </div></li><li><div>  </div></li><li><div><span class="comment">// NOTICE! Understand what this does before running.</span> </div></li><li><div><span class="param">$result</span> = <span class="func">bbp_filter_modify_page_title</span>(<span class="param">$new_title</span>, <span class="param">$old_title</span>, <span class="param">$sep</span>); </div></li><li><div>  </div></li></ol></pre></section><hr /> <section id="defined" class="source"><h2>Defined <span class="count">(1)</span></h2><p>The function is defined in the following location(s).</p><dl><dt><strong><a href="http://hookr.io/plugins/bbpress/2.5.9/files/includes-extend-buddypress-functions/" class="file">/includes/extend/buddypress/functions.php <span> </span></a></strong></dt><dd><pre><ol data-line="26" class="block" start="116"><li><div>function bbp_filter_modify_page_title( $new_title = '', $old_title = '', $sep = '' ) { </div></li><li><div> </div></li><li><div> // Only filter if group forums are active </div></li><li><div> if ( <a href="http://hookr.io/plugins/bbpress/2.5.9/functions/bbp_is_group_forums_active/" data-id="702438" title="bbp_is_group_forums_active" class="function">bbp_is_group_forums_active</a>() ) { </div></li><li><div> </div></li><li><div> // Only filter for single group forum topics </div></li><li><div> if ( bp_is_group_forum_topic() || bp_is_group_forum_topic_edit() ) { </div></li><li><div> </div></li><li><div> // Get the topic </div></li><li><div> $topic = get_posts( array( </div></li><li><div> 'name' => bp_action_variable( 1 ),  </div></li><li><div> 'post_status' => 'publish',  </div></li><li><div> 'post_type' => <a href="http://hookr.io/plugins/bbpress/2.5.9/functions/bbp_get_topic_post_type/" data-id="704258" title="bbp_get_topic_post_type" class="function">bbp_get_topic_post_type</a>(),  </div></li><li><div> 'numberposts' => 1 </div></li><li><div> ) ); </div></li><li><div> </div></li><li><div> // Add the topic title to the <title> </div></li><li><div> $new_title .= <a href="http://hookr.io/plugins/bbpress/2.5.9/functions/bbp_get_topic_title/" data-id="704274" title="bbp_get_topic_title" class="function">bbp_get_topic_title</a>( $topic[0]->ID ) . ' ' . $sep . ' '; </div></li><li><div> } </div></li><li><div> } </div></li><li><div> </div></li><li><div> // Return the title </div></li><li><div> return $new_title; </div></li><li><div>} </div></li></ol></pre></dd></dl> </section> </article></div><div id="sidebar"><ul class="widgets"><li> <a href="http://hookr.io/plugin/"><img src="http://hookr.io/wp-content/themes/hookr/assets/images/plugin-download.jpg" /></a></li><li id="versions"><dl><dt>Version(s)</dt><dd><dl><dt>Others</dt><dd><ul><li><a href="http://hookr.io/plugins/bbpress/2.5.9/functions/bbp_filter_modify_page_title/" class="active">2.5.9</a></li><li><a href="http://hookr.io/plugins/bbpress/2.5.8/functions/bbp_filter_modify_page_title/" class="">2.5.8</a></li><li><a href="http://hookr.io/plugins/bbpress/2.5.7/functions/bbp_filter_modify_page_title/" class="">2.5.7</a></li><li><a href="http://hookr.io/plugins/bbpress/2.5.6/functions/bbp_filter_modify_page_title/" class="">2.5.6</a></li><li><a href="http://hookr.io/plugins/bbpress/2.5.5/functions/bbp_filter_modify_page_title/" class="">2.5.5</a></li></ul></dd></dl></dd></dl></li><li id="tags"><dl><dt>Tags</dt><dd><ul><li><span></span>plugin</li><li><span></span>function</li><li><span></span>bbp_filter_modify_page_title</li><li><span></span>bbPress</li><li><span></span>2.5.9</li></ul></dd></dl></li></ul></div></div></div><script>Hookr.View.init();Hookr.Single.init();</script><footer><div><ul id="nav-social" class="pivot" role="navigation"><li id="twitter"><a href="http://twitter.com/hookr_io" title="Follow me!"></a></li></ul><div> © 2018 hookr.io <strong>(beta)</strong> | <a href="http://hookr.io/privacy/" title="Privacy">Privacy</a> | Proudly Powered by WordPress</div></div> </footer><script type="text/javascript" src="http://hookr.io/wp-content/cache/minify/000000/M9EvL9BNzU1KTdHLzcwDAA.js"></script><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create','UA-49583310-1','hookr.io');ga('send','pageview');</script></body></html>