• Resolved bhkh

    (@bhkh)


    Hello!

    I have a WP site that sends daily emails using IceGram and another plugin that publishes on Bluesky. With both of these, there are custom fields that keep track of whether or not an email has been sent (ig_es_is_post_notified) or a post made to Bluesky (bluesky_shared).

    If I want to repost the post at a future date, do I just list those fields in the “Do not copy these fields” field in the plugin settings? Or are custom fields not copied by default?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Mushrit Shabnam

    (@611shabnam)

    Hi @bhkh

    If you would like to remove custom fields’ data from being copied, you can use the filter “duplicate_post_excludelist_filter”.

    Thread Starter bhkh

    (@bhkh)

    Perfect! Thank you.

    Thread Starter bhkh

    (@bhkh)

    Hello!

    I am now trying to follow your instructions. To my custom plugin I have added the following

    /** 
    * Filters out custom fields from being duplicated in addition to the defaults.
    *
    * @param array $meta_excludelist The default exclusion list, based on the “Do not copy these fields” setting, plus some other field names.
    *
    * @return array The custom fields to exclude.
    */
    function my_custom_fields_filter( $meta_excludelist ) {
    // Merges the defaults array with our own array of custom fields.
    return array_merge( $meta_excludelist, [ 'ig_es_is_post_notified', 'bluesky_shared' ] );
    }

    add_filter( 'duplicate_post_excludelist_filter', 'my_custom_fields_filter' );

    However when I click “Rewrite & Republish” and the post opens for republishing in the custom fields section I still see this:

    My understanding of your instructions was that these fields should not be duplicated because of the function you recommended.

    I am confident that my custom plugin is active.

    Can you tell me what I am doing wrong?

    • This reply was modified 1 month, 1 week ago by bhkh.
    Thread Starter bhkh

    (@bhkh)

    I started a new thread for this since this one was marked resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.