Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

  • devonc01
    Participant

    @devonc01

    In reply to my above situation, I went to the WordPress Codex page which lists all the hooks available to developers. On this page, you can see a listing of things used as the first parameters for the add_filter('hook','your functions to run on that hook') method.

    There was an example listed in that Codex that referenced exactly what I was trying to accomplish, namely, removing ‘Private: ‘ from private forum titles.

    Below is the code that I am using now, it strips ‘Private:’ as well as leaving my profile page without any of the wierd markup that the previous code was using (note the previous code was from a post in ’09, so things likely changed since then):

    /* Removing private prefix from post titles */ 
    
     
    function spi_remove_private_protected_from_titles( $format ) {
    	return '%s';
    }
    add_filter( 'private_title_format',   'spi_remove_private_protected_from_titles' );

    devonc01
    Participant

    @devonc01

    I resolved this issue, but another remains:

    Yesterday, I was getting frustrated with the bbPress (a forum plugin for WordPress), because when I’d have a private forum, instead of it just being an attribute, it prepended ‘Private: ‘ before every forum.

    In my attempt to resolve this issue, I found a similar thing to what JSHelp referenced in this Stack Overflow Post: a code that would be located in the theme’s (my theme was Twenty-Fourteen) functions.php file.

    My attempt to resolve THAT issue, led to THIS issue (where we have HTML code being converted to non-code text on the buddyPress profile page).

    On removing the code from function.php, the issue fixed itself.

    However, I am unsure why these two interact in the way that they do, below is the code I added and later commented out:

    function the_title_trim($title) {
    	// Might aswell make use of this function to escape attributes
    	$title = attribute_escape($title);
    	// What to find in the title
    	$findthese = array(
    		'#Protected:#', // # is just the delimeter
    		'#Private:#'
    	);
    	// What to replace it with
    	$replacewith = array(
    		'', // What to replace protected with
    		'' // What to replace private with
    	);
    	// Items replace by array key
    	$title = preg_replace($findthese, $replacewith, $title);
    	return $title;
    }
    add_filter('the_title', 'the_title_trim');

    devonc01
    Participant

    @devonc01

    Hey There,

    I too am receiving this same error, here’s the line of code in my source for that generated page that references the issue (note, names and actual IP have been removed since it’s just local):

    
    [line 122]...
    <article id="post-0" class="post-0 bp_members type-bp_members status-publish hentry">
    <header class="entry-header">
    <h1 class="entry-title">
    <a href=&quot;http://local-ip/wordpress/members/NAME/&quot;>NAME</a>
    </h1>
    </header>
    <!-- .entry-header -->
    <div class="entry-content">
    [line 126]...

    I’m looking into fixing this as well, will post a reply if/when I discover what is causing the issue!

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar