adaldesign
Forum Replies Created
-
I was finally able to create a drop down to set post format using the hooks provided by Tareq and wanted to share my code in case it can be of use to anyone.
Paste the following in your functions.php
// Add the drop-down (you can edit the list of post format options) function wpufe_content_type( $post_type, $post = null) { ?> <li> <label for="post_format">Content Type<span class="required">*</span></label> <select class="requiredField" name="content_type" id="content_type"> <option value="" selected="selected">What are you posting?</option> <option value="standard">Text (Blog Post)</option> <option value="image">Single Image</option> <option value="gallery">Gallery of Images</option> <option value="video">Video</option> <option value="audio">Audio</option> </select> <div class="clear"></div> </li> <?php } add_action( 'wpuf_add_post_form_top', 'wpufe_content_type', 10, 2 ); // Validate the data (optional) function wpufe_content_type_validation( $errors ) { if( $_POST['content_type'] == '' ) { $errors[] = 'Please select a Content Type.'; } return $errors; } add_filter( 'wpuf_add_post_validation', 'wpufe_content_type_validation' ); // Make it happen! function wpufe_add_content_type( $post_id ) { set_post_format( $post_id, $_POST['content_type'] ); } add_action( 'wpuf_add_post_after_insert', 'wpufe_add_content_type' );
Easiest solution here would be to create your own template to display the post the way you want it. You can then display custom fields wherever you want.
I would create a custom field where people enter their address. Then you’ll have to parse that data when displaying the page to run it by google maps, and embed a map.
I’m trying to do the same… professor is helping here: https://www.ads-software.com/support/topic/plugin-wp-user-frontend-select-post-format?replies=10
Also Tareq seems to mention it can work with filters here: https://tareq.wedevs.com/2012/04/how-to-extend-wp-user-frontend/comment-page-1/#comment-4381
Hey Professor,
When activating your version of the plugin I got the following error:
Plugin could not be activated because it triggered a fatal error.
Warning: require_once(/home4/adaldesi/public_html/tribechestapp/wp-content/plugins/wp-user-frontend/lib/class.settings-api.php) [function.require-once]: failed to open stream: No such file or directory in /home4/adaldesi/public_html/tribechestapp/wp-content/plugins/wp-user-frontend/wpuf.php on line 38
Fatal error: require_once() [function.require]: Failed opening required ‘/home4/adaldesi/public_html/tribechestapp/wp-content/plugins/wp-user-frontend/lib/class.settings-api.php’ (include_path=’.:/usr/lib64/php:/usr/lib/php:/usr/share/pear’) in /home4/adaldesi/public_html/tribechestapp/wp-content/plugins/wp-user-frontend/wpuf.php on line 38
Just wanted to +1 on jberk’s initial comment here: the typo in admin settings leads to confusion.
It should say: “Select the page where [wpuf_edit] is located”.
Thanks professor,
I’ll give that a try on a testing environment first and send you my feedback.
Adal
Professor.
I’ll take a look at the commented code and see how I can make it work for me. Thank you so much for pointing that out.
Also your fork looks interesting, I might play around with it. Kudos for working so hard on that!
Hey professor,
I did mean formats such as “gallery” and “aside” as they allow for different post templates to be used.
Could you point me to Tareq’s project?
Alternatively I was thinking of using custom fields to then have conditional statements in my template. It’s a bit of a work-around though and I would start with the right logic from the get go.
I would like to know about this too as it’s one of the main reasons I’m not choosing to use this plugin right now.
Cosmo Themes has interesting front end posting I’d like to replicate and their post-format handling is gorgeous.
I’ve seen it done with the Events+ plugin by WPMUDEV with front end posting enabled. If I could grab the call function to media uploader from there, where would I look in this plugin to try paste it (ie, does anyone know where the code for “new post” and “edit” templates are?
I think it would be much better if we could simply load the default Media Uploader from WordPress rather than try to replace it with other upload systems that require tons of dev and come with obvious compatibility issues.
I have the opposite problem: I want to give people to the default Media Uploader (esp now that it was improved in 3.5) but now the attachment and featured image uploaders select files directly instead of loading the uploader.
Thanks Marcus, this plugin you suggested did the trick:
Thanks for the reply Marcus.
To help you understand, the KenBurns Plugin I’m using already enqueued the following: https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js
So I’m trying to remove redundant scripts as this seems to be causing conflicts.
I’m going to try de-registering the events manager script altogether and reregistering it.