[wp-trac] [WordPress Trac] #55129: WP REST API - Updating "status" field on a "post" from "future" to "publish" does not work

WordPress Trac noreply at wordpress.org
Thu Feb 10 17:16:22 UTC 2022


#55129: WP REST API - Updating "status" field on a "post" from "future" to
"publish" does not work
--------------------------+------------------------------
 Reporter:  mcmwebsol     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  REST API      |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by mcmwebsol):

 I switched to using wp_remote_post() using basic auth, changed the active
 theme to Twenty Twenty-Two, and deactivated all plugins but still the
 status will not change.  It's possible it has something to do with the WP
 Engine hosting environment though.

 Also, there's nothing in the error log.

 PHP code is below:
 <?php
 /** Loads the WordPress Environment and Template */
 require('./wp-config.php');

 $siteURL = 'https://subdomain.wpengine.com';
 $url = $siteURL.'/wp-json/wp/v2/posts/3302';
 $data = array(
   'status'  => 'publish'
 );
 $username = 'user';
 $password = 'pass';

 $args = array(
   'method'      => 'POST',
   'timeout'     => 45,
   'headers'     => array(
                      'Authorization' => 'Basic ' . base64_encode(
 $username . ':' . $password ),
                      'Content-Type: multipart/form-data'
                    ),
   'body'        => json_encode($data)
 );

 $resp = wp_remote_post($url, $args);
 if ( is_wp_error( $resp ) )
   print " Error: ".$resp->get_error_message();
 else
   print_r($resp);
 ?>

 Site health status report is below:

 `
 ### wp-core ###

 version: 5.9
 site_language: en_US
 user_language: en_US
 timezone: America/Chicago
 permalink: /%postname%/
 https_status: true
 multisite: false
 user_registration: 0
 blog_public: 0
 default_comment_status: open
 environment_type: production
 user_count: 22
 dotorg_communication: true

 ### wp-paths-sizes ###

 wordpress_path: /nas/content/live/sitehere
 wordpress_size: 146.27 MB (153377539 bytes)
 uploads_path: /nas/content/live/sitehere/wp-content/uploads
 uploads_size: 1.81 GB (1940542861 bytes)
 themes_path: /nas/content/live/sitehere/wp-content/themes
 themes_size: 12.66 MB (13270757 bytes)
 plugins_path: /nas/content/live/sitehere/wp-content/plugins
 plugins_size: 221.73 MB (232501723 bytes)
 database_size: 64.22 MB (67338240 bytes)
 total_size: 2.24 GB (2407031120 bytes)

 ### wp-dropins (2) ###

 advanced-cache.php: true
 object-cache.php: true

 ### wp-active-theme ###

 name: Twenty Twenty-Two (twentytwentytwo)
 version: 1.0
 author: the WordPress team
 author_website: https://wordpress.org/
 parent_theme: none
 theme_features: core-block-patterns, post-thumbnails, responsive-embeds,
 editor-styles, html5, automatic-feed-links, block-templates, widgets-
 block-editor, wp-block-styles, editor-style
 theme_path: /nas/content/live/sitehere/wp-content/themes/twentytwentytwo
 auto_update: Disabled

 ### wp-themes-inactive (4) ###
 SCRUBBED

 ### wp-mu-plugins (6) ###

 Force Strong Passwords - WPE Edition: version: 1.8.0, author: Jason Cosper
 WPE ElasticPress Autosuggest Logger: version: 1.0.0, author: WP Engine
 WP Engine Cache Plugin: version: 1.0.5, author: WP Engine
 WP Engine Seamless Login Plugin: version: 1.5.5, author: WP Engine
 WP Engine Security Auditor: version: 1.0.10, author: wpengine
 WP Engine System: version: 5.0.1, author: WP Engine

 ### wp-plugins-inactive (47) ###
 SCRUBBED


 ### wp-media ###

 image_editor: WP_Image_Editor_Imagick
 imagick_module_version: 1687
 imagemagick_version: ImageMagick 6.9.7-4 Q16 x86_64 20170114
 http://www.imagemagick.org
 imagick_version: 3.5.1
 file_uploads: File uploads is turned off
 post_max_size: 100M
 upload_max_filesize: 50M
 max_effective_size: 50 MB
 max_file_uploads: 20
 imagick_limits:
         imagick::RESOURCETYPE_AREA: 137 MB
         imagick::RESOURCETYPE_DISK: 1073741824
         imagick::RESOURCETYPE_FILE: 6144
         imagick::RESOURCETYPE_MAP: 512 MB
         imagick::RESOURCETYPE_MEMORY: 256 MB
         imagick::RESOURCETYPE_THREAD: 1
 imagemagick_file_formats: 3FR, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA,
 BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP,
 CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT,
 DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI,
 EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4,
 GIF, GIF87, GRADIENT, GRAY, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM,
 HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL,
 ISOBRL6, JBG, JBIG, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K25, KDC, LABEL,
 M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO,
 MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF,
 OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX,
 PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PICON, PICT, PIX, PJPEG,
 PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW,
 PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB,
 RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX,
 SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA,
 THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY,
 VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WMF, WMV, WMZ, WPG, X, X3F, XBM,
 XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
 gd_version: 2.2.5
 gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
 ghostscript_version: unknown

 ### wp-server ###

 server_architecture: Linux 5.4.0-1052-gcp x86_64
 httpd_software: Apache
 php_version: 7.4.26 64bit
 php_sapi: apache2handler
 max_input_variables: 10000
 time_limit: 3600
 memory_limit: 512M
 max_input_time: 3600
 upload_max_filesize: 50M
 php_post_max_size: 100M
 curl_version: 7.58.0 OpenSSL/1.1.1
 suhosin: false
 imagick_availability: true
 pretty_permalinks: true
 htaccess_extra_rules: false

 ### wp-database ###

 extension: mysqli
 server_version: 5.7.36-39-log
 client_version: mysqlnd 7.4.26
 max_allowed_packet: 16777216
 max_connections: 500

 ### wp-constants ###

 WP_HOME: undefined
 WP_SITEURL: undefined
 WP_CONTENT_DIR: /nas/content/live/sitehere/wp-content
 WP_PLUGIN_DIR: /nas/content/live/sitehere/wp-content/plugins
 WP_MEMORY_LIMIT: 40M
 WP_MAX_MEMORY_LIMIT: 512M
 WP_DEBUG: false
 WP_DEBUG_DISPLAY: true
 WP_DEBUG_LOG: false
 SCRIPT_DEBUG: false
 WP_CACHE: true
 CONCATENATE_SCRIPTS: undefined
 COMPRESS_SCRIPTS: undefined
 COMPRESS_CSS: undefined
 WP_ENVIRONMENT_TYPE: Undefined
 DB_CHARSET: utf8
 DB_COLLATE: utf8_unicode_ci

 ### wp-filesystem ###

 wordpress: writable
 wp-content: writable
 uploads: writable
 plugins: writable
 themes: writable
 mu-plugins: writable

 `

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55129#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list