Template Overrides

This topic contains 1 reply and 2 voices, and was last updated by Tareq Hasan 10 years, 8 months ago
Viewing 1 Posts - 1 through 1 (of 1 total)
Author Posts
August 31, 2013 at 1:51 am 7667
Tareq Hasan Hello Im loving the plugin so far. But I need to make couple changes, I hope you can help me with these issues / questions: 1) How to make changes in template files etc... so that plugin upgrade will not overwrite my edited code? is it possible to copy plugins template files in my theme file and make changes there? if So, can you please give me instructions on folder architecture etc... ? 2) Im working with a guest post functionality, I need to Move, Name and Email fields for guest post, right above the Submit Button, and below the post title and post body, how can I achieve this? 3) Is it possible to hide the post title field and prefill it with custom data, for example "Guest Post Number X" where the X would be an integer increasing automatically per each post? Thanks in advance! Cheers
August 31, 2013 at 3:15 am 7671
Tareq Hasan Tareq Hasan

1) What do you mean by plugin template files? The plugin doesn’t have any template. How did you edited the plugin? There are some action/filters available in the plugin. Did you used that? In that case put them in your themes functions.php and they should be safe.

2) Currently you can’t do this, to achieve that, you have to edit the plugin code. So it’ll obviously be removed when a new version update comes to the plugin. If you are still interested, open /class/render-form.php, see the lines 273-375. It looks like this:
[php]
if ( !is_user_logged_in() && $form_settings[‘guest_post’] == ‘true’ && $form_settings[‘guest_details’] == ‘true’ ) {
$this->guest_fields( $form_settings );
}
[/php]
Move these lines just before this line: $this->submit_button( $form_id, $form_settings, $post_id );

3. Yes you could do that by using the filter wpuf_add_post_args. You can dynamically push the post title from a function with your desired format.

Viewing 1 Posts - 1 through 1 (of 1 total)