WordPress in sub directory wp-admin problem

I think you are missing some rules in your WP .htaccess file. I show mine below. Notice the rules for wp-admin, add them to your file: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /subcataloged/cliens-wp/ RewriteRule ^index\.php$ – [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond … Read more

How do I add to the list table a filter?

You can use views_edit-post hook to do so. It is a possible variation of views_{$this->screen->id} and resides in class-wp-list-table.php. add_filter(‘views_edit-post’, ‘my_post_views’ ); function my_post_views( $views ){ $views[‘html_class_name_for_li’] = ‘the html’; // ex: <a href=”#”>something (11)</a> return $views; }

How can I delete all inactive widgets?

You should do it with after_setup_theme action: function remove_inactive_widgets() { $sidebars_widgets = get_option( ‘sidebars_widgets’ ); $sidebars_widgets[‘wp_inactive_widgets’] = array(); update_option( ‘sidebars_widgets’, $sidebars_widgets ); } add_action( ‘after_setup_theme’, ‘remove_inactive_widgets’ );

How to set custom editor style when editing the homepage?

If I understand you correctly, you want a custom editor style when editing the homepage? You can check if you’re currently editing the homepage by comparing the post ID to the ID in the page_on_front option, like this: function homepage_editor_styles() { global $post_ID, $post_type; if ( empty ( $post_ID ) || ‘page’ !== $post_type ) … Read more

How to do a query only on a specific admin page?

It’s worthwhile pointing out that using admin_init within the current_screen filter is too late because admin_init has already fired. Instead do: add_action(‘current_screen’, ‘current_screen_callback’); function current_screen_callback($screen) { if( is_object($screen) && $screen->id === ‘top_level_custom-settings-api’ ) { add_filter(‘top_level_screen’, ‘__return_true’); } } Elsewhere in your top_level_page_callback callback responsible for executing the query: function top_level_page_callback() { $active_posts = null; if … Read more

How to limit the pages displayed for choosing parent page on page attribute’s menu?

This meta box is printed with page_attributes_meta_box and the select field for choosing parent is generated with this code: if ( is_post_type_hierarchical( $post->post_type ) ) : $dropdown_args = array( ‘post_type’ => $post->post_type, ‘exclude_tree’ => $post->ID, ‘selected’ => $post->post_parent, ‘name’ => ‘parent_id’, ‘show_option_none’ => __(‘(no parent)’), ‘sort_column’ => ‘menu_order, post_title’, ‘echo’ => 0, ); $dropdown_args = … Read more