BuddyDev

BuddyPress Simple Front End Post: A plugin to allow front end posting for the users

BuddyPress Simple Front End post plugin allows developer to create unlimited post forms for the front end posting. The current release includes support for custom posts type and categories but not the custom taxonomies. I will include custom taxonomy support in future.

I created this plugin to use with Blog categories with groups plugin as I could not find a nice solution for the purpose. Currently this plugin is aimed as developers. It has a simple api to create forms and to use them in theme. All the nasty works are handled by the plugin, so a developer does not need to dive into the code. Instead just use two lines of code to create a custom post form for any purpose they like.

Here is a screenshot of it being used with Blog Categories for groups plugin

Features:-

  • Allows to create  any number of customized post forms
  • supports custom post type
  • supports including a list of categories
  • has a very simple to use API for developers(I will show an example below)
  • It is very very Light weight

How to Use It:-

The basic philosophy is to allow developers to create an Instance of  'BPSimpleBlogPostEditForm' class for each of their form. This class handles the view and behavior both. Once you create an instance, you will need to register it to the 'BPSimpleBlogPostEditor' class(which is implemented as singleton pattern). Ok, so that seems nasty, right? No worries, you don't need to delve into that. There are two api functions which will do it for you. You just need to pass the form name(which should be a unique name, it can contain spaces etc) and the basic sdettings of the form(like post type, allowed categories, who can write, who will be attributed as the author of the post and the post status).

Registering a Form Instance:-

To create and register a post form(with settings), you will need to use the following code

The above code creates an instanace of 'BPSimpleBlogPostEditForm' class and registers it to the editor. You can create any number of forms you want. The above code must be called on/before bp_init action priority 10.

Here is a working example with the details of allowed parameters.

You can modify any  parameter as you like. Even you can set it to allow non logged in users to submit post and save it to another user account.

The above code will register a new form with name 'my form' and you can retrieve it later at any point and show the form anywhere using the following code. We need to register the form on/before bp_init priority 10 to allow the controller to have access to this form. If you register the form after bp_init action, the controller will be unaware of the form's existance and can not handle the save action.

Once a form is registered, you can show it anywhere you like using the following function.

 

You can use above code anywhere in your template to render the form.

Though registering the form on/before bp_init action may seem like a bad choice to some of you, It allows for server side validation of the credentials/authentication and thus helps from any misuse of the form.

It is a free plugin, please feel free to download it and use it on your custom projects. The Blog Categoris for groups plugin version 1.0.4 supports this plugin. You will simply need to activate this plugin and the plugin will work as the form handler for Bp Blog Categories.

Download Link:https://buddydev.com/plugins/bp-simple-front-end-post/

Code Repository: https://github.com/sbrajesh/bp-simple-front-end-post

Looking forward to hear your suggestions for the improvement of this plugin 🙂

