Why does this fail: Disabling plugins enqueue_script() in functions.php

You have two issues here: Conditional tags (is_single()) should not be used so early in functions.php. Your removal function is getting hooked to run after function it’s meant to remove. It should be something like this: function remove_shc() { if ( is_single( array( 17, 19, 1, 11 ) ) ) remove_action( ‘wp_print_scripts’, ‘wp_shc_head_scripts’ ); } … Read more

How to parse without changing the characters case (lower and upper) in wordpress the_content?

Kitefr, (this isn’t really a WordPress question, but a php one) but you could usepreg_replace_callback, in which you define your own function to handle the the replacement. For instance, $text = “The quick brown fox jumped over the Quick dog.”; $text = preg_replace_callback( “/quick/si”, ‘my_replace’ , $text ); function my_replace($matches){ return ‘<strong>’.$matches[0].'</strong>’; } This replaces … Read more

PHP Fatal error when using plugin_basename

I’ve encountered this issue a few times before. It’s a simple matter of adding this to the top of your plugin beneath the comments block. It appears that the way plugin_basename returns the value doesn’t play nicely with much else. $basename = plugin_basename(__FILE__); Then replace this line: define( ‘SEND_INVITATION_PLUGIN_BASENAME’, plugin_basename(__FILE__) ); With this instead: define( … Read more

Loop output for custom plugin [solution found]

The Solution to my problem is to simply let my plugins output run through the do_shortcode()-Function of WordPress as pointed out by this article: Using Shortcodes Everywhere I updated my plugin so it uses shortcodes, too, so now my output looks like this: // Add this upon plugin initialization add_shortcode( ‘dosomethingawesome’, array( &$this, ‘output_callback’) ); … Read more

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