Hook to change Logout url

There’s no need to regenerate the logout URL (the $logout_url part in your code) because the first parameter passed to your function is already the logout URL. So basically, just rename that $force_reauth to $logout_url and remove the $logout_url = wp_nonce_url( … );: function my_custom_logout_url($logout_url, $redirect=null){ // rename the $force_reauth // And remove this: //$logout_url … Read more

How to remove query string from current page URL?

You don’t need $url = “https://”.$_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’]; for getting the current URL to remove the query string. All you need is remove_query_arg(‘the_query’, false). False, means it will use the current URL and your code can be shorten to: function abc_redirections(){ if(isset($_GET[‘query_string’]) || isset($_GET[‘query_string_1’])){ $array = array(); if(isset($_GET[‘query_string’]) && (empty($_GET[‘query_string’]) || !is_numeric($_GET[‘query_string’]) || (is_numeric($_GET[‘query_string’]) && $_GET[‘query_string’] < … Read more

Event Calendar using insert_post_data after save_post and insert_post after post_transition draft_to_schedule

Hi @user2271: I recently had to resolve a situation for an Event custom post type where I could not get WordPress to let me save a future date. I wasn’t trying to be as complex as yours but the follow code resolved my issue, maybe you can use it to resolve yours: add_action(‘admin_init’, ‘yoursite_admin_init’); static … Read more

How to hook into Add New Member in BuddyPress

In order to get the user id when a user is registered, hook into bp_core_signup_user: add_action(‘bp_core_signup_user’, ‘doMyFunction’, 10, 5); function doMyFunction($user_id, $user_login, $user_password, $user_email, $usermeta){ //do stuff } It supplies the user id as the first parameter.

When is the {$new_status}_{$post->post_type} transition hook fired?

It is fired in wp-includes/post.php on line 3026 in the following function: wp-includes/post.php: line 3014-3027 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); do_action(“{$new_status}_{$post->post_type}”, $post->ID, $post); }

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