upload images on front by user using form

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’, ‘post_status’ => … Read more

wp_insert_post() get Fatal Error from Plugin

So If I understand correctly you are creating a custom import plugin to wordpress outside the normal wordpress scope. Therefore you don’t have access to the functions inside .pluggable.php like is_user_logged_in you can redefine them in your plugin or you can just use require_once( ABSPATH . “wp-includes/pluggable.php” ); You will also not be able to … Read more

Fire a hook programmatically

To fire a hook you can use following functions: do_action – executes a hook created by add_action. do_action_ref_array – execute functions hooked on a specific action hook, specifying arguments in an array. This function is identical to do_action, but the arguments passed to the functions hooked to $tag are supplied using an array. If you … Read more

Yet another wp_insert_post infinite loop. What is wrong?

the problem lies with user capability when one use wp_insert_post to give other user the ability to insert post into WordPress. wp_insert_post uses the method current_user_can to check whether the given user has the capability to publish a post. After that i too have no idea what went wrong. However, this only happen when you … Read more