Plugin Directory

Changeset 3445577


Ignore:
Timestamp:
01/23/2026 12:35:59 PM (2 months ago)
Author:
codecanel
Message:

Fix: Social post-data showing issue fixed

Location:
writerush
Files:
639 added
3 edited

Legend:

Unmodified
Added
Removed
  • writerush/trunk/includes/REST/SocialPosts/SocialPostController.php

    r3442506 r3445577  
    375375
    376376    /**
    377      * Retrieves a single social post by ID with schedule data.
     377     * Retrieves a single social post by ID.
    378378     *
    379379     * @param WP_REST_Request $request The REST request object.
     
    394394        global $wpdb;
    395395
    396         // Fetch the social post with schedule data from both tables.
     396        // Fetch the social post from the database.
    397397        $social_post = $wpdb->get_row(
    398398            $wpdb->prepare(
    399                 "SELECT sp.*,
    400                         ps.id as schedule_id,
    401                         ps.type as schedule_type,
    402                         ps.post_id as schedule_post_id,
    403                         ps.scheduled,
    404                         ps.created_at as schedule_created_at,
    405                         ps.updated_at as schedule_updated_at
    406                  FROM {$wpdb->prefix}writerush_social_posts sp
    407                  LEFT JOIN {$wpdb->prefix}writerush_posts_schedules ps ON sp.social_post_id = ps.post_id
    408                  WHERE sp.social_post_id = %d",
     399                "SELECT * FROM {$wpdb->prefix}writerush_social_posts WHERE social_post_id = %d",
    409400                $id
    410401            ),
     
    423414        $social_post['post_params'] = json_decode( $social_post['post_params'], true );
    424415        $social_post['post_data']   = json_decode( $social_post['post_data'], true );
    425 
    426         // Extract and organize schedule data.
    427         $schedule_data = null;
    428         if ( ! empty( $social_post['scheduled'] ) ) {
    429             $schedule_data = array(
    430                 'schedule_id'      => $social_post['schedule_id'],
    431                 'schedule_type'    => $social_post['schedule_type'],
    432                 'schedule_post_id' => $social_post['schedule_post_id'],
    433                 'scheduled'        => $social_post['scheduled'],
    434                 // 'schedule_created_at' => $social_post['schedule_created_at'],
    435                 // 'schedule_updated_at' => $social_post['schedule_updated_at'],
    436             );
    437         }
    438 
    439         // Remove schedule fields from main social post data.
    440         unset(
    441             $social_post['schedule_id'],
    442             $social_post['schedule_type'],
    443             $social_post['schedule_post_id'],
    444             $social_post['scheduled'],
    445             $social_post['schedule_created_at'],
    446             $social_post['schedule_updated_at']
    447         );
    448 
    449         // Add schedule data to the response.
    450         $social_post['schedule_data'] = $schedule_data;
    451416
    452417        return new WP_REST_Response(
  • writerush/trunk/readme.txt

    r3442506 r3445577  
    66Tested up to: 6.9
    77Requires PHP: 7.4
    8 Stable tag: 1.0.4
     8Stable tag: 1.0.5
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    255255
    256256== Changelog ==
     257= 1.0.5 - January 23, 2026 =
     258* Fix: Social post-data showing issue fixed
     259
    257260= 1.0.4 - January 19, 2026 =
    258261* One Click blog module development
     
    288291
    289292== Upgrade Notice ==
     293= 1.0.5 - January 23, 2026 =
     294* Fix: Social post-data showing issue fixed
     295
    290296= 1.0.4 - January 19, 2026 =
    291297* One Click blog module development
  • writerush/trunk/writerush.php

    r3442506 r3445577  
    44 * Plugin URI: https://writerush.ai
    55 * Description: Create authentic AI content in your brand voice. Generate blogs, social post captions & images - all from WordPress, without the tool-switching chaos.
    6  * Version: 1.0.4
     6 * Version: 1.0.5
    77 * Author: codecanel
    88 * Author URI: https://codecanel.com
     
    3737     * @var string
    3838     */
    39     public $version = '1.0.4';
     39    public $version = '1.0.5';
    4040
    4141    /**
Note: See TracChangeset for help on using the changeset viewer.