developerdeveloper
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: [Simple Local Avatars] Rectangle not square avatars?Same here!
Forum: Hacks
In reply to: Default custom post column to 'off' in screen optionshttps://codex.wordpress.org/Plugin_API/Action_Reference/wp_login
add_action('wp_login', 'myplugin_login_save'); function myplugin_login_save($user_id) { // get the hidden columns on the edit-book screen // manage{edit-book}columnshidden $hidden_columns = get_user_option( "manageedit-bookcolumnshidden" ); // check if the "book_author" column is already hidden if(!in_array('id', (array) $hidden_columns)){ // add "book_author" to the hidden columns $hidden_columns[] = 'id'; // update the hidden columns add_user_meta($user_id, "manageedit-bookcolumnshidden", $hidden_columns); } }Forum: Hacks
In reply to: Default custom post column to 'off' in screen optionsForum: Hacks
In reply to: Default custom post column to 'off' in screen optionsHave you thought about “user_register” action?
add_action('user_register', 'myplugin_registration_save'); function myplugin_registration_save($user_id) { // get the hidden columns on the edit-book screen // manage{edit-book}columnshidden $hidden_columns = get_user_option( "manageedit-bookcolumnshidden" ); // check if the "book_author" column is already hidden if(!in_array('id', (array) $hidden_columns)){ // add "book_author" to the hidden columns $hidden_columns[] = 'id'; // update the hidden columns add_user_meta($user_id, "manageedit-bookcolumnshidden", $hidden_columns); } }
Viewing 4 replies - 1 through 4 (of 4 total)