Use of Local Storage in multiple plugins
My situation, I think, is a common one. I have two plugins that each use Local storage with Admin Columns Pro to automatically load columns, each of those plugins for a particular content type.
My code looks like this:
add_filter( 'acp/storage/file/directory/writable', '__return_false' ); //! CHANGE TO __return_true TO MAKE CHANGES
add_filter( 'acp/storage/file/directory', 'apartmentsync_acp_storage_file_directory' );
function apartmentsync_acp_storage_file_directory( $path ) {
// Use a writable path, directory will be created for you
return APARTMENTSYNC_DIR . '/acp-settings';
}
And it’s working great when either of these plugins are used. However, when BOTH plugins are used, only one of the content types loads its columns (the one that loads last).
I think what I need is your advanced setup here:
https://docs.admincolumns.com/article/58-how-to-setup-local-storage
However, the code sample applies to themes, not plugins, and unfortunately is just unscrutable to be as to what it does. It also appears to be targeting where things are *stored*, but I’m not sure if it’s allowing for multiple different load locations.
Would it be possible for someone to write a code sample that fits this sort of situation? Ive tried and failed, unfortunately. I’d wager that this is a relatively common need, as the people using ACP, I’d think, would also be likely to be developing plugins for setting up various content types (e.g. I have a staff plugin, a partners plugin, jobs plugin, etc.).
You must be logged in to reply to this topic.