get_terms on save_post hook

You’re on the right track. When you do something like this in a form.. <input name=”tax_input[formats][]” /> You create levels in the $_POST array. So you’d get the formats array like this… <?php $formats = $_POST[‘tax_input’][‘formats’]; Full example… <?php add_action(‘save_post’, ‘wpse74017_save’); function wpse74017_save($post_id) { // check nonces and capabilities here. // use a ternary statement … Read more

How to check what kind of saving it is?

There are hooks specifically for this, actually. The codex has a pretty good overview. Essentially every time WordPress saves a post (which it does through wp_insert_post) or alters the status of the post, it calls wp_transition_post_status which looks like this: <?php // in wp-includes/post.php function wp_transition_post_status($new_status, $old_status, $post) { do_action(‘transition_post_status’, $new_status, $old_status, $post); do_action(“{$old_status}_to_{$new_status}”, $post); … Read more

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