Customize post data
-
Halo. I’m trying to add/customize the post data somehow:
1. Add a dropdown in the form (submission-form.php)
2. Retrieve the $_POST and add metadata with the value (user-submitted-posts.php)
3. Display it.I can manage the coding but I’m super new to working with wordpress plugin(avoid losing changes when update) and work with existing hooks.
I have my own plugin.php and just copied the whole [usp_display_post] and made my own there. This is simple bcoz it’s just displaying.
Are there hooks that I can use to:1. Add that dropdown option into the form (and say, I wanna put this after the Email form or somewhere)
2. I just wanna “update_post_meta($post_id, ‘my_meta_name’, value in custom field);” How to do that?
There’s: usp_createPublicSubmission($title, $files, $ip, $author, $url, $email, $tags, $captcha, $verify, $content, $category, $custom);
So if I just wanna add 1 more param, without changing the plugin directly, is that possible?
And still related to this. Can I still retrieve post:
$bla = $_POST[‘chosen_dropdown’];
then if I hook in: do_action(‘usp_insert_after’, $newPost);
Use the post_id and add_post_meta($post_id, ‘my_meta_name’, $bla);
Or even: add_post_meta($post_id, ‘my_meta_name’, $_POST[‘chosen_dropdown’]);Sorry if this is not the best place to ask this (workflow for customizing plugins with hooks). I’ve been reading about all this and still don’t know where to start. Posted here bcoz USP is the main thing I need to customize and this shouldn’t be(??) to hard to accomplish? But is this generally the right way for these kinda plugin edits?
Thanks so much. I’m very new to WP and hoping to be able to comfortably work with plugins.
Cheers!
The topic ‘Customize post data’ is closed to new replies.