Opened 12 years ago
Closed 12 years ago
#28902 closed defect (bug) (invalid)
Row actions do now follow filter on ajax update
| Reported by: | aubreypwd | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | 3.9.1 |
| Severity: | normal | Keywords: | close reporter-feedback |
| Cc: | Focuses: |
Description
Once a filter has been set for (at least in my application) a custom taxonomy to remove certain row actions on the terms list it persists except when adding a new row to the list via Ajax (see video).
To replicate:
Create a filter to remove row actions for a filter, like so:
// Common edits to the row_actions for tax.
function ihcrs_tax_row_actions_common( $actions ) {
// Remove Quick Edit
unset( $actions['inline hide-if-no-js'] );
// Remove Preview
unset( $actions['view'] );
// Remove Trash for non admin users.
if( ! current_user_can( 'manage_options' ) ) {
if( isset( $actions['trash'] ) ) {
unset( $actions['trash'] );
}
if( isset( $actions['delete'] ) ) {
unset( $actions['delete'] );
}
}
return $actions;
}
// Clean up row actions.
add_filter(
'ihcrs_facility_row_actions',
'ihcrs_tax_row_actions_common'
);
Now, go and see that View and Quick Edit have been removed from the terms list (may need to add a few). Add a new term via the left panel and let Ajax do it's job. Observe that the newly added row (top) have default row actions despite the filter.
Change History (3)
#2
@
12 years ago
- Keywords close reporter-feedback added
I'm unable to reproduce this issue. Using the code you supplied above (after registering a 'ihcrs_facility' taxonomy) the action links in the AJAX response are removed as expected.
Do you have some logic somewhere else which means the file that contains this code isn't included in AJAX requests?
I would try to reduce your code down to just the relevant bits (the taxonomy registration and the actions filter) and see if the problem persists.
#3
@
12 years ago
- Milestone Awaiting Review
- Resolution → invalid
- Status new → closed
Following up on johnbillion's comment above: it's possible that the file where you're doing the add_action() call is not being included during AJAX calls, because WP loads a bit different during AJAX. A good starting point for debugging this sort of thing is wp-admin/admin-ajax.php (and the judicious use of error_log()).
Going to close this one on the assumption that something like this is happening. If you find out it's a broader problem, please reopen with details. Thanks!
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)

http://youtu.be/KtsqHEJ7vsw
Video explanation of the description.