Changeset 10224
- Timestamp:
- 09/01/2020 02:54:02 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-release-confirmation.php
r10221 r10224 36 36 37 37 // Save the selection. 38 static function save_post( $post_id ) { 38 static function save_post( $post ) { 39 $post = get_post( $post ); 40 39 41 if ( 42 $post && 40 43 isset( $_REQUEST['release_confirmation'] ) && 41 44 is_numeric( $_REQUEST['release_confirmation'] ) && 42 current_user_can( 'plugin_admin_edit', $post _id)45 current_user_can( 'plugin_admin_edit', $post->ID ) 43 46 ) { 44 if ( $_REQUEST['release_confirmation'] == get_post_meta( $post_id, 'release_confirmation', true ) ) { 45 // Do nothing, it's all good. 46 } else if ( 0 == $_REQUEST['release_confirmation'] ) { 47 $current = (int) $post->release_confirmation; 48 $new = (int) $_REQUEST['release_confirmation']; 49 50 if ( $new == $current ) { 51 return; 52 } 53 54 if ( 0 == $new ) { 47 55 // Disable 48 Tools::audit_log( 'Plugin release confirmation disabled.', $post _id);49 update_post_meta( $post _id, 'release_confirmation', 0);56 Tools::audit_log( 'Plugin release confirmation disabled.', $post ); 57 update_post_meta( $post->ID, 'release_confirmation', $new ); 50 58 51 59 } else { … … 53 61 $request = new WP_REST_Request( 54 62 'POST', 55 '/plugins/v1/plugin/' . get_post( $post_id )->post_name . '/release-confirmation'63 '/plugins/v1/plugin/' . $post->post_name . '/release-confirmation' 56 64 ); 57 65 $request->set_param( 58 66 'confirmations_required', 59 (int) $_REQUEST['release_confirmation']67 $new 60 68 ); 61 69
Note: See TracChangeset
for help on using the changeset viewer.