What hooks/filters are there to alter selected terms on post save?

It is always ‘save_post’ (or ‘wp_insert_post’ immediately after this). In $_POST[‘tax_input’] you will find all the terms for all taxonomies associated with the current post. Example: ‘tax_input’ => array ( ‘location’ => array ( 0 => ‘0’, ), ), To change the terms you have to call wp_set_post_terms( $post_ID, $tags, $taxonomy ); manually, just changing … Read more

manipulate a plugins shortcode

you could remove_shortcode( ‘nggallery’ ); and then add it again: function put_script_after_nggallery_shortcode( $atts ){ global $nggShortcodes; $nggShortcodes->show_gallery($atts); //or otherwise duplicate the callback function wp_enqueue_script(‘special-ngg-sciprt’, ‘url-to-script’, null, null, true); } add_shortcode( ‘nggallery’, ‘put_script_after_nggallery_shortcode’ ); i’m not sure my show_gallery will work, but seems logical what script do you need to add? why not just wp_enqueue_script on … Read more

Adding dynamic section to WordPress

There are a few approaches to this that could work. If you look around here for questions regarding “virtual pages” you might find some options that could work for you. One quick way to implement this- 1) Create a page under Pages in WordPress admin. This will be the page that’s loaded in the main … Read more

Security around save_post hook

The save_post hook is called every time someone calls the function wp_insert_post(). Plugins do that, unfortunately some themes too, and WordPress itself on several places when … someone uses post per email or XML RPC an auto-draft is created the Quick Draft feature on the dashboard is used a navigation menu item is added a … Read more

Hook to be used when creating a database table

As mentioned, after_switch_theme should be a pretty good choice. Your table create/update function will only run when you switch themes, which should be roughly like activating a plugin. If you use dbDelta to create and/or update the table there should be no issue with table creation. From the Codex: global $wpdb; $installed_ver = get_option( “jal_db_version” … Read more

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