Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Maya

    (@tdgu)

    Hi,
    The free WP Hide provides a way to change anything on the outputted HTML through a programmable filter, for more details and code examples please check at https://wp-hide.com/documentation/wphob_start_callback/

    Thanks

    Thread Starter infernoprime

    (@infernoprime)

    You could explain what part of the code to change for those of us who don’t know.

    Plugin Contributor Maya

    (@tdgu)

    Hi,
    In the above example, you should change the “Powered by WordPress” with the text you need to be removed. For example, if need the phrase “My Custom Plugin” changed to “Disguised” you should use something like this:

    add_filter( 'wp-hide/ob_start_callback', 'custom_ob_start_callback' ); 
            function custom_ob_start_callback( $buffer )
                {
                    
                    $buffer =   str_replace("My Custom Plugin" , "Disguised", $buffer);
                    
                    return $buffer;
                       
                }

    Or if need to remove it altogether, you could use this:

    add_filter( 'wp-hide/ob_start_callback', 'custom_ob_start_callback' ); 
            function custom_ob_start_callback( $buffer )
                {
                    
                    $buffer =   str_replace("My Custom Plugin" , "", $buffer);
                    
                    return $buffer;
                       
                }

    Hope this helps.

    Thanks

    Thread Starter infernoprime

    (@infernoprime)

    I tried your code and it did not work. You said it would work with anything in the HTML? Well I tried changing the div id and it did not work for me. This is what I used

    add_filter( 'wph/ob_start_callback', 'custom_ob_start_callback' ); 
            function custom_ob_start_callback( $buffer )
                {
                    
                    $buffer =   str_replace("<div id="wpforo"> , "<div id="forum"", $buffer);
                    
                    return $buffer;
                       
                }
    Plugin Contributor Maya

    (@tdgu)

    The PHP syntax is incorrect, you code would produce a fatal error. Try this instead:

    add_filter( 'wph/ob_start_callback', 'custom_ob_start_callback' ); 
            function custom_ob_start_callback( $buffer )
                {
                    
                    $buffer =   str_replace('id="wpforo"' , 'id="forum"', $buffer);
                    
                    return $buffer;
                       
                }

    Make sure your HTML actually use double quotes, which I used in the above code.
    I hope this helps.

    Thanks

    Thread Starter infernoprime

    (@infernoprime)

    I just tried the code and it does not seem to work on my end.

    Plugin Contributor Maya

    (@tdgu)

    Hi,
    Once you execute the code, can you check your server error code for any specific message?
    Is the ID value double or single quotes?

    Thanks

    Thread Starter infernoprime

    (@infernoprime)

    I simply copied and pasted what you gave me. I see some but nothing related to this plugin.

    • This reply was modified 2 years, 8 months ago by infernoprime.
    • This reply was modified 2 years, 8 months ago by infernoprime.
    Plugin Contributor Maya

    (@tdgu)

    Hi,
    Try to copy and paste to https://pastebin.com/ a chunk of such HTML to see exactly how the id and its value show up.
    Did you clear your site cache?

    Thanks

    Thread Starter infernoprime

    (@infernoprime)

    I did copy and paste it on pastebin.com and it shows the same. I cleared my browser cache, as well as my wp hide cache. is there anything else I could try that might help shed a clue as to what’s wrong?

    Plugin Contributor Maya

    (@tdgu)

    Hi,
    First, in your code, somehow you missed the full filter name ( which i also take as is ). So that is ‘wp-hide/ob_start_callback’ instead ‘wph/ob_start_callback’ https://wp-hide.com/documentation/wphob_start_callback/

    Secondly, I meant to send the chunk of HTML through pastebin.com so i can view that as well.

    That being said, the code should work just fine. To exclude the quotes issues, you should just ignore those, at least until you see the substitution works just fine:

        add_filter( 'wp-hide/ob_start_callback', 'custom_ob_start_callback' ); 
            function custom_ob_start_callback( $buffer )
                {
                    
                    $buffer =   str_replace('wpforo' , 'forum', $buffer);
                    
                    return $buffer;
                       
                }

    Once you inserted the above code, clear the site cache and check the front side, where you should see the wpforo changed to forum.

    Thanks

    Thread Starter infernoprime

    (@infernoprime)

    Yes, it did work but for some reason, it messed up the layout?

    Plugin Contributor Maya

    (@tdgu)

    Hi,
    Keep in mind that changing arbitrary words on the HTML may break the site layout or/and functionality. The proper way to do that is through the PostProcessing and Replacements on the PRO version that changes those everywhere, in HTML and all site assets (e.g. JavaScript, CSS ). That way everything will work the same as before while removing the traces.

    Thanks

    Thread Starter infernoprime

    (@infernoprime)

    Well I really don’t have the money to spend. It would be nice to have that feature or at least give the free version some features that are comparable to this feature.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Feature Request:Div renamer’ is closed to new replies.