WordPress.org

Ready to get started?Download WordPress

Forums

Quick Post Widget
[resolved] Custom fields? (21 posts)

  1. clockwood
    Member
    Posted 4 years ago #

    How do you add wordpress Custom Fields to the quick-post form? I'm talking about accessing existing custom fields, not adding new ones. For example, I have a "Source URL" field that authors use to put the URL of articles they post, etc. It would be great to have this field available on the quick post form.

    Thanks for your work on this plugin. It's very helpful.

    http://wordpress.org/extend/plugins/quick-post-widget/

  2. inapan
    Member
    Plugin Author

    Posted 4 years ago #

    Hi clockwood,
    I will have to look in to it. If I can sort out how it works I can try to put in in a future release.
    Perry

  3. poulsen
    Member
    Posted 4 years ago #

    Fantastic widget, thank you!
    I'm also quite desperate to be able to add one of my custom fields to the widget. If anyone knows how, I'd be most grateful for your help!

  4. poulsen
    Member
    Posted 3 years ago #

    I've hardcoded it for now. @inapan if you haven't found a solution yet, this is what I did:
    in the quick-post-widget.php I put in the following code at line 394:

    <label for="quick_post_customfield" class="quick_post_label" style="<?php echo $label_style; ?>"><?php echo 'type your label to be displayed'; ?></label>
    						<br />
    						<input type="text" name="quick_post_customfield" id="quick_post_tags" style="<?php echo $post_tags_style; ?>" value="" />

    then on line 559 after echo "<meta http-equiv='Refresh' Content='1'; url='".$_SERVER['PHP_SELF']."'>"; I added:
    update_post_meta($post_id, 'build', $_POST['quick_post_customfield']);
    This solution is for a pure text custom field, and worked on my install, but use at own risk.

  5. poulsen
    Member
    Posted 3 years ago #

    oops, in the code for line 559 replace 'build' with the name of your custom field. Sorry about that!

  6. wordpress_expert
    Member
    Posted 3 years ago #

    Thanks a Bunch!!
    Above customfield thing in quick post widget works,

  7. zebradaddy
    Member
    Posted 3 years ago #

    I'm trying to use this fix (I need to show a custom field) but the syntax listed above (specifically the part line 559) isn't there.

    How do I add a custom field?

    THANKS!

  8. inapan
    Member
    Plugin Author

    Posted 3 years ago #

    @all
    The next version will have custom fields. They are working now but I'm still working on some other issues before I can release this new version.
    inapan

  9. NOKYARD
    Member
    Posted 3 years ago #

    On my site the Excerpt is more important than both the title and description. Is there any chance one of these additional fields will be for the Excerpt?

  10. inapan
    Member
    Plugin Author

    Posted 3 years ago #

    @nokyard

    Please mail me (address in the quick-post-widget.php file) to find out what it is exactly that you need.

    inapan

  11. inapan
    Member
    Plugin Author

    Posted 3 years ago #

    @all
    Just uploaded version 1.8 with the ability to use custom fields.

    @nokyard
    Version 1.8 also has an option to use the excerpt.

    inapan

  12. NOKYARD
    Member
    Posted 3 years ago #

    Thank you. The Excerpt field input works perfectly with the ability to add a custom label.

    Sadly, i am getting js errors which cause the Visual Editor to break. And, when the plugin is installed the TinyMCE editor in my Simple:Press Forum breaks. You both have the same philosophy regarding the use of WP's built in js libraries but i can't seem to get both versions of TinyMCE working at the same time (WP's TinyMCE editor works fine).

    http://highspeedhalo.net/

  13. inapan
    Member
    Plugin Author

    Posted 3 years ago #

    @NOKYARD,

    Sorry to hear about the TinyMCE problems. Could you send me an email (address in the quick-post-widget.php file) so we can work this out over mail? We'll post the solution here. Also, is it possible for you to set up an account for me with the ability to test the widget?
    I just regsistered on your site but I can't seem to find the widget.

    Thanks!
    inapan

  14. inapan
    Member
    Plugin Author

    Posted 3 years ago #

    @NOKYARD,

    Update: I managed to get both copies of TinyMCE working by changing in the quick-post-widget.php file the line which says

    wp_enqueue_script('tinymce', get_bloginfo('wpurl') . '/wp-includes/js/tinymce/tiny_mce.js');

    to

    wp_enqueue_script('tinymce', get_bloginfo('wpurl') . '/wp-content/plugins/simple-forum/editors/tinymce/tiny_mce.js');

    The Visual Editor of the Quick Post Widget loads with a different style and the language of the TinyMCE advanced theme doesn't load, but I think we can make it work by 'hacking'.

    By the way, Simple:Press, which is a beautiful plugin, uses it's own copy of TinyMCE (not the one shipped with WordPress).

    To be continued....

    inapan

  15. inapan
    Member
    Plugin Author

    Posted 3 years ago #

    @NOKYARD

    Another update:
    I tried a, I think dirty, hack and have both plugins work together.
    The only drawback is that you cannot have the Quick Post Widget displayed on the same page as the forum.
    I tried WordPress conditional tags but couldn't get it working. That's why I tried some server variables.

    The hack which worked for me: on line 1215 in version 1.8 of the quick-post-widget.php insert

    if ( '/wptest/forum/test-forum' != $_SERVER['REQUEST_URI'] ) {

    and end the block with a } (just above the } else { line.

    Of course you need to replace the url part with your own and perhaps modify it a bit (use a like construcion for instance).

    Again, this only works when the forum is on a page without sidebar or when for instance you use a plugin which conditionally shows widgets on certain pages.

    Anyone who has a more elegant solution: please respond.

    inapan

  16. NOKYARD
    Member
    Posted 3 years ago #

    Thank you i will give that a try right now.

    I am using a custom page template for the forum based on page.php, and another custom page template for my submission form based on page-with-sidebar.php so there should be no further conflicts. The widget, which i use for user submitted gaming video, will only display on the sidebar of page with the accompanying instructions.

    I must say here that it has been a long and bothersome search for a simple, elegant, and highly customizable plugin to accept user submissions. This is exactly the plugin that i and my staff have been waiting for as it fits our workflow perfectly.

  17. inapan
    Member
    Plugin Author

    Posted 3 years ago #

    @NOKYARD,

    Thanks for your response.
    If you're using the widget only on one page then you can of course rewrite the if-statement to match only for that particular page, but I'm sure you already thought of that.
    Please let me know if you were able to solve/hack it.

    inapan

  18. NOKYARD
    Member
    Posted 3 years ago #

    Still a bit confused on that. (sent an email)

    Are you saying to add
    /?page_id=3988' (Widget page)
    or
    '/?page_id=3805/' (Forum page)
    in place of '/wptest/forum/test-forum' ?

    And, do i still do the first hack?

    Also, when i edit quick-post-widget.php (tried 3 different editors) WP disables the plugin with an invalid plugin header error. Likely something i am doing wrong, but i have successfully hacked several other plugins.

  19. inapan
    Member
    Plugin Author

    Posted 3 years ago #

    @NOKYARD,

    Just sent you some mails. You don't need the first hack, and for the second hack I think the line could be:

    if ( strpos($_SERVER['REQUEST_URI'], 'page_id=3805') === false ) {

    Again, this is I think a dirty hack and it depends on your Permalink structure etc. (but it works for me).
    Anyone knows a better solution?

    inapan

  20. NOKYARD
    Member
    Posted 3 years ago #

    Thank you so very much inapan.

    The solutions you provided have fixed every issue i was having, and thanks for noticing the (very slight) conflict with the SP Authors plugin.

  21. inapan
    Member
    Plugin Author

    Posted 3 years ago #

    @NOKYARD,

    You're very welcome.
    Glad to know it's working now.
    Good luck!

    inapan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic