Function to get a ‘post selector’ UI?

No, there’s no existing function available for an equivalent UI for posts or pages. The whole UI in your screenshot is provided by the post_categories_meta_box() function, which uses wp_category_checklist() internally for the actual checkboxes, which implements the Walker_Category_Checklist class. All of these are built for listing terms as checkboxes, and can’t be repurposed for listing … Read more

wp-admin going directly to 404

I have a plugin called “WPS hide login” which changes the name of the login page. Could that be the problem? Deactivate this plugin before you do anything else. It’s unlikely that the issue is with htaccess, especially if you deleted it and nothing changed. You might need to look if there is another htaccess … Read more

Not able to access WP Admin, it says “Sorry, you are not allowed to access this page.”

I managed to solve this. Reason was that: The data about user roles, that’s set by default in a WordPress installation was completely missing in the db table wp_options under the wp_user_roles row. In my case it was this a:3:{s:14:”backwpup_admin”;a:2:{s:4:”name”;s:14:”BackWPup Admin”;s:12:”capabilities”;a:12:{s:4:”read”;b:1;s:8:”backwpup”;b:1;s:13:”backwpup_jobs”;b:1;s:18:”backwpup_jobs_edit”;b:1;s:19:”backwpup_jobs_start”;b:1;s:16:”backwpup_backups”;b:1;s:25:”backwpup_backups_download”;b:1;s:23:”backwpup_backups_delete”;b:1;s:13:”backwpup_logs”;b:1;s:20:”backwpup_logs_delete”;b:1;s:17:”backwpup_settings”;b:1;s:16:”backwpup_restore”;b:1;}}s:14:”backwpup_check”;a:2:{s:4:”name”;s:21:”BackWPup jobs checker”;s:12:”capabilities”;a:12:{s:4:”read”;b:1;s:8:”backwpup”;b:1;s:13:”backwpup_jobs”;b:1;s:18:”backwpup_jobs_edit”;b:0;s:19:”backwpup_jobs_start”;b:0;s:16:”backwpup_backups”;b:1;s:25:”backwpup_backups_download”;b:0;s:23:”backwpup_backups_delete”;b:0;s:13:”backwpup_logs”;b:1;s:20:”backwpup_logs_delete”;b:0;s:17:”backwpup_settings”;b:0;s:16:”backwpup_restore”;b:0;}}s:15:”backwpup_helper”;a:2:{s:4:”name”;s:23:”BackWPup jobs functions”;s:12:”capabilities”;a:12:{s:4:”read”;b:1;s:8:”backwpup”;b:1;s:13:”backwpup_jobs”;b:1;s:18:”backwpup_jobs_edit”;b:0;s:19:”backwpup_jobs_start”;b:1;s:16:”backwpup_backups”;b:1;s:25:”backwpup_backups_download”;b:1;s:23:”backwpup_backups_delete”;b:1;s:13:”backwpup_logs”;b:1;s:20:”backwpup_logs_delete”;b:1;s:17:”backwpup_settings”;b:0;s:16:”backwpup_restore”;b:0;}}} Whereas it should have Administrator at least somewhere. And this … Read more

do_shortcode() within Admin Page

Instead of calling do_shortcode() just call the function associated with the shortcode. Example There is a shortcode named [example] and a function registered as shortcode handler: function example_shortcode( $atts = array(), $content=”” ) { extract( shortcode_atts( array ( ‘before’ => ”, ‘after’ => ”, ), $atts ) ); return $before . $content . $after; } … Read more

Redirect WordPress login for customers but not admin

After a bit of thinking, I came up with a solution that allows wp-login.php to be redirected for the public/customers, but not for the admin. I did this by getting the referrer URL. Here is my updated code, but I’m open to other ideas. //Redirect for login from wp-login.php to my-account if not admin add_action(‘init’, … Read more

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