Filter by post category in Media Library

You can use pre_get_posts to filter the query. So you can retrieve a category from query vars the retrieve the post with that category set the media query to include only post having that posts as parent To give an UI you can use restrict_manage_posts hook to output a category dropdown. add_action(‘pre_get_posts’, ‘my_filter_media_by_cat’); add_action( ‘restrict_manage_posts’, … Read more

Activate Gutenberg in category-descriptions

This isn’t possible at the moment, Gutenberg is a post editor that relies on REST API endpoints, it’s not an arbitrary content area editor as TinyMCE is. Given some modification though it could be made to work with a custom data model and be a replacement, but it’s not a trivial task, and what’s involved … Read more

Could not insert term into the database

OK. There where multiple issues here; wp_terms, wp_termmeta and wp_term_taxonomy all had their ID’s set not to AUTO_INCREMENT. Changing these and removing the 0 values from each table seems to have resolved this – very odd though. Big thanks to @N00b for helping!

How to remove categories filter from wordpress admin?

I tested this and it works for removing the categories dropdown on the All Posts page: add_action( ‘load-edit.php’, ‘no_category_dropdown’ ); function no_category_dropdown() { add_filter( ‘wp_dropdown_cats’, ‘__return_false’ ); } — below: old answer when I misunderstood the question — The code you posted works just fine for me. But here’s an alternative you might try: add_filter(“manage_posts_columns”, … Read more

Control term order on a per-post basis

I’m not sure if I understand exactly what your trying to accomplish but I’ve outlined a way for you to sort the order of terms associated with the current post. Html for the term order metabox: echo ‘<ul id=”the-terms”>’ $terms = get_the_terms( $post->ID, $taxonomy ); foreach ( $terms as $term ) { echo ‘<li class=”item” … Read more

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