Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the community forum?
All Topics
Davide

Problem Filter

Hi Guys, i have insert this snippet for hide other post author, but admin columns pro filter not working now.

function hide_posts_media_by_other($query) {
global $pagenow;
if( ( 'edit.php' != $pagenow && 'upload.php' != $pagenow ) || !$query->is_admin ){
return $query;
}
if( !current_user_can( 'manage_options' ) ) {
global $user_ID;
$query->set('author', $user_ID );
}
return $query;
}
add_filter('pre_get_posts', 'hide_posts_media_by_other');

Please, you give me a suggestion for fix this?

Thank you very much,
Davide

4 years, 9 months ago
Stefan
Developer

Hi Davide,

I tried to reproduce this issue but with no luck. First I thought that this was a priority issue, but after some testing and thinking this should not matter. With filtering we also use the main query so adding some extra filtering to the query should have no impact.

When I use your action and set author always to my own account I see my own posts. Even filtering on all other columns added by Admin Columns Pro works without any problem.

Do you get an error message of something else? Does your own filter on author work? Are your filter dropdowns filled with the correct data?

4 years, 9 months ago
Davide

Disappear filters we set through Admin Columns Pro. It is no longer possible to filter for specific fields (eg ACF). in over inline editing is limited to the title and not the other fields

4 years, 9 months ago
Stefan
Developer

Hi David,

I took some time to investigate this.
This is what i’ve done:

– Tested it with roles: Admin, Author and Editor
– Tested only with our code and ACP plugin

In all cases my filters still work and I can still use inline-edit.
Please can you check the following:

– Does filtering and inline editing work after you disable your code?
– Did you try to disable all other plugin?

Otherwise send me an account for your (test/development)environment to support@admincolumns.com so I can take a look.

4 years, 8 months ago

You must be logged in to reply to this topic.