save_post hook – headers already sent?

Saving post doesn’t just happens. Either you are submitting a form or ajax request, which spins up new copy of WP core, which does the saving. Typically that process isn’t meant to produce output and isn’t handling it accordingly. Depending on what you want to accomplish you will have to either use pure JavaScript for … Read more

Manually return false for function_exists

Have your function return your HTML rather than echo it. Perform the logic in the function to see if the image/logo are present and only return the HTML if that’s the case, otherwise returning null/false. function my_header_function( $output = false ) { if ( /*image and logo have been uploaded */ ) { $output = … Read more

WordPress HTML Helper

The short answer is that there isn’t one. WordPress templating consists mostly of raw PHP and Template Tags API. The API is more focused on outputting specific content, than producing specific HTML. As result the technique is pretty much unknown in WordPress development. It doesn’t mean that you can’t use one, but it’s just not … Read more

add hook restricted only to either plugins or themes?

Errm, you can’t. And more importantly, why would you want to? The whole point of hooks is to open up an API to other developers! You can use a singleton/static flags and/or private methods (called from a hooked public method) if you want to lock down how your plugin can be manipulated. static function myfunction_for_themes() … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)