Action inside another action not working

I think I worked out the problem. before_wp_tiny_mce_action is not an action hook called before the actual TinyMCE editor in the DOM. It is called before the script that is loaded via the admin_print_footer_scripts action. So I think the admin_footer action hook is before the before_wp_tiny_mce_action action hook so I am calling my action too … Read more

How can I get the user that publishes a post?

I am not sure if that is built in, but you can try adding something like this to your functions.php function set_publisher( $new_status, $old_status, $post ) { $publisher_id = get_current_user_id(); if ( $new_status == ‘publish’ && $publisher_id > 0) { update_post_meta($post->ID, ‘post_publisher’, $publisher_id); } } add_action( ‘transition_post_status’, ‘set_publisher’, 10, 3 ); And then when you … Read more

add_action before theme setup

setup_theme run on init theme, before after_setup_theme. The follow order on frontend, was fired in my test: load_textdomain plugins_loaded auth_cookie_valid set_current_user sanitize_comment_cookies setup_theme after_setup_theme init

WordPress upload file action hook

Try this way, should work well function cpt_from_attachment($attachment_ID) { global $current_user; get_currentuserinfo(); $attachment_post = get_post( $attachment_ID ); $type = get_post_mime_type($attachment_ID); // DO WHAT YOU NEED } add_action(“add_attachment”, ‘cpt_from_attachment’);

override function from my plugin [closed]

In WordPress ‘do_action’ is used to add an action hook in a plugin, which then can be used to hook our own function with plugin. Check Codex for more details: Hooks API WordPress To add your own function you will have to do the following: add_action(‘groups_screen_group_request_membership’, ‘your_function_callback’); function your_function_callback($id){ //here id can be used to … Read more

Replace admin header logo with an image

I think the path to the image is wrong, use get_stylesheet_directory_uri() to retrieve the style.css path. If this isn’t it let me know and I will take a closer look. I just dug out an example which worked for me in the past: function my_login_logo() { ?> <style type=”text/css”> body.login div#login h1 a { background-image: … Read more

Insert Google authorship into WordPress header

This is a wild guess, because you didn’t provide (parts of) your template. Anyway, most probably (if lessons.php is a full template) there is get_header(); somewhere at the beginning of your template file. If you put the very code you posted in your question before this it will render, as the wp_head action is still … Read more