Advertisement
Guest User

frontend-submit

a guest
Jul 19th, 2017
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. Template Name: Artist Signup-test
  5. */
  6.  
  7. // =============================================================================
  8. // VIEWS/INTEGRITY/WP-SINGLE.PHP
  9. // -----------------------------------------------------------------------------
  10. // Single artist post output for Integrity.
  11. // =============================================================================
  12.  
  13. $fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );
  14.  
  15. ?>
  16.  
  17. <?php
  18.  
  19. if ( is_user_logged_in() || current_user_can('publish_posts') ) { // Execute code if user is logged in
  20. acf_form_head();
  21. wp_deregister_style( 'wp-admin' );
  22. }
  23. get_header();
  24.  
  25. ?>
  26.  
  27. <div id="content" style="width: 70%; margin:0 auto;">
  28.  
  29.  
  30. <?php
  31. if ( ! ( is_user_logged_in() || current_user_can('publish_posts') ) ) {
  32. echo '<p>You must be a registered author to post.</p>';
  33. } else {
  34. acf_form(array(
  35. 'post_id' => 'new_post',
  36. 'field_groups' => array(478,5977), // Used ID of the field groups here.
  37. 'post_title' => true, // This will show the title filed
  38. 'post_content' => true, // This will show the content field
  39. 'form' => true,
  40. 'new_post' => array(
  41. 'post_type' => 'artist',
  42. 'post_status' => 'publish' // You may use other post statuses like draft, private etc.
  43. ),
  44. 'return' => '%post_url%',
  45. 'submit_value' => 'Submit Artist Profile',
  46. ));
  47. }
  48. ?>
  49.  
  50. </div>
  51.  
  52. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement