@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/?post_type=lh-portfolio&#038;p=146682>
  a sioc:Post ;
  dc:title "Hooks & filters" ;
  dcterms:identifier 146682 ;
  dc:modified "2026-08-31T22:14:24Z"^^xsd:dateTime ;
  dc:created "2026-08-31T22:14:24Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-copy-to-draft/hooks-filters/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<h2>Actions</h2>
<ul>
<li><code>admin_action_lh_copy_to_draft_save_as_new_post</code> &#8212; handles the single-post copy request (template tag / &#8220;more&#8221; modal link).</li>
<li><code>lh_copy_to_draft_after_duplicate_post</code> &#8212; fires after a duplicate is fully created (core fields + meta + taxonomy). See &#8220;Extensibility&#8221; in How it works.</li>
</ul>
<h2>Filters</h2>
<ul>
<li><code>bulk_actions-edit-{post_type}</code> (core, consumed) &#8212; adds the &#8220;Copy to draft&#8221; bulk action per applicable post type.</li>
<li><code>handle_bulk_actions-edit-{post_type}</code> (core, consumed) &#8212; processes the bulk copy and determines the redirect.</li>
<li><code>lh_copy_to_draft_get_applicable_post_types</code> &#8212; filter the list of post types eligible for copying (defaults to all public post types except <code>product</code>).</li>
<li><code>lh_copy_to_draft_get_clone_post_link</code> &#8212; filter the generated (pre-nonce) single-post copy link URL.</li>
<li><code>lh_copy_to_draft_post_defaults_filter</code> &#8212; filter default <code>wp_insert_post()</code> overrides for the new draft.</li>
<li><code>lh_copy_to_draft_meta_defaults_filter</code> &#8212; filter meta keys excluded/overridden on copy.</li>
<li><code>lh_copy_to_draft_taxonomy_defaults_filter</code> &#8212; filter taxonomy term overrides on copy.</li>
<li><code>lh_copy_to_draft_return_plugin_debugging_status</code> &#8212; enable/disable debug logging (also requires <code>WP_DEBUG</code> true).</li>
<li><code>lh_more_modal_template_list_end</code> (consumed, not defined here) &#8212; appends the single-post copy link into a theme/plugin-provided &#8220;more&#8221; action modal.</li>
</ul>
"""^^rdf:XMLLiteral ;
  sioc:content """Actions

admin_action_lh_copy_to_draft_save_as_new_post &#8212; handles the single-post copy request (template tag / &#8220;more&#8221; modal link).
lh_copy_to_draft_after_duplicate_post &#8212; fires after a duplicate is fully created (core fields + meta + taxonomy). See &#8220;Extensibility&#8221; in How it works.

Filters

bulk_actions-edit-{post_type} (core, consumed) &#8212; adds the &#8220;Copy to draft&#8221; bulk action per applicable post type.
handle_bulk_actions-edit-{post_type} (core, consumed) &#8212; processes the bulk copy and determines the redirect.
lh_copy_to_draft_get_applicable_post_types &#8212; filter the list of post types eligible for copying (defaults to all public post types except product).
lh_copy_to_draft_get_clone_post_link &#8212; filter the generated (pre-nonce) single-post copy link URL.
lh_copy_to_draft_post_defaults_filter &#8212; filter default wp_insert_post() overrides for the new draft.
lh_copy_to_draft_meta_defaults_filter &#8212; filter meta keys excluded/overridden on copy.
lh_copy_to_draft_taxonomy_defaults_filter &#8212; filter taxonomy term overrides on copy.
lh_copy_to_draft_return_plugin_debugging_status &#8212; enable/disable debug logging (also requires WP_DEBUG true).
lh_more_modal_template_list_end (consumed, not defined here) &#8212; appends the single-post copy link into a theme/plugin-provided &#8220;more&#8221; action modal.

""" ;
  sioc:topic <https://lhero.org/lh_portfolio-type/doc-section/>, <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/lh_portfolio-type/doc-section/> rdfs:seeAlso <https://lhero.org/lh_portfolio-type/doc-section/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
