Changeset 3214991
- Timestamp:
- 12/30/2024 06:08:31 PM (15 months ago)
- Location:
- writerx/trunk
- Files:
-
- 4 edited
-
includes/endpoints.php (modified) (4 diffs)
-
includes/get-users.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
writerx.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
writerx/trunk/includes/endpoints.php
r3206849 r3214991 155 155 ); 156 156 157 // Register REST API endpoint for creatinga new user157 // Сreate a new user 158 158 register_rest_route( 159 159 'writerx/v1', … … 166 166 ); 167 167 168 // Register REST API endpoint for updatinguser168 // Update user 169 169 register_rest_route( 170 170 'writerx/v1', … … 177 177 ); 178 178 179 // Register REST API route for checkinguser by email179 // Check user by email 180 180 register_rest_route( 181 181 'writerx/v1', … … 187 187 ) 188 188 ); 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 189 212 } 190 213 -
writerx/trunk/includes/get-users.php
r3206849 r3214991 7 7 // Function to get a list of users with their roles, email, avatar, biography, and nickname 8 8 function writerx_get_users() { 9 // Get all users who can publish posts 9 10 $users = get_users(array( 10 ' role__in' => array('author'), // Include only users with these roles11 'capability__in' => array('publish_posts'), // Filter users with the capability to publish posts 11 12 )); 13 12 14 $formatted_users = array(); 13 15 … … 21 23 $nickname = get_user_meta($user->ID, 'nickname', true); 22 24 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 23 29 $formatted_user = array( 24 30 'ID' => $user->ID, … … 28 34 'avatar' => $avatar_url, // Return custom avatar URL or null 29 35 'bio' => $bio, // Return the user's biography 36 'role' => $role_name, // Return the user's role 30 37 ); 38 31 39 $formatted_users[] = $formatted_user; 32 40 } -
writerx/trunk/readme.txt
r3206849 r3214991 4 4 Requires at least: 5.0 5 5 Tested up to: 6.7 6 Stable tag: 1.3.1 06 Stable tag: 1.3.11 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 37 37 38 38 == Changelog == 39 40 = 1.3.11 = 41 * Added consideration of the site's time zone when publishing delayed posts. 39 42 40 43 = 1.3.10 = -
writerx/trunk/writerx.php
r3206849 r3214991 3 3 Plugin Name: WriterX 4 4 Description: Enables connection with your WriterX account to generate content at scale 5 Version: 1.3.1 05 Version: 1.3.11 6 6 Author: Astoria Company 7 7 Author URI: https://writerx.ai/ … … 50 50 include_once(plugin_dir_path(__FILE__) . 'includes/update-user.php'); 51 51 include_once(plugin_dir_path(__FILE__) . 'includes/check-user-email.php'); 52 include_once(plugin_dir_path(__FILE__) . 'includes/get-plugin-version.php'); 53 include_once(plugin_dir_path(__FILE__) . 'includes/get-site-timezone.php'); 52 54 53 55 // Function to generate the code upon plugin activation
Note: See TracChangeset
for help on using the changeset viewer.