Tag Info

New answers tagged

0

Beside the fact that your code could be better, here is a simple solution. Using output buffers will write everything to a variable. <?php ob_start(); ?> <form id="new_post" name="new_post" method="post" action="" class="submit-form" enctype="multipart/form-data"> <fieldset class="tax"> <label for="class">Class ...


-1

Why not just use Gravity Forms with ACF. It does exactly what you're suggesting -- and I've used it a number of times on client sites with great success.


0

If all you do is update ACF fields with your form, why not use the built-in function to generate the form? Create a new ACF field for the images, or simply use the Gallery field type, then display the form using acf_form: <?php acf_form(array( 'post_id' => 'new_post', 'new_post' => array( 'post_type' => 'vendre', ...


0

Had a similar problem, short blog entries found by google etc. showed the comment reply title instead of the blog entry content. This solution buffers the comment form html and replaces the <h3 id="reply-title"..> with another tag before printing it: function my_comment_form_before() { ob_start(); } add_action( 'comment_form_before', ...


2

I agree with you, it's somewhat an unexpected user experience, when you're redirected after updating a term. Additionally there seems to be no error handling on the form itself, if you try to make some errors, like deleting the term name and slug, it will not show any errors, just ignore your changes and redirect. You can try the following to stay on the ...


1

Here are two solutions that can be placed in functions.php. They are not really what I need, but perhaps they are of some use to someone else. Solution 1 Can be used to close comments for certain posts: function close_comment_form( $open, $post_id ) { $post = get_post( $post_id ); if( $post->post_type == 'post' ) { return false; } ...


1

The comments_open() function is used, both by core and typically themes to determine status for specific post. It has filter of same name for result, which you can use to manipulate it individually for the post. comment_form() won't actually output form if check is false and fire comment_form_comments_closed action in such case. Native WP themes, shipped ...


1

It is no only name or email problem, as Tom wrote. I had problem even with input field with name attribute same as one of my Custom Post Types. For example: ... <input type="text" name="movie"> ... And when having registered CPT "movie" somewhere else, your form submitting will end with 404 error. Conclusion: Don't use name, email and any ...


0

WordPress.org UI Style Guide site has some reference materials, including those on Box Formats and Forms. As far as I remember it's not consistently maintained or considered especially canonical source. In practice elements are often done after studying current state of actual admin markup.


0

I wrote a plugin to do validation for Advanced Custom Fields. It lets you do server side validation using either PHP code or regex, jQuery masked inputs, as well as unique value settings. Check the Support page for the beta version that support ACF5. http://wordpress.org/extend/plugins/validated-field-for-acf/



Top 50 recent answers are included