I need help using pre_get_comments to limit comments in the comments admin screen

Update In response to the new code in the updated question, you could actually use $wpdb->get_col() with a single SQL command via a JOIN clause, like so: $query = “SELECT c.comment_ID FROM $wpdb->comments c JOIN $wpdb->posts p ON p.ID = c.comment_post_ID WHERE c.user_id = $user_ID OR p.post_author = $user_ID”; $comment_ids = $wpdb->get_col( $query ); However, … Read more

hide elements of admin with css file

It’s always better to encapsulate your styles in a separate file, so your first example is closer. That said, the documentation for admin_print_styles says quite clearly: admin_print_styles should not be used to enqueue styles or scripts on the admin pages. Use admin_enqueue_scripts instead.

Live reload preview just reloads forever

This is from the Editorskit plugin, it is not a part of WordPress. If it’s broken you will need to contact their support routes. ( Based on finding the description text verbatim in a github search, resulting in a file in the preview extension of editorskit )

sortable columns for multiple custom post types not working

I thought if I used manage_edit-post_sortable_columns I could target the ones I have conditionally checked for? That hook runs only on the “Posts” page (at wp-admin/edit.php) for managing posts in the default/core post post type. I.e. When the post_type parameter in the (current page) URL is not set or empty, or that it’s set to … Read more

Theme javascript/css 404

Thanks to @jacob peattie for helping me to figure this out. The issue is that I had WP_CONTENT_URL set incorrectly. Removing it fixed the issue. I could have added /wp-content to the url and it would’ve solved the issue as well. To explain why this caused in issue, I turned to the docs. This page … Read more

Admin Panel Development [closed]

This would be a good place to start. add_menu_page. The posts list are automatically created when you register a new CPT. You can, however, create anything in a custom menu page (read the docs from point 1).

Insert Custom Post Types

You maybe want to add extra information fields, and settings for individual posts – single posts in CPT – Custom Post Types. Out of the box, WordPress gives us – ‘title’ ‘editor’ (content) ‘author’ ‘thumbnail’ (featured image, current theme must also support post-thumbnails) ‘excerpt’ ‘trackbacks’ ‘custom-fields’ ‘comments’ (also will see comment count balloon on edit … Read more