Is there a way to display a custom post type menu item as “users” submenu?

Solution 1 (not a good idea): add_users_page( _x( $this->page_title, “page_title”, $this->text_domain ), _x( $this->menu_title, “menu_title”, $this->text_domain ), $this->capability, “edit.php?post_type=my-post-type” ); Notice : This code is used in a class. When you are on the page, it can have some bugs with the menu, it´s a good idea for specific page Solution 2 : register_post_type( ‘my-post-type’, … Read more

How can i redirect click to new admin page not to edit screen in post table

On functions.php function disallowed_admin_pages() { global $pagenow; # Check current admin page. if ( $pagenow == ‘post.php’ && isset( $_GET[‘post’] ) && $_GET[‘action’] == ‘edit’ && (get_post_type( $_GET[‘post’]) ==’Post_type’ )) { wp_redirect( admin_url( ‘/edit.php?post_type=post_type&page=page_to_redirct&post=”.$_GET[“post’] ) ); exit; } } add_action( ‘admin_init’, ‘disallowed_admin_pages’ ); page_to_redirect is already created an included in functions.php

Weird white space in admin area

Well that didn’t take long to figure out.. I’ve dealt with this before, but could never figure it out. Obfuscated code. Impulsively I deleted the directory, but they’ll be back. If you see these weird random PHP files, your site needs to be scrubbed and relaunched from backups. Preferably XML data files with no code. … Read more

How to sort by two meta keys in admin area?

I can’t find any examples that combine the $query->set(‘property’, ‘value’) syntax with an array assuming that’s the correct method In your $args array, you defined both meta_query and orderby as arrays, and they are each an arg for WP_Query (or a value for the “property” above), hence in your custom function (set_post_order_in_admin()), just use $query->set( … Read more

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