Nickname field isn’t appearing in Admin

When you display All Users, it will display values from users table. You will not see Nickname column, because Nickname value is in usermeta table. Put the following code to your child theme’s functions.php file. First filter manage_users_columns will add custom column Nickname to All Users view. Second filter manage_users_custom_column will retrieve values from usermeta … Read more

How to break line / add to ADMIN menu

<br> tags are not the solution to the problem that you were hoping they would be. Menu labels were never intended to contain arbitrary HTML. HTML does slip through in places, but this appears to be a bug and is inconsistent. For Post Types No. You can’t. $menu[ $ptype_menu_position ] = array( esc_attr( $ptype_obj->labels->menu_name ), … Read more

How to add Extra Column of post Status in All post page

The last function doesn’t work. Use this instead to fill the status column: // Add the data to the post columns: add_action( ‘manage_post_posts_custom_column’ , ‘custom_post_column’, 10, 2 ); function custom_post_column( $column, $post_id ) { if ( $column == “status” ) { echo get_post_status($post_id); } }

How to Restrict Access to all wp-admin pages for subscriber users

Hence, I want to block access of subscribers to all wp-admin menus/plugin pages including this link https://mywebsite.com/wp-admin/user-edit.php?user_id=113 This isn’t a bulletproof solution, but it should work in that non-admin users would no longer be able to access any admin pages when they’re logged-in: add_action( ‘admin_init’, function () { if ( wp_doing_ajax() || ! is_user_logged_in() ) … Read more

add_submenu_page() issue

edit.php?post_type=weather isn’t a valid PHP function name. If you’re trying to set the menu up as a submenu of your custom post screens, I think edit.php?post_type=weather—the $parent_slug—should be the first parameter, not the last. ie, add_submenu_page( ‘edit.php?post_type=weather’, ‘Weather Information’, ‘Weathers’, ‘manage_options’, ‘weathers’, [$this, ‘weathers’] ); References add_submenu_page()

blocking the admin section (but still using admin-ajax.php)

The following action hook should help: add_action(‘admin_init’, ‘wpse28702_restrictAdminAccess’, 1); function wpse28702_restrictAdminAccess() { $isAjax = (defined(‘DOING_AJAX’) && true === DOING_AJAX) ? true : false; if(!$isAjax) { if(!current_user_can(‘administrator’)) { wp_die(__(‘You are not allowed to access this part of the site’)); } } }

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