Admin cannot publish
Please do not use this (opening post) script as the scheme might have changed, use this https://wpindexfixer.tools.managedwphosting.nl/wpindexfixer/ up to date script
Please do not use this (opening post) script as the scheme might have changed, use this https://wpindexfixer.tools.managedwphosting.nl/wpindexfixer/ up to date script
First, use $query->query_vars and not $query->query. Secondly, you should run this conditional check before overriding the corresponding query var: empty( $_REQUEST[‘{VAR}’] ) || !isset($query->query_vars[‘{VAR}’]) where {VAR} corresponds to the query var’s name/key such as orderby. So try this, which worked for me: // Set default `orderby` to ‘registered’. if( empty( $_REQUEST[‘orderby’] ) || !isset($query->query_vars[‘orderby’]) ) … Read more
Admin – Handle data before creating or updating a post, page or custom post
You can use sanitize_file_name hook for this. function my_sanitize_file_name( $filename ) { $chars_table = array( ‘ ‘ => ‘_’, ‘-‘ => ‘_’, ); $friendly_filename = preg_replace( array_keys( $chars_table ), array_values( $chars_table ), $filename ); return strtolower( $friendly_filename ); } add_filter( ‘sanitize_file_name’, ‘my_sanitize_file_name’, 10 ); It will also convert letters to lowercase to avoid conflicts on … Read more
Move ‘current-menu-item’ class on #adminmenu li from Posts to Pages for Taxonomy Edit Screen
First of all, you should never use current_user_can function with roles. You should use only capabilities as params, as Codex clearly states: While checking against particular roles in place of a capability is supported in part, this practice is discouraged as it may produce unreliable results. So, if we’ve dealt with that major issue… There … Read more
Options page – dropdown of users
How to be able to edit custom address fields in WooCommerce admin?
You can use User Role Editor plugin and edit or add new user rule. User Role Editor WordPress plugin allows you to change user roles and capabilities easy. Just turn on check boxes of capabilities you wish to add to the selected role and click “Update” button to save your changes.
How to display a WordPress notice on create_term action