How to call images from your plugins image folder?

Use plugin_dir_url() to get the public URI for the directory where the calling PHP file is. <img src=”https://wordpress.stackexchange.com/questions/60230/<?php echo plugin_dir_url( __FILE__ ) .”images/facebook.png’; ?>”> If the PHP file is in a sub directory of your plugin you have to go up: <img src=”https://wordpress.stackexchange.com/questions/60230/<?php echo plugin_dir_url( dirname( __FILE__ ) ) .”images/facebook.png’; ?>”>

How can I save a multiple select array with the settings API for a plug-in options page?

So, it looks like two things are going on here: echo “<select id=’$id’ style=”width:15em;height:10em;” class=”select$field_class” name=”” . $buddha_option_name . “[$id]” multiple>”; As noted by @Radek, you could have made the name of the select box an array by using [] – e.g. name=”my_option_name[]” – this will result in the filed $_POST[‘my_option_name’] being an array of … Read more

Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?

The flush_rewrite_rules function is reliable in some contexts like a theme or a plugin based on hooks but I’m not sure if it works for a mu-plugin My statement is based on the fact that WordPress is initialized in this way: call the wp-settings.php file call the do_action( ‘muplugins_loaded’ ); hook, here your plugin is … Read more

How can I add an option to the Page Template list from a Plugin?

Filters? Anyone? There’s no filter there to help: page_template_dropdown($template); is used to build the drop down and it’s not filterable. Sneaking into the Templates Array? To build the drop downs contents, the core meta box uses get_page_templates(). From inside, the function looks like the following: $themes = get_themes(); $theme = get_current_theme(); $templates = $themes[$theme][‘Template Files’]; … Read more

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