Support » Plugin: Advanced Custom Fields: Extended » Reset to Default Value Option

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author hwk-fr

    (@hwk-fr)

    Hello!

    Thanks for the feature request. I kinda like it, but I don’t think most of users would like to see an additional “Reset” action button which won’t be used 95% of the time. If I integrate this feature, I think I’ll make the button available when activating Dev Mode (using define('ACFE_dev', true);).

    Just to be clear, here is how I see it: Run a get_fields() command on the current post/term/option page/user, and delete all those meta.

    This will reset all fields back to default value, if any, or empty. just like if you never saved the page.

    I’m adding it to the Trello Board: https://trello.com/b/QEgpU7CL/acf-extended

    Regards.

    Hi,
    Thanks for the follow-up in this – much appreciated!

    Unfortunately my choice of reference link was not the best one to illustrate what I looking for. The link refers to the ability to reset all EXISTING field values, however the scope of my request was much more limited. I was looking for the ability to reset field values only when a post is COPIED over to a new post.

    Currently, when an existing post is copied to a new post, ACF retains all the field values from the source post so that the new post is pre-populated with those values. This retention of values is desirable for some fields, but undesirable for others where the default or null value is required.

    Subsequently, my request is to have the option for each field to retain ACF field values when a post is copied, or to reset the fields values to the preset default value. This option would look something like the following in the Field Groups settings page for each field:

    “Empty field values and replace with default value (if set) when copying posts? – Yes/No”

    This yes/no option would allow full control over which ACF field values are copied over to new posts, or which ones are reset to the default value. If there is no default value set, then the field would simply be nulled in the copied post.

    Apologies for not making this clear in my first post. Hopefully, this is somehting that is much easier to implement and of course useful to other users. I certainly would welcome it very much!

    Cheers!

    Plugin Author hwk-fr

    (@hwk-fr)

    Hello,

    Well this precision made the feature request far more complex. The thing is, WordPress doesn’t have a copy/duplicate post feature, which means you probably use a plugin like “Duplicate Post” to achieve this, right?

    Such feature would mean to dig in many “duplicate” plugins and verify what method they use to duplicate posts, and hook in there to add some meta exceptions. Which could break after an update. Quite difficult :\

    Regards.

    Hi @michaelbroughton,
    I’m the developer of Duplicate Post
    I don’t know if you’re using my plugin and if it’s relevant here, but let me say that in the settings of my plugin you can add the name of the custom fields (evenw using wildcards) that you don’t want to be copied. Can this be useful to your purpose?

    Plugin Author hwk-fr

    (@hwk-fr)

    Hey!

    Do you use a service or software to detect when people use the keywords “Duplicate Post”? 😀 It only took 3 hours for you to come haha!

    Thanks for the input tho, that may help.

    Regards.

    Hi @hwk-fr,
    actually yes, I use WordPress.org’s own notification feature 🙂
    (That means I get also notification for people complaining about posts shown twice in the Loop :-/)

    Plugin Author hwk-fr

    (@hwk-fr)

    Oh! I didn’t even know about that feature! I’ll try to add my own keywords 🙂

    That means I get also notification for people complaining about posts shown twice in the Loop :-/

    What a “blessing” haha!

    Anyways, I’ll wait for the original ticket author’s input to know what he really needs. I’ll poke you if I need further informations!

    Have a nice day sir.

    PS: Your plugin is awesome!

    Regards.

    Hi,
    Sorry for the delay in getting back to you. The ‘posts’ I am referring to are actually WooCommerce product posts – sorry for not making that clear.

    Does that make any possible resolution easier or harder?

    Many thanks!

    @hwk-fr, you’re too kind!

    Hi @michaelbroughton,
    I suppose then you are using WooCommerce’s own product duplication feature… which is the right thing to do since they know well the spec of their post type (for example, my plugin doesn’t copy variations when you clone a product), but I don’t really know if they have a filter on the custom fields like mine…

    If you ghave simple products, you could try to enable my plugin for them in the Settings. This will add a “Clone” and a “New Draft” link alongside the “Duplicate” link by WooCommerce. If using my links duplicates your products fine, then you should be able to use the filter on the custom fields I mentioned some messages above.
    Be warned that my plugin is not tested at all with Woocommerce Products so it could lead to unexpected results. Test it on a staging or development site first.

    I hope this helps!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Reset to Default Value Option’ is closed to new replies.