Improving
-
Using the function frontier_post_form_standard_top you can create custom fields to display when creating (or editing) a post type.
However, you might want specific fields to appear (or not) when editing different post types or categories.
In theory, you should be able to do this with frontier_post_form_standard_top by reading in the shortcode parameters, to make decisions. However, frontier_post_form_standard_top only includes $thispost and $tmp_task_new, where you need $fpost_sc_parms
To do this, I added $fpost_sc_parms as an additional value passed to frontier_post_form_standard_top on line 77:
do_action('frontier_post_form_standard_top', $thispost, $tmp_task_new, $fpost_sc_parms);
Then modifying the example for custom code to:
//* Add custom fields to Frontier Post function fp_my_custom_text_field( $thispost, $tmp_task_new,$fpost_sc_parms) { ... } add_action( 'frontier_post_form_standard_top', 'fp_my_custom_text_field', 10, 3 );
This will break OFC with the next update. Sadly, I’m good enough to figure out this change, but not to fix it outside of the code.
I hope this is of some use to anyone, and perhaps will get added to a future release.
With this change, I can make my custom fields appear or not by checking values set in the parameters of the shortcodes.
- The topic ‘Improving’ is closed to new replies.