Plugin Directory

Changeset 2678011


Ignore:
Timestamp:
02/13/2022 05:38:44 PM (4 years ago)
Author:
allurewebsolutions
Message:

Release 3.7.0: updated custom api to return only post content

Location:
wp-post-modal
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-post-modal/tags/3.7.0/public/class-wp-post-modal-public.php

    r2674688 r2678011  
    189189            // render shortcodes from Visual Composer
    190190            $post['post_content'] = apply_filters('the_content', $post['post_content']);
    191             $response = new WP_REST_Response($post);
     191            $filtered_post = array_intersect_key($post, array_flip(array('post_content')));
     192
     193            $response = new WP_REST_Response($filtered_post);
    192194        } else {
    193195            $response = new WP_Error('post_empty', 'Post is empty', array('status' => 404));
  • wp-post-modal/trunk/public/class-wp-post-modal-public.php

    r2674688 r2678011  
    189189            // render shortcodes from Visual Composer
    190190            $post['post_content'] = apply_filters('the_content', $post['post_content']);
    191             $response = new WP_REST_Response($post);
     191            $filtered_post = array_intersect_key($post, array_flip(array('post_content')));
     192
     193            $response = new WP_REST_Response($filtered_post);
    192194        } else {
    193195            $response = new WP_Error('post_empty', 'Post is empty', array('status' => 404));
Note: See TracChangeset for help on using the changeset viewer.