Changeset 3628743 for social-engine/trunk/classes/rest.php
- Timestamp:
- 07/30/2026 02:10:55 PM (3 months ago)
- File:
-
- 1 edited
-
social-engine/trunk/classes/rest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
social-engine/trunk/classes/rest.php
r3377846 r3628743 136 136 register_rest_route( $this->namespace, '/publish_now', array( 137 137 'methods' => 'POST', 138 'permission_callback' => '__return_true',138 'permission_callback' => array( $this->core, 'can_access_features' ), 139 139 'callback' => array( $this, 'rest_publish_now' ) 140 140 ) ); … … 815 815 } 816 816 817 $post_id = absint( $post_id ); 818 $post = get_post( $post_id ); 819 820 if ( !$post ) { 821 return new WP_REST_Response([ 822 'success' => false, 823 'message' => 'The post could not be found for the provided post id.', 824 ], 404 ); 825 } 826 827 if ( $post->post_type !== $this->core->get_social_post_type() ) { 828 return new WP_REST_Response([ 829 'success' => false, 830 'message' => 'The post exists but is not a social post (invalid post type).', 831 ], 400 ); 832 } 833 834 if ( !$this->core->can_access_moderation_features() ) { 835 return new WP_REST_Response([ 836 'success' => false, 837 'message' => 'Only an administrator or editor can publish this post.', 838 ], 403 ); 839 } 840 817 841 $thumbnail_ids = json_decode( get_post_meta( $post_id, 'sclegn_thumbnails', true ) ) ?? []; 818 842 $allowd_mimes = array_unique( array_values( $this->core->get_allowed_thumbnail_mimes() ) );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)