Is there a author_update action?

There’s the edit_user_profile_update and personal_options_update actions that runs after a user is updated, with access to the user object. There’s also a variable update_{$meta_type}_meta action that runs when meta of type user is updated.

What hook to use to redirect based on $post

add_action( ‘pre_get_posts’, ‘mytheme_restrict_user_content’ ); function mytheme_restrict_user_content( $query ){ $restricted_post_types = array(‘documentlibrary’, ‘events’); if ( is_main_query() && is_singular($restricted_post_types) && ! is_user_logged_in() ) { $redirect = set_url_scheme(‘http://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]); wp_redirect( wp_login_url($redirect, true) ); exit(); } } I don’t use auth_redirect because that function check if the user is logged in, but we already know that … Read more

hook for loading page

Filter the_content and check if is_page( ‘jobs’ ) is TRUE: add_filter( ‘the_content’, ‘get_scrapy_scraped’ ); function get_scrapy_scraped( $content ) { global $wpdb; if ( ! is_page( ‘jobs’ ) ) return $content; $table_name = $wpdb->prefix . “Careers”; $retrieve_data = $wpdb->get_results( “SELECT * FROM $table_name” ); if ( ! $retrieve_data ) return $content; $table=”<table><tr> <th>Job Name</th> <th>Location/Dept</th> <th>Complete … Read more

How to hook in to the “output buffer” and add html content

You can use this class to buffer and filter any output coming from specific hook, or between two hooks. class HookBuffer { private static $buffers = []; private $buffer_name=””; private $buffer=””; private $buffer_status=”waiting”; private $priority1; private $priority2; private $tag1; private $tag2; private $output=FALSE; public function __construct( $buffer_name, $tag1=”, $tag2=” ) { if ( !( function_exists( … Read more

Adding custom Bulk Actions

Unfortunately it’s still not really doable in a clean way. You can see the latest about this here in this trac ticket #16031 I just checked the source and the filter is still basically the same.

Gravity Forms | Form Object is NULL [closed]

By default, the add_action function is only going to pass 1 parameter, but you can define how many do you have / need $accepted_args (int) (optional) The number of arguments the hooked function accepts. In WordPress 1.5.1+, hooked functions can take extra arguments that are set when the matching do_action() or apply_filters() call is run. … Read more

“Seen by” Feature in posts [closed]

I had to do this recently in a custom plugin The basic idea was this: add_action( ‘wp_footer’, ‘create_view_entry’ ) ); function create_view_entry() { $uid = get_current_user_id(); if ( $uid != 0 && is_single() ) $wpdb->insert( $this->tableName, array( ‘uid’ => $uid, ‘pid’ => $post->ID, ‘date’ => current_time( ‘mysql’ ) ) ); } This uses a custom … Read more

Where is publish_post hook fired?

As @shanebp suggested you in a comment to OP, that is one of the hook fired by the function wp_transition_post_status, it’s a bit hard to find it doing a search in code because is a dynamic hook, in facts the line in code that fires it looks like: do_action( “{$new_status}_{$post->post_type}”, $post->ID, $post ); Where $new_status … Read more

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