41 Responses to BuddyPress Simple Front End Post: A plugin to allow front end posting for the users

  • Not sure about the purpose of this plugin… What does it do that you cannot do with Gravity Forms? (and for CPTs use the CPT plugin for Gravity Forms)
    What would really be cool is also to allow updating from the frontend. That is not built in with Gravity Forms (yet).

    • Hi Bente,
      Thank you for the comment.
      The gravitiy form is a versatile plugin and it may be doing this.

      I wrote this plugin to allow posting from front end for developers use, as no free plugin served the purpose. The current version is targeted at developers and not the site admins. I do plan to release an advanced version which will enable siteadmins to build the post form.

  • I can't figure out how to install this plugin. It is a great plugin, but can you give me better instructions? Also, are you going to keep it updated?

  • Hey there, I'm a complete noob… been trying to find a solution to add a frontend post plugin, to allow buddypress members to post their own blog posts… I installed the plugin, however I can't find the setup/options in the admin panel… i'm guessing i'm missing something here :X

    I'm guessing it has to do with all the code up there in your post… I was wondering if I could get a dummy version of how to activate this for my members?

    I would prefer to add this postbox with a category selection, and in the member's profile area.

    a timely response would be greatly appreciated!

  • Thanks for this plugin!

    there is a way to add featured image in the form?

    • Hi Pajar,
      Thank you for the comment.

      Currently if you download it from github, you can specify the no. of images to be uploaded using upload_count parameter, But it won't be set as featured image.

      I have got a local version working with custom post type/custom taxonomies/edit capabilities, will try to include the better uploading support when I make it available here.

      • Mate i spend many hours but didn't figure out how to configure you're plugin. I activate you're plugin but don't know that you're above mentioned code where i have to place :s

        Can you guide me mate.

  • Hello,

    Thanks for the plugin. I have a question can I allow the users to add the featured image. If so then hows. Please give me any solution.
    Waiting of your reply

    Thanks

  • Thanks for the plugin. I can see in the screenshot you have hooked the plugin onto the Profile tabs. If possible provide the code for the same and I think you should include in your plugin by default. Thanks a lot again!

    • Hi Vikas,
      sorry for my delayed reply.

      I will upload an example component tonight to show it in action.

      • That would be great.. I am waiting for it!

  • Is there an easy way to include a line for the tags in the Form?
    If that's possible, this plugin looks like exactly what I need.

    • Hi Fritz,
      I have just pushed an update to github that does allows any taxonomy(including tags/custom taxonomies), any post type and custom fields. I will need to put a detailed doc though. Hoping to post a new tutorial tomorrow for the same.

      • Hi Brajesh,
        I just installed the plugin using github source. Could u please include an example similar to the screenshots u have shown in above example? I really need this plugin for my site. Thanks.

        • Hi Kiran,
          I am trying to put a user blog component today using this plugin. Hope to make that as an example. will put some more docs later.

        • I will be doing a test install in a few minutes and will be integrating CPT's and custom fields one way or another. I'll let you know how it was accomplished if you still need help.

        • @ Chris,
          I am looking forward to it.
          I will be releaasing BuddyBlog tomorrow and a tutorial on custom taxonomies a day later. Please do let me know if you need any help 🙂

      • Hi Brajesh,
        thanks for the fast and friendly answer! 🙂
        I'll check it out.

        • HiHi Brajesh, did u get chance to release ur buddyblog plugin? Please update me on the same. Thanks.

        • @kiran,
          I am releasing it tomorrow. Sorry for the delayed reply.

        • No prob. Thank u very much 🙂

  • Hi All,
    I have just released the BuddyBlog plugin today.
    Please check it here

    https://buddydev.com/buddypress/introducing-buddyblog-allow-users-to-blog-from-their-buddypress-profile/

    Will have a new post about the BuddyPress Simple Front End Post plugin in next 2-3 days, to explain about all the features of the front end posting.

  • I have installed front end posting as well as the BuddyBlog plugin. It doesn't upload images. I have deactivated it until that can be fixed. Just thought I would let you know. 🙂

    • Hi Kevin,
      Thank you for reporting.

      Just tested the BuddyBlog again. It does upload the files. Please make sure your upload directory is writable and your theme lists attachment in the post.

      An enhancement in future will be show error if the upload is not complete.

  • Rob #

    Hi Brajesh, would it be possible to add some validation to both the Title and Post fields to help with SEO? It would be really good if there was a minimum chacter limit for both of these fields to force users to post meaningful titles and to limit posts under a certain amount of characters

    Is this possible please?

    Thanks
    Rob.

    • Ho Rob,
      Thank you for the comment.

      That would be pretty easy. I am writing a post and hoping to publish tomorrow with details. the plugin has a simple modular structure, so you can extend the BPSimpleBlogPostEditForm class and override the save method(we can test for our restrictions, and if everything is fine, just call parents save method to save the data) .

      Please allow me 1-2 days for the post.

      Thanks
      Brajesh

    • I have both things working. I see the pics have uploaded in my media library but they don't appear on the post.

    • I am also having problem with uploading images to post! Can you help me please!
      Where should I enable the attachments?

    • Hi Rob,
      No problem. I am looking for the enhancement ideas for Buddyblog, so your Idea is most welcome 🙂

  • I still did not figure it out how to view images in post? Can you help me? And for the form registration where shall I put the above text? In which file?
    Thank you

  • Great!

  • Hi Brajesh

    I noticed that tags disappear from the post form once they have been used. I've raised an issue over at the GitHub repository which details the steps to go through in order to replicate the issue:
    https://github.com/sbrajesh/bp-simple-front-end-post/issues/3

  • Hi Brajesh

    Apologies, please close the GitHub issue, i've resolved the problem. Was a problem with my theme's CSS.

  • Hi Brajesh on a different note, my bloggers have been asking how they can delete post comments via the front end. I notice there is a post delete button which they can use to delete the whole post. Is there a delete button for each comment?

  • Is there an example available which shows how to use custom fields with Simple Front End Post?

  • Hi, ive seen many similar questions. For safety's purpose, i would like configure the plugin with a step by step tut. Where can I find it?

    • Hi,
      Do you want to use it with BuddyBlog or Blog categories for groups? If yes, Just install and activate, there is nothing much to do in that case. If you are planning to use it independently, please let me know and i will provide some example.