Is there a hook for when you switch themes?

There is a ‘switch_theme’ action that runs right after the theme is switched. function my_on_switch_theme($new_theme) { $current_themes = wp_get_themes(); /* Fixed deprecated function */ $new_theme_info = $current_themes[$new_theme]; /* $new_theme_info should now be an associative array with the following: $new_theme_info[‘Title’]; $new_theme_info[‘Version’]; $new_theme_info[‘Parent Theme’]; $new_theme_info[‘Template Dir’]; $new_theme_info[‘Stylesheet Dir’]; $new_theme_info[‘Template’]; $new_theme_info[‘Stylesheet’]; $new_theme_info[‘Screenshot’]; $new_theme_info[‘Description’]; $new_theme_info[‘Author’]; $new_theme_info[‘Tags’]; $new_theme_info[‘Theme Root’]; $new_theme_info[‘Theme … Read more

How to implement bulk actions in my plugin?

Unfortunately there isn’t a way of doing this yet, see this trac report. While it would have been possible to add actions to the bulk-actions drop-down menu, there doesn’t exist (yet) a way of handling custom actions. It seems that WordPress deliberately prevents you from adding custom actions (presumably until it’s decided how bulk actions … Read more

Is There A Hook To Process The Content Of The Text Widget?

Filter widget_text (for the text) widget_title (for the title) Example function add_smiley($content) { $new_content=””; $new_content.= $content . ‘:)’; return $new_content; } add_filter(‘widget_text’, ‘add_smiley’); Note that this works only for the content so not if you have a widget with only a title. Reference http://codex.wordpress.org/WordPress_Widgets https://stackoverflow.com/questions/1385954/do-wordpress-widget-or-sidebar-hooks-exist https://stackoverflow.com/search?q=wordpress+widget

Creating a WordPress admin page without a menu for a plugin

I am less convinced that I know what you are doing than I once was. // Add menu and pages to WordPress admin area add_action(‘admin_menu’, ‘myplugin_create_top_level_menu’); function myplugin_create_top_level_menu() { // This is the menu on the side add_menu_page( ‘MyPlugin’, ‘MyPlugin’, ‘manage_options’, ‘myplugin-top-level-page’ ); // This is the first page that is displayed when the menu … Read more

Where can I find a schema of wordpress plugin core architecture?

There is not much to it, really. During the loading of WordPress engine wp-settings.php file is processed. Among other things this files calls wp_get_active_and_valid_plugins() function, that gets list of activated (through admin interface) plugins from active_plugins option (stored in database). For each active plugin its main file (the one holding plugin header) is included and … Read more

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