Is there a hook attached to general settings save?

You just need to register_setting() on your setting and it will be saved automatically. See the Settings API for more info. Here’s a complete example: function spw_cb() { if( !($value = get_option(‘sprockets_per_widget’)) ) { $value = 7; } ?> <input type=”text” size=”3″ name=”sprockets_per_widget” value=”<?php echo $value; ?>” /> Numeric only! <?php } function spw_init() { … Read more

How Do I add a redirect rule to WordPress?

adding these functions should do the trick. First things first, add this line to functions.php while you are working on this: add_action(‘init’, ‘flush_rewrite_rules’); What that code will do is constantly flush the rewrite rules, it makes this easier to test while you are working on it, instead of having to go in and manually reset … Read more

Echo simple string in Plugin

A subtle difference between your syntax wp-footershould be wp_footer, underscore _ and not hypthen – add_filter(‘wp-footer’, fahad); // wrong… add_filter(‘wp_footer’, ‘fahad’); // right.. Follow the naming convention of functions: (Codex) Plugin_API: Action_Reference » the wp_footer hook (Codex) Plugin_API: Action_Reference (Codex) Function_Reference

How can I reduce the amount of files loaded/included per plugin?

Previous versions of WordPress didn’t really provide a good means to conditionally enqueue stylesheets and JavaScript within a plugin (i.e. only when needed). So most plugin authors enqueued both on every WordPress init/load, even if the plugin wasn’t being used on a given page. Current versions of WordPress allow for enqueuing later in the flow … Read more

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