Add button in admin columns

You are looking code to add a column next to short link. It’s pretty much simple. There are two things here. You can add it for specific post type or common to all the post types you have. // add a thumbnail column to the edit posts screen function kv_post_thumbnail_column($cols) { $cols[‘thumbnail’] = __(‘Thumbnail’, ‘1stopwebsolution’); … Read more

Get content of publish box

add_action( ‘post_submitbox_misc_actions’, ‘show_current_filter’ ); add_action( ‘post_submitbox_start’, ‘show_current_filter’ ); function show_current_filter() { $post = get_post(); print ‘<pre>’ . $post->ID . ‘ : ‘ . current_filter() . ‘</pre>’; } https://codex.wordpress.org/Plugin_API/Action_Reference/post_submitbox_misc_actions https://developer.wordpress.org/reference/hooks/post_submitbox_start/

Signed-in as admin on just part of the site

I discovered that by adding a call to get_currentuserinfo(); in header.php the problem appears to be solved. I still do not know why it happened, but at least this is a working solution for anyone else who happens to have this problem. Note: Following @jgraup’s suggestion above, I’m posting this as an answer. However, I … Read more

‘Conflict’ with action deleted_post and is_admin()

More importantly you should notice what link is produced by get_delete_post_link(). It’s an admin link is_admin() check will be always true. Instead you need something else that helps match the request. Try adding and query arg to your delete link. add_query_arg( ‘origin’, ‘fe’, get_delete_post_link( get_the_ID() ) ); then in the action add_action(‘deleted_post’, ‘woffice_trashed_post_handler’, 10); function … Read more

How to retain HTML5 Attributes on Markup

It is enough to add unfiltered_html capability to Editor role. Add the following code into your current theme’s functions.php: function wpse_change_capability() { $role = get_role( ‘editor’ ); if ( ! $role->has_cap( ‘unfiltered_html’ ) ) $role->add_cap( ‘unfiltered_html’ ); } add_action( ‘init’, ‘wpse_change_capability’, 10 ); Login as the user with Editor role. Test it by editing any … Read more