Multiple choice in a custom taxonomy

To display multiple authors, loop through the array of authors: function show_product_autor(){ $authors = wp_get_post_terms( get_the_ID(), ‘autor’ ); foreach($authors as $author) { $authorTeamPg = get_page_by_title( $author->name, ‘OBJECT’, ‘team’ ); $authorTeamPgLink = get_permalink( $authorTeamPg->ID); echo “<b>AUTOR: </b><a href=”https://wordpress.stackexchange.com/questions/289422/{$authorTeamPgLink}”>{$author->name}</a>”,'<br />’; } } To handle editors, the simplest solution IMO would be to make the taxonomy heirarchical and … Read more

Getting a 404 error when clicking edit page

You mentioned that you disabled all plugins, and changed the theme (I assume you used one of the ‘twenty’ themes, which is what I usually do when trying to find theme/plugin problems). Did you also look at the ‘must use’ plugins (in wp-content/mu-plugins ) (see https://codex.wordpress.org/Must_Use_Plugins ). Maybe a plugin in there is causing problems. … Read more

Programmatically allow a non-author to edit a post based custom meta field

Looking at current_user_can()‘s documentation, I see that it uses WP_User::has_cap(). So if your code (or the WP core code) uses something like current_user_can( ‘edit_post’, $post->ID ) to determine if the current user can edit the current post, you can use the user_has_cap filter (called in WP_User::has_cap()): add_filter( ‘user_has_cap’, ‘wpse360937_allow_manager’, 10, 4 ); function wpse360937_allow_manager( $allcaps, … Read more

Do not change the order of the tags in the editor

Terms/Tags aren’t ordered. To help make the terms easier to read, the editor will list them alphabetically, but that isn’t because they’re ordered alphabetically in the database. It’s because a piece of javascript sorted the terms in the UI control. There is no order, only the order you give them. Fundamentally terms have no order. … Read more

HTML tags in WordPress image caption

I’m glad that better support should be added in version 3.4 but for now I’ve fixed the issue by changing the behaviour of image insertion so that it doesn’t use the shortcode. Here’s what I added to functions.php: add_filter( ‘disable_captions’, create_function(‘$a’, ‘return true;’) ); function image_send_to_editor_2($html, $id, $caption, $title, $align, $url, $size, $alt) { if … Read more

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