is_plugin_active function doesn’t exist

That’s because the file in which is_plugin_active() is defined – wp-admin/includes/plugin.php – is only loaded in the admin, after your plugin is loaded. Thus, you can only call it after ‘admin_init’ has fired: function check_some_other_plugin() { if ( is_plugin_active(‘some-plugin.php’) ) { … } } add_action( ‘admin_init’, ‘check_some_other_plugin’ );

Adding Custom Text Patterns in the WP 4.5 Visual Editor

Here’s a way to test the core patch #33300.6 by Andew Ozz, through a test plugin in WP 4.5.2, to try out the text pattern filter. Demo Here’s a strikethrough example using ~ $init[‘wpsetextpattern_inline_patterns’] = ‘{ strong: { start: “*”, end: “*”, format: “bold” }, strong2: { start: “**”, end: “**”, format: “bold” }, em: … Read more

How to add an admin notice upon post save/update

The reason this doesn’t work is because there is a redirection happening after the save_post action. One way you can acheive want you want is by implementing a quick work around using query vars. Here is a sample class to demonstrate: class My_Awesome_Plugin { public function __construct(){ add_action( ‘save_post’, array( $this, ‘save_post’ ) ); add_action( … Read more

How do I add CSS options to my plugin without using inline styles?

Use wp_register_style and wp_enqueue_style to add the stylesheet. DO NOT simply add a stylesheet link to wp_head. Queuing styles allows other plugins or themes to modify the stylesheet if necessary. Your stylesheet can be a .php file: wp_register_style(‘myStyleSheet’, ‘my-stylesheet.php’); wp_enqueue_style( ‘myStyleSheet’); my-stylesheet.php would look like this: <?php // We’ll be outputting CSS header(‘Content-type: text/css’); include(‘my-plugin-data.php’); … Read more

Is there any plugin development framework

AFAIK, there’s no official/standard framework, and there will be as many plugin development styles as there are shades of white in north pole. I’d say WordPress Coding Standards is a blueprint for a good style. You’ll find lots of good examples and excellent coders here in WPSE. A nice starting point: questions/tagged/plugin-development. Highlighting: Objective Best … Read more

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