Tips to Customize Q and A?

I'm working on a site where the Q&A includes more fields than the default, and where the order of the entry of the fields is also non-default. So for example we may add an extra text field, a numeric field, and a drop-down selection for another text field. The category will go above the title field and we might not even use the description. Of course the pages that enter and display questions will need to be modified, and related answers may need modification as well.

I know these are virtual pages, I've already modified some of the code.
I'd like to know if there is a general guide somewhere for modifying a post type like 'question' and making these other enhancements. Blog? Video? I'm taking the day today (ongoing effort really) to research this topic and look for resources and tips.

For example, moving a field is easy and doesn't affect functionality. But:
- I don't know yet where to modify the form submission code that populates and saves the post type.
- I don't know what other considerations there are for this sort of "sub-classing".
- I don't know how badly I'm going to fork my code from the base and preclude updates.

I really wish this plugin were implemented differently, where 'question' is a common custom post type, editable with other common plugins, and where the UI were rendered using common templates of the WP hierarchy. Is there anything we can do to re-align this plugin in that direction without losing the value-add of the whole Q&A concept?

Thanks!

    Rupok

    Hi Tony, thanks for asking.

    I'd like to know if there is a general guide somewhere for modifying a post type like 'question' and making these other enhancements. Blog? Video?

    "Questions" are not regular custom post type, you are right. We have a full usage guide of this plugin here: https://premium.wpmudev.org/project/qa-wordpress-questions-and-answers-plugin/#product-usage but I'm afraid, that doesn't include development documentation. I'm sorry, I can't confirm you any reference regarding modifying this as this is a completely custom architecture, but our plugin developer can give you best idea regarding this. Same goes for your three questions.

    So I'm pinging our developer for his valuable feedback here. I believe he will come up with suggestions that will help you to modify the structure as you want.

    Please keep in mind, our developers work round the clock and they have to deal with lots of critical issues and other things. So it may take a little while for them to check this and provide a workaround.

    I really wish this plugin were implemented differently, where 'question' is a common custom post type, editable with other common plugins, and where the UI were rendered using common templates of the WP hierarchy.

    This sounds to be a nice idea. So I'm moving your thread to our Features and Feedback section. More people liking this idea, more chances our developers will work on this and will include this feature in our future releases.

    Have a nice day. Cheers!
    Rupok

    Tony

    this is a completely custom architecture

    I'm getting a sense of something I'm not liking here. WPMUDEV plugins and themes are going down a non-standard path, making maintenance difficult, custom documentation required, and straining developer resources. I encountered the same scenario with Upfront. Don't get me wrong, I appreciate the services here and remain a happy client. But you guys need to ask yourselves some questions at a management level. Like :
    - If we write non-standard code and it's not intentional, why are we letting this go through multiple releases in the field.
    - If we write non-standard code intentionally, what are the costs to the business and the clients.
    - Are we building in proprietary value-add? Or just trying something different and hoping people will like it?

    Are you guys on a trend to do everything differently, as though your new way is somehow better than the way everyone else does things? I'm seeing "different" as a problem, not as a positive benefit here. I'm not seeing any brand differentiation being advertised as being a feature so I'm guessing this is all a combination of experiment and accident. I'm seeing Microsoft with IE versus Firefox, Safari, and everyone else. We all know what a pain the browser wars have been for the last 20 years. Are you guys trying to repeat that? Uh, you're not big enough to do that and even if you were there's historical evidence here that the approach doesn't work with user/developers.

    So just to come back on-topic... I'm not looking for a redevelopment of this plugin or a feature enhancement to support custom fields. I am eager to hear from a developer the basic approach that we should take to add fields and modify the display. Or if it's just brute-force on non-standard code then anyone can probably work it out. In other words, is a developer going to walk us through a new intentional way of coding a plugin, or is the one guy who is familiar with this code going to tell us what he knows about code that was just thrown together and never really "designed"?

    Thanks as always.

    Kasia Swiderska

    Hello Tony,

    WPMUDEV plugins and themes are going down a non-standard path, making maintenance difficult, custom documentation required, and straining developer resources. I encountered the same scenario with Upfront.

    Upfront cannot be the same as other themes - to give our members all of its features (like editor with drag and drop) it had to be written in different way.
    Most of our plugins are created in standard way - some that were not (like Membership Premium) were even rewritten to be properly coded (Membership 2 pro). At the moment our plugins are not going non-standard path - and Upfront would be one exception (and there was reason for that).
    We would love to have infinite resources to rewrite all of our plugins to be better coded, to fit standard way of doing things, but day has only 24h...
    I'm not arguing here that some of our plugins are not coded in standard way - but it is past - it's not something we are doing anymore.

    In other words, is a developer going to walk us through a new intentional way of coding a plugin, or is the one guy who is familiar with this code going to tell us what he knows about code that was just thrown together and never really "designed"?

    I have to admit I don't understand your requirement here. What do you mean by "new intentional way of coding a plugin"?
    Usually with that type of question developer can lead in right direction to change plugin code so it will work with modification you are requiring.
    Anyway - I'm pinging again developer because we did not still get his feedback. I'll keep you posted.

    kind regards,
    Kasia

    Tony

    Thanks Kasia - I'd like to backtrack a bit to keep this thread focused on Q&A. Sorry for the digressions.

    The Question post type derives from the PHP stdClass, it's not an extended wp_post. There seem to be a number of options for extending the question type. I'm hoping the developer can make some suggestions as to where and how to do this most elegantly so that there is little or no collision with future plugin updates. For example, I'd like to add an image/attachment, and a couple other simple field types.
    As described here, I'm also re-locating some functionality into a custom plugin. I can provide more specifics about Q&A if desired. But does it sound like I'm using a good approach for modifying this plugin? Specifically, I've modified the_question_form() to rearrange fields and that's where I'll be adding the custom fields.

    Uh, has anyone else made any significant changes to this plugin? It would be very helpful to see how others have approached this.

    Thanks!

    Ash

    Hi Tony

    To avoid collision with future update you need to work with hooks. You can check here: https://codex.wordpress.org/Plugin_API/Hooks

    So, you need to find out which hooks are available in the plugin you are editing. If there is not any hook available where you want to make changes, then you may ask the developer to add a hook in there or you edit the plugin code and make a note so that you can make the changes again update next update.

    Q&A is a stable plugin and not frequently updated unless there is a major security risk. So you can edit the plugin as per your need

    Have a good day!

    Cheers
    Ash