Plugin Directory

Changeset 3214991


Ignore:
Timestamp:
12/30/2024 06:08:31 PM (15 months ago)
Author:
snsweetstack
Message:

Version 1.3.11

Location:
writerx/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • writerx/trunk/includes/endpoints.php

    r3206849 r3214991  
    155155  );
    156156
    157   // Register REST API endpoint for creating a new user
     157  // Сreate a new user
    158158  register_rest_route(
    159159    'writerx/v1',
     
    166166  );
    167167
    168   // Register REST API endpoint for updating user
     168  // Update user
    169169  register_rest_route(
    170170    'writerx/v1',
     
    177177  );
    178178
    179   // Register REST API route for checking user by email
     179  // Check user by email
    180180  register_rest_route(
    181181    'writerx/v1',
     
    187187    )
    188188  );
     189
     190  // Get the plugin version
     191  register_rest_route(
     192    'writerx/v1',
     193    '/get-version',
     194    array(
     195      'methods' => 'GET',
     196      'callback' => 'writerx_get_plugin_version',
     197      'permission_callback' => 'writerx_permission_callback',
     198    )
     199  );
     200
     201  // Get site timezone
     202  register_rest_route(
     203    'writerx/v1',
     204    '/get-site-timezone',
     205    array(
     206      'methods' => 'GET',
     207      'callback' => 'writerx_get_site_timezone',
     208      'permission_callback' => 'writerx_permission_callback',
     209    )
     210  );
     211
    189212}
    190213
  • writerx/trunk/includes/get-users.php

    r3206849 r3214991  
    77// Function to get a list of users with their roles, email, avatar, biography, and nickname
    88function writerx_get_users() {
     9  // Get all users who can publish posts
    910  $users = get_users(array(
    10     'role__in' => array('author'), // Include only users with these roles
     11    'capability__in' => array('publish_posts'), // Filter users with the capability to publish posts
    1112  ));
     13
    1214  $formatted_users = array();
    1315
     
    2123    $nickname = get_user_meta($user->ID, 'nickname', true);
    2224
     25    // Get the user roles (WordPress stores roles as an array)
     26    $roles = $user->roles;
     27    $role_name = !empty($roles) ? $roles[0] : null; // Use the first role if available
     28
    2329    $formatted_user = array(
    2430      'ID'       => $user->ID,
     
    2834      'avatar'   => $avatar_url, // Return custom avatar URL or null
    2935      'bio'      => $bio,        // Return the user's biography
     36      'role'     => $role_name,  // Return the user's role
    3037    );
     38
    3139    $formatted_users[] = $formatted_user;
    3240  }
  • writerx/trunk/readme.txt

    r3206849 r3214991  
    44Requires at least: 5.0
    55Tested up to: 6.7
    6 Stable tag: 1.3.10
     6Stable tag: 1.3.11
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3737
    3838== Changelog ==
     39
     40= 1.3.11 =
     41* Added consideration of the site's time zone when publishing delayed posts.
    3942
    4043= 1.3.10 =
  • writerx/trunk/writerx.php

    r3206849 r3214991  
    33Plugin Name: WriterX
    44Description: Enables connection with your WriterX account to generate content at scale
    5 Version: 1.3.10
     5Version: 1.3.11
    66Author: Astoria Company
    77Author URI: https://writerx.ai/
     
    5050include_once(plugin_dir_path(__FILE__) . 'includes/update-user.php');
    5151include_once(plugin_dir_path(__FILE__) . 'includes/check-user-email.php');
     52include_once(plugin_dir_path(__FILE__) . 'includes/get-plugin-version.php');
     53include_once(plugin_dir_path(__FILE__) . 'includes/get-site-timezone.php');
    5254
    5355// Function to generate the code upon plugin activation
Note: See TracChangeset for help on using the changeset viewer.