Tag Info

New answers tagged

1

You have to localize script by using wp_localize_script function. In the admin side ajaxurl is already available. But in front end you have to localize script to define ajaxurl. Example: wp_enqueue_script( 'custom-ajax-request', '/path/to/settings.js', array( 'jquery' ) ); wp_localize_script( 'custom-ajax-request', 'MyAjax', array( 'ajaxurl' => ...


0

Have you tried changing Line 83? Change 'post_type' => 'post', to 'post_type' => 'YOURCUSTOMCPT', See Codex article for wp_insert_post for reference - codex.wordpress.org/Function_Reference/wp_insert_post


-2

Did you try Gravity forms? http://www.gravityforms.com with this plugin http://wordpress.org/plugins/gravity-forms-custom-post-types/


-2

Ok.. so this is the solution, We need to include the file called pluggable.php correctly like this: EDIT: if(!is_admin()) { // Make sure it is not in the admin panel require_once('wp-includes/pluggable.php'); if(current_user_can('manage_options')) { // do stuff here } }


1

Apparently the function is not defined at the point of calling your code ..so wrap the code of yours in to a function and hook it to the init.



Top 50 recent answers are included