Output pure JSON wordpress

You will want to have your own url structure to output your “non html” output. Actually there are several ways, and it might be up to coding style preference to select one Add a Page and a template for the page that does what you need. You don’t have to output any html even in … Read more

The plugin generated xxx characters of unexpected output during activation

Anything outside the <?php ?> tags will be echoed as output since it has no conditions. The fastest way is to wrap in a function and output in the footer. add_action(‘wp_footer’,’custom_random_script’); function custom_random_script() { echo ‘<script> ……SCRIPT CONTENTS…… </script>’; } There is nothing technically wrong with outputting the script inside your existing function either, it … Read more

map urls to plugins

The general implementation of such “pretty” permalinks in WordPress is realm of WP Rewrite. However it is pretty wide topic and low level code is a bit of abomination. I would say these are three most common techniques for it, complexity ascending: Use WordPress native data structures (such as Custom Post Types and/or Taxonomies) and … Read more

Place max_execution_time in plugin [closed]

yes you can, but this will be applied to all the requests to the site which might actually bring it down if you have some infinite loop somewhere. A better way to do it is to find an action that is being used specifically in the upload process and call it only for that action.

wordpress plugin | short code issue

Without seeing your code it is impossible to be sure, but my guess is that you’re echoing the output of your shortcode instead of returning it. function my_shortcode($atts){ //do shortcode logic echo $result; //This is wrong and would do what you describe. } function my_shortcode($atts){ //do shortcode logic return $result; //This is what you should … Read more

save_post hook is not working after changing priority

Remove the hook at its priority, then add your own at the same place. Use the code (as you seem to have) implicitly and all should go well. Without knowing where the hook is added, you’ll want to check on that price as well (plugins_loaded, etc).