• Hi,

    The code in the wp-includes/user.php file on line 3643 is not ready to be customized.

    I developed a plugin to meet the new privacy requirements. I created the Personal Data Correction option using the same structure that WordPress already offers for Data Export and Removal.

    I then need to customize the link that goes to ###MANAGE_URL###

    Using the user_request_confirmed_email_content filter I even get it right. But the problem of my error becomes this code:

    if ( 'export_personal_data' === $request->action_name ) {
    $manage_url = admin_url( 'export-personal-data.php' );
    } elseif ( 'remove_personal_data' === $request->action_name ) {
    $manage_url = admin_url( 'erase-personal-data.php' );
    }

    It only creates the $manage_url variable for the two case types that WordPress considers: export_personal_data and remove_personal_data

    And my custom case is rectify_personal_data

    When he tries to use this variable in the following code, the error occurs:

    $email_data = array(
    'request' => $request,
    'user_email' => $request->email,
    'description' => $action_description,
    'manage_url' => $manage_url,
    'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),
    'siteurl' => home_url(),
    'admin_email' => $admin_email,
    );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t see how $manage_url could be undefined unless core code had been altered.

    If you want a custom value for $manage_url, use the “user_request_confirmed_email_content” filter to conditionally replace ###MANAGE_URL### based on the value of $request->action_name. If you replace ###MANAGE_URL### with your URL in this filter, the subsequent use by WP core of $manage_url will be ineffectual.

    Thread Starter Fran?uel Soares

    (@francuelsoares)

    I don’t think you understand me.

    I created a post that is not recognized by this WordPress if/else I posted above.

    The value of $request->action_name only recognizes “export_personal_data” and “remove_personal_data”

    And my value is remove_personal_data… That’s why it doesn’t create the variable $manage_url and keeps giving this Notice error.

    Moderator bcworkz

    (@bcworkz)

    You cannot alter $request->action_name because WP doesn’t recognize it. You must replace ###MANAGE_URL### via the filter by some other means.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Notice: Undefined variable: manage_url in … wp-includes\user.php on line 3643’ is closed to new replies.