bp_get_directory_title

Get the directory title for a component.

Description

(string) bp_get_directory_title( (string) $component = '' ); 

Used for the element and the page header on the component directory page.</p> </section> <section id="returns"><h2>Returns <span class="count">(string)</span></h2> </section> <section id="params"><h2>Parameters <span class="count">(1)</span></h2><dl><dt> <span class="index">0.</span> <span class="param"> $component </span> — Optional. <span class="type">(string)</span> => <code>''</code></dt><dd> Component to get directory title for.</dd></dl> </section><hr /> <section id="usage"><h2>Usage</h2><pre><ol><li><div>if ( !function_exists( '<span class="func">bp_get_directory_title</span>' ) ) { </div></li><li><div> require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-template.php'; </div></li><li><div>} </div></li><li><div>  </div></li><li><div><span class="comment">// Component to get directory title for.</span> </div></li><li><div><span class="param">$component</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">bp_get_directory_title</span>(<span class="param">$component</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/buddypress/2.8.2/files/bp-core-bp-core-template/" class="file">/bp-core/bp-core-template.php <span> </span></a></strong></dt><dd><pre><ol data-line="26" class="block" start="137"><li><div>function bp_get_directory_title( $component = '' ) { </div></li><li><div> $title = ''; </div></li><li><div> </div></li><li><div> // Use the string provided by the component. </div></li><li><div> if ( ! empty(buddypress)->{$component}->directory_title ) ) { </div></li><li><div> $title =buddypress)->{$component}->directory_title; </div></li><li><div> </div></li><li><div> // If none is found, concatenate. </div></li><li><div> } elseif ( isset(buddypress)->{$component}->name ) ) { </div></li><li><div> $title = sprintf( <a href="http://hookr.io/plugins/buddypress/2.8.2/functions/__/" data-id="1123623" title="__" class="function">__</a>( '%s Directory', buddypress ),buddypress)->{$component}->name ); </div></li><li><div> } </div></li><li><div> </div></li><li><div> /** </div></li><li><div> * Filters the directory title for a component. </div></li><li><div> * </div></li><li><div> * @since 2.0.0 </div></li><li><div> * </div></li><li><div> * @param string $title Text to be used in <title> tag. </div></li><li><div> * @param string $component Current componet being displayed. </div></li><li><div> */ </div></li><li><div> return <a href="http://hookr.io/plugins/buddypress/2.8.2/functions/apply_filters/" data-id="1123143" title="apply_filters" class="function">apply_filters</a>( <a href="http://hookr.io/plugins/buddypress/2.8.2/filters/bp_get_directory_title/" data-id="1122895" title="bp_get_directory_title" class="filter">'bp_get_directory_title'</a>, $title, $component ); </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>Since</dt><dd> 2.0.0</dd><dt>Others</dt><dd><ul><li><a href="http://hookr.io/plugins/buddypress/2.8.2/functions/bp_get_directory_title/" class="active">2.8.2</a></li><li><a href="http://hookr.io/plugins/buddypress/2.8.1/functions/bp_get_directory_title/" class="">2.8.1</a></li><li><a href="http://hookr.io/plugins/buddypress/2.8.0/functions/bp_get_directory_title/" class="">2.8.0</a></li><li><a href="http://hookr.io/plugins/buddypress/2.7.5/functions/bp_get_directory_title/" class="">2.7.5</a></li><li><a href="http://hookr.io/plugins/buddypress/2.7.4/functions/bp_get_directory_title/" class="">2.7.4</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>bp_get_directory_title</li><li><span></span>BuddyPress</li><li><span></span>2.8.2</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>