Last active
March 14, 2022 01:52
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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