Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $attr = shortcode_atts(array(
- 'ad' => ''
- ), $attributes);
- $error = false;
- if ( !isset($_GET['ad']) ) {
- $post_id = 0;
- } else {
- $post_id = $_GET['ad'];
- }
- if ( current_user_can('manage_options') ) {
- $post_status= 'publish';
- } else {
- $post_status= 'pending';
- }
- if ( $attr['ad'] == 0 ) {
- $post_id = 'new_post';
- $submit_button = __('Submit profile', 'dvp');
- $updated_message = __('Your ad is successfully submitted. We will review it a.s.a.p.', 'dvp');
- $post_status = $post_status;
- } else {
- $post_id = $attr['ad'];
- $submit_button = __('Update profile', 'dvp');
- $updated_message = __('Your ad is successfully updated. We will review it a.s.a.p.', 'dvp');
- $post_status = $post_status;
- }
- // count posts for current user
- // if posts > 1, create notice
- return acf_form(array(
- 'post_id' => $post_id,
- // 'post_title' => true,
- // 'post_content' => true,
- 'submit_value' => $submit_button,
- 'updated_message' => $updated_message,
- 'new_post' => array(
- 'post_type' => 'escort',
- 'post_status' => $post_status
- )
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement