Skip to content

Instantly share code, notes, and snippets.

@freddielore
Last active March 14, 2022 01:52
Show Gist options
  • Save freddielore/4105bc6c99a5734221cc5d3d97941221 to your computer and use it in GitHub Desktop.
Save freddielore/4105bc6c99a5734221cc5d3d97941221 to your computer and use it in GitHub Desktop.
[Smart SEO Import Update] A hook that lets you perform additional update operation during import #wordpress #smartseo
<?php
add_action( 'smart_seo_import_update', 'child_update_more_custom_fields', 10, 3 );
function child_update_more_custom_fields($post_id, $data, $headings){
// Where
// $post_id is post ID,
// '_custom_field_name' is the custom field name,
// 'column name' is column name found in CSV file
update_post_meta( $post_id, '_custom_field_name', sanitize_text_field( $data['column name']) );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment