PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.1
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.1
6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 All 155 releases
← All changes | class/class-mainwp-post-handler.php +33 -2 6.1 → 6.2.1 View file →
@@ -80,8 +80,9 @@
80 80 $this->add_action( 'mainwp_widgets_order', array( &$this, 'ajax_widgets_order' ) );
81 81 $this->add_action( 'mainwp_save_settings', array( &$this, 'ajax_mainwp_save_settings' ) );
82 82 $this->add_action( 'mainwp_guided_tours_option_update', array( &$this, 'ajax_guided_tours_option_update' ) );
83 83 $this->add_action( 'mainwp_help_modal_content_update', array( &$this, 'ajax_mainwp_help_modal_content_update' ) );
84 + $this->add_action( 'mainwp_widgets_connections_status_details_display_rows', array( MainWP_Connection_Status::instance(), 'ajax_display_rows' ) );
84 85
85 86 // Page: Recent Posts.
86 87 if ( \mainwp_current_user_can( 'dashboard', 'manage_posts' ) ) {
87 88 $this->add_action( 'mainwp_post_unpublish', array( &$this, 'mainwp_post_unpublish' ) );
@@ -538,8 +539,21 @@
538 539 $this->secure_request( 'mainwp_notice_status_update' );
539 540
540 541 // phpcs:disable WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
541 542 $no_id = isset( $_POST['notice_id'] ) ? sanitize_text_field( wp_unslash( $_POST['notice_id'] ) ) : false;
543 +
544 + if ( ! empty( $_POST['short_term'] ) ) {
545 + if ( empty( $no_id ) ) {
546 + die( 'invalid' );
547 + }
548 +
549 + $keys = explode( ';', $no_id );
550 + foreach ( $keys as $key ) {
551 + MainWP_Utility::dismiss_short_term_notice( $key );
552 + }
553 + die( 'dismissed' );
554 + }
555 +
542 556 if ( 'mail_failed' === $no_id ) {
543 557 MainWP_Utility::update_option( 'mainwp_notice_wp_mail_failed', 'hide' );
544 558 die( 'ok' );
545 559 }
@@ -1070,10 +1084,10 @@
1070 1084 echo wp_json_encode( $ret );
1071 1085 exit;
1072 1086 }
1073 1087
1074 - $client_id = 0; // 0 general fields.
1075 - $deleted_count = 0;
1088 + $client_id = 0; // 0 general fields.
1089 + $deleted_count = 0;
1076 1090 foreach ( $field_ids as $field_id ) {
1077 1091 if ( MainWP_DB_Client::instance()->delete_client_field_by( 'field_id', $field_id, $client_id ) ) {
1078 1092 ++$deleted_count;
1079 1093 }
@@ -2005,8 +2019,25 @@
2005 2019 $results = array();
2006 2020 }
2007 2021
2008 2022 wp_send_json( $results );
2023 + }
2024 +
2025 + /**
2026 + * Handle self_connect action.
2027 + */
2028 + public function ajax_self_connect() {
2029 +
2030 + $mainwp_run = isset( $_POST['mainwp_run'] ) ? sanitize_text_field( wp_unslash( $_POST['mainwp_run'] ) ) : ''; // phpcs:ignore -- NOSONAR -ok.
2031 +
2032 + if ( 'self_connect' !== $mainwp_run ) {
2033 + status_header( 400 );
2034 + exit;
2035 + }
2036 +
2037 + MainWP_System_Utility::instance()->handle_self_connect();
2038 +
2039 + exit;
2009 2040 }
2010 2041
2011 2042
2012 2043 /**