I don’t understand why I need a lower priority to remove an action with a higher priority to make it work

You’re misunderstanding how priority works here somewhat. The priority determines the order that the functions run for a given hook, eg. genesis_entry_header. Priority is not global. When removing an action from a hook you need to use the same priority that the action was originally hooked with. Which you’re doing. You’re adding the action at … Read more

How to remove an action added by a child theme of Genesis

Thanks to Dan that commented with a useful post I found on Google but didn’t read with the required attention, the solution is this: function my_remove() { remove_action( ‘genesis_entry_header’, ‘shq_genestrap_post_meta_categories’, 9 ); } add_action(‘genesis_entry_header’, ‘my_remove’, 8); Using priority 9 in add_action() doesn’t work: I had to set a priority lower than the one used to … Read more

What would cause the ‘wp’ action to fire twice per page (but only once per post) in Firefox only?

Check the source for your page. I’m guessing that your source code includes a <link rel=”next”> in the header, as WordPress injects by default, and Firefox is prefetching the “next” page in order to cache it. Try this to remove that link from your header: remove_action(‘wp_head’, ‘adjacent_posts_rel_link_wp_head’); Found this blog with more details: WordPress rel=”next” … Read more

add action which returns modified value

The things you can change in there are: $secure_cookie = apply_filters(‘secure_signon_cookie’, $secure_cookie, $credentials); Cookie The $credentials for the user_login and user_password1) Example add_action( ‘wp_authenticate’, ‘wpse119273UserCredentials’ ); function wpse119273UserCredentials( $credentials ) { // Make sure to secure that value $credentials[‘user_password’] = ‘foo’; } To generate a secure password, take a look at the function wp_generate_password() and … Read more

Using auth_redirect returns cannot modify header information

It works fine on my localhost as well. The reason it probably doesn’t work on your server is that it’s not using output buffering. Hooking into wp_head means that the page has already started printing to the client’s screen. Meaning auth_redirect‘s use of wp_redirect will fail: the headers have already been sent and you see … Read more

How to remove an action that is added inside a class

I don’t understand any of it but it seems to work just fine. Thank you @Buttered_Toast for mentioning the useful thread. add_action(“init”, function() { global $wp_filter; foreach($wp_filter[“wp”][10] as $id => $filter) { if(is_array($filter[“function”]) && count($filter[“function”]) == 2 && get_class($filter[“function”][0]) == “Post_Views_Counter_Columns” && $filter[“function”][1] == “admin_bar_maybe_add_style”) { remove_action(“wp”, $id); } } }, 99);

wp_logout action not working

pls try below code function remove_user_cookie() { setcookie(“woak”); setcookie(“woai”); } add_action(‘wp_logout’, ‘remove_user_cookie’); apart why you use cookie to storing some value ? suggest you to use session

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