leogermani
Forum Replies Created
-
Forum: Plugins
In reply to: [Tainacan] Restricting access to attachment/document for each itemHi @ssastrodev,
Nice to hear you’re using it and enjoying!
This feature has been in our roadmap for a while, and we want to implement it as soon as possible, but unfortunately it’s not possible to do that right now. You can only control the visibility of the whole item and of each metadata. Documents and attachments follow the visibility of the items.
This is where we are tracking this: https://github.com/tainacan/tainacan/issues/291
Hopefully we can get into it soon!
Forum: Developing with WordPress
In reply to: How do I remove comments entered by a specific user?It did. The user id in this example is 9. Just change it for whatever you want
add_action('pre_get_comments', function($query) { if (is_admin()) return $query; // don't remove from admin $query->query_vars['author__not_in'] = 9; });
Forum: Developing with WordPress
In reply to: How do I remove comments entered by a specific user?Hmmmm
$post->post_author
is getting you the ID of the POST author, not the comment author… So, in a post page it will print the same ID for all comments. It’s wrong.Forum: Developing with WordPress
In reply to: How do I remove comments entered by a specific user?The way I suggested, using
pre_get_comments
is a good way to do it.The comments would be still in the database, you would still see it in the admin, but it would be hidden from the site.
Hiding it using CSS is not a good idea because it could potentially break all your pagination… imagine this user makes a lot of comments, and you have a full page of them. A visitor would see a broken page…
BUT, if you want to go that way, you don’t need anything fancy. Just add the user ID to a class in the comments div and later use a CSS rule to hide them.
Something like:
In your comments template:
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body comment-user-id-<?php echo $comment->user_id; ?>"> ....
And later, in your CSS
.comment-user-id-9 { display: none; }
Again, not a good idea. But here it is if you want.
Hope that helps
Forum: Developing with WordPress
In reply to: How do I remove comments entered by a specific user?Sorry, I don’t understand what you are trying to do.
Maybe you could clarify your question.
Forum: Developing with WordPress
In reply to: How do I remove comments entered by a specific user?Do you want to REMOVE the comments or just HIDE them?
If you want to remove them from the database, you could connect to your database and DELETE all the rows… or change its status…
If you want to remove them from every query, you can use the
pre_get_comments
action and modify the query made to select the comments.It would be something like (untested code)
add_action('pre_get_comments', function($query) { if (is_admin()) return $query; // don't remove from admin $query->query_vars['author__not_in'] = 9; });
Good luck
Forum: Developing with WordPress
In reply to: $wpdb->updateHi
1. You dont need to concatenate $wpdb->prefix and ‘posts’. $wddb->posts gives you the posts table name
2. The second format you are passing, “%d”, is telling the value is a digit, where it is a string. Replace it with %s. This might work.
Forum: Developing with WordPress
In reply to: I can’t get pagination to work in WP querythe_posts_pagination() function works with the main global $wp_query object, it is not looking to your custom query.
One thing you could do is temporarily overwrite the global $wp_query variable with your own WP_Query instance and restore it afterward with wp_reset_query.
Forum: Plugins
In reply to: [Tainacan] Licenciamentooi Diana,
Legal ver que você está por dentro do debate!
Você tem raz?o em tudo que disse. Estamos muito preocupados com isso nesse trabalho com museus e é uma quest?o super delicada e complicada. Estamos tratando disso em algumas frentes.
Inclusive estamos organizando agora um workshop com o professor Peschansky lá na Casper, que pode te interessar: https://casperlibero.edu.br/agenda-eventos/curadoria-informacional-e-web-semantica/
Vou fechar esse tópico por aqui mas seguimos conversando, ok? Se quiser conhecer melhor o projeto, marcar um papo, ou se quiser que fa?amos uma apresenta??o, estou a disposi??o!
abra?os
Leo,,
Forum: Plugins
In reply to: [Tainacan] LicenciamentoOi Diana! Qto tempo!
Legal que gostou! Experimente e nos diga o que acha! Acabamos de fazer o pre lan?amento da vers?o 0.8! https://tainacan.org/2019/03/22/teste-agora-pre-lancamento-da-versao-0-8-do-tainacan/
Realmente licenciamento é uma necessidade comum nos repositórios. E a diversidade de formas de licenciamento também. Em muitos casos há obras que n?o s?o licenciadas, ou que n?o se sabe exatamente quais s?o os direitos.
Quando há licen?a, elas s?o muito variadas. Se nos limitassemos ao CC, por exemplo, n?o atenderiamos a nenhum dos museus com os quais estamos trabalhando atualmente.
Por isso, por ora, optamos deixar isso aberto. Você pode criar um metadado para sua cole??o, chamá-lo de Licen?a, e colocar as op??es que quiser.
Sabemos que isso ainda n?o é suficiente. Está nos planos um campo específico para licen?a, que possa adicionar informa??es ao objeto de maneira q a licen?a fique também “legível por máquinas”, usando o CC e também o Rights Statement (https://rightsstatements.org/en/). Tem que ser um campo bem aberto para dar conta da diversidade de licen?as que existem ?? Vamos chegar lá!
Obrigado pela mensagem e espero que a resposta fa?a sentido. Estamos abertos a mudar de opini?o.
Abra?os
Leo,,
Forum: Plugins
In reply to: [Tainacan] Rela??o entre páginas e cole??esOi Bernardo,
Que legal que está gostando!
Ainda n?o tem um jeito automático de fazer isso, mas essa está sendo uma das prioridaes nossas agora. Na próxima vers?o que lan?aremos em algumas semanas você já terá várias op??es de criar uma página e destacar nela uma lista de cole??es, itens ou taxonomias. Isso vai permitir você fazer uma página principal do jeito que está querendo.
Por enquanto temos apenas uma prévia de um bloco de conteúdo desses que te permite destacar itens, mas n?o cole??es. Veja mais sobre isso aqui: https://tainacan.org/2018/12/06/tainacan-esta-pronto-para-o-novo-editor-de-texto-do-wordpress-5-0/
Enquanto isso, o que é possível é criar uma página e destacar manualmente nela fotos e links para as cole??es, inserindo manualmente as fotos e os links.
Depois mexer na própria configura??o do WordPress que te permite colocar essa página como página inicial. Em Configura??es > Leitura.
Espero ter ajudado e, se tiver qualquer dúvida, escreva. Também n?o deixe de se inscrever na nossa lista de email, onde há mais pessoas usando e tirando dúvidas: https://lists.riseup.net/www/info/tainacan
Abra?os
Forum: Plugins
In reply to: [Tainacan] Tema do TainacanI improved the download page to have a more direct link to the theme. We will improve this even more (it is taken way longer than we expected to publish the theme on the WordPress repository).
I will also improve the README explaining it better.
For now, I think this is resolved.
Thanks!
Forum: Plugins
In reply to: [Tainacan] Metadata order – and link to the itemHi @lesgrandsours,
I will close this issue for now. Please feel free to open a new one if needed!
Forum: Plugins
In reply to: [Tainacan] Metadata order – and link to the itemDid you manage to get it working? We just released a new version. Let us know if we can help with anything. Otherwise I will close this ticket, ok?
cheers
Forum: Plugins
In reply to: [Tainacan] Metadata order – and link to the itemHi,
Maybe if you share a screenshot it is easier for us to understand.
Just a clarification (we are working to let this easier to understand), you probably noticed that when you create a new Collection, there were 2 metadata there that you cant delete. We call these “core metadata”. They refer to the title and description of the item (or the Title and the Content of the WordPress post). But they can be renamed and reordered freely.
But these are the metadata that will hold the values fot the_title() and the_content(). So if you are using a WordPress theme, these are the metadata it will consider as beeing the title.