Gnanasekaran Loganathan
Forum Replies Created
-
Yes, I got it. I got the solution. I wrote custom endpoint instead of using core.
Forum: Plugins
In reply to: [New User Approve] Role based approvalThere is a two reason,
1. your website not calling auto_approve_user when user regiter
2. You could not get $user_id in auto_approve_user() function.you can manually check with below action,
do_action( ‘new_user_approve_approve_user’, $user_id );Forum: Plugins
In reply to: [JWT Authentication for WP REST API] Enable HTTP Authorization HeaderNo need to enable HTTP Authorization Header in nginx server and windows server. By default its working, without do anything.
Forum: Plugins
In reply to: [JWT Authentication for WP REST API] Enable HTTP Authorization HeaderIs anyone know about this ?
https://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/
Not add in end of the wp-config.php file.
Forum: Fixing WordPress
In reply to: Fatal error: Allowed memory size of 41943040 bytes exhaustedhttps://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/
Not add in end of the wp-config.php file.
Forum: Plugins
In reply to: base64-encoded image upload using REST APIJust add below code in below mentioned function,
protected function upload_from_data( $data, $headers, $getFile )code :
// Save the file
$tmpfname = wp_tempnam( $filename );/*Base64 encoded image upload*/
$base64_string = explode(‘,’, $getFile);
fwrite( $fp, base64_decode($base64_string[1]));
fclose( $fp );Forum: Plugins
In reply to: Change URL namespaceI used below hook.
/**
* Modify url base from wp-json to ‘api’
*/
add_filter( ‘rest_url_prefix’, ‘egr_magnificent_api_slug’);function egr_magnificent_api_slug( $slug ) {
return ‘mg’;
}Forum: Fixing WordPress
In reply to: programmatically htaccess overwrite is good practice@stephencottontail I am not any plugin, Generally I have this doubt, This is good or not?
Forum: Plugins
In reply to: http status code in wp rest apiUse below function we can send HTTP status code
return new WP_REST_Response($posts, 200);
EX :
$return = new WP_Error( ‘rest_cannot_edit_others’, __( ‘You are not allowed to create posts as this user.’ ), array( ‘status’ => rest_authorization_required_code() ) );
$egr_reponse = array(‘error’ => $return->get_error_message());
$code = $return->get_error_code();
$status = $return->get_error_data($code);
$status_code = $status[‘status’];
return new WP_REST_Response($egr_reponse, $status_code);Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Change “wp-json” nameYou can use the rest_url_prefix filter to change wp-json for v2, or the equivalent json_url_prefix filter to change the base for v1.
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Change “wp-json” name@djibs13, Did you got answer?
Forum: Plugins
In reply to: [JWT Authentication for WP REST API] jwt_auth_bad_configI change the position of below lines before ” define(‘WP_DEBUG’, true); ” Its working fine now for this error.
define(‘JWT_AUTH_SECRET_KEY’, ‘JWT is not configurated properly’);
define(‘JWT_AUTH_CORS_ENABLE’, true);Forum: Plugins
In reply to: [WP REST API (WP API)] create attachment@goharika add in header Content-Disposition
Content-Disposition : attachment; filename=”imagename.jpg”
Forum: Plugins
In reply to: [WP REST API (WP API)] create attachment@goharika I got the same error, Did you got the solution.