codepress / admin-columns-issues

Issues for Admin Columns Pro
https://www.admincolumns.com/
11 stars 0 forks source link

Sync default directory #1293

Closed davidmosterd closed 4 years ago

davidmosterd commented 4 years ago

The current way sync is enabled is a compromise between developers (A) and people who feel less comfortable writing code (B).

For B there is the simple ingredient of creating the acp-sync dir in the theme folder. However, for A this is not an explicit intend in the code to enable or disable this feature.

Therefore I propose to have a filter that explicitly enables or disabled this feature. The default behavior is that the feature is disabled. However, with a filter e.g. acp/sync/enable you can enable it.

As a convenience, you can add a second parameter which is the path to save. When you omit this, the default directory will be used.

Our own code will run on the same filter but on a low priority (e.g. 5). It will check if the default dir exists and if it does, return true and set the default directory.

This basically means you have two filters: one to enable or disable the sync and one to tell where you want to save. The first filter also allows you the hook into the second for convenience.

davidmosterd commented 4 years ago

no longer needed in current setup