Add information above a custom post type listing of all posts page

You can use the admin_notices action for that: function wpa_admin_notice() { $screen = get_current_screen(); if( ‘your_post_type’ == $screen->post_type && ‘edit’ == $screen->base ){ ?> <div class=”updated”> <p>Here is some text</p> </div> <?php } } add_action( ‘admin_notices’, ‘wpa_admin_notice’ ); Change your_post_type to whatever your custom post type slug is. Also see get_current_screen for more info on … Read more

How to modify an add_action() inside a loop of core function

Use the filter hook bp_members_signup_error_message Try: function signup_error_change( $error_message ) { $error_message = str_replace(‘<div class=”error”>’, ‘<span class=”val-error”>’, $error_message); $error_message = str_replace(‘</div>’, ‘</span>’, $error_message); return $error_message; } add_filter(‘bp_members_signup_error_message’, ‘signup_error_change’, 1, 1);

First hook to use current page post id

Answer by @Pieter Goosen : If you need to update the page before the main query fires and returns the page object, you will manually need to parse the URL (probably on init) and get the page ID from get_page_by_title() or get_page_by_path(). Otherwise, ‘wp’ would be earliest hook to get the page ID, for example: … Read more

Disable email field on WooCommerce customer account details

You can do it by adding this code to functions.php: function custom_override_checkout_fields( $fields ) { unset($fields[‘billing’][‘billing_email’]); return $fields; } add_filter( ‘woocommerce_checkout_fields’ , ‘custom_override_checkout_fields’, 1000, 1 ); But it is wrong approach, since WooCommerce uses email to notify user about status of the order.

How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks

WordPress doesn’t execute all the actions and filters (i.e. hooks) at the same time using some sort of priority, instead, execution order of these action and filter hooks are hard coded within WordPress core PHP files. Within WordPress source CODE, search for the following four function calls (using any text editor’s find in files feature): … Read more

Passing data between two hooks in separate HTML requests

It’s not possible to pass data from one HTTP request to another one on the fly. Once the script is finished, the data will be discarded. What you can do is to store the data in a transient, and then retrieve it later. Here’s a simple example using set_transient(): set_transient( ‘my_transient’, $data, 1 * HOUR_IN_SECONDS … Read more

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