Feature Request:Div renamer
-
Is there any chance you could consider a div renaming feature for the free version?
-
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
You could explain what part of the code to change for those of us who don’t know.
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
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; }
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
I just tried the code and it does not seem to work on my end.
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
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.
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
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?
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
Yes, it did work but for some reason, it messed up the layout?
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
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.
-
This reply was modified 2 years, 8 months ago by
- The topic ‘Feature Request:Div renamer’ is closed to new replies.