Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter toondg

    (@toondg)

    Ok. For the moment I fixed the first point using this code:

    /**
    * Get the _members_access_role meta key for translated pages, to make Members plugin access controll work
    */
    function sync_members_access_role_meta_field($meta_value, $object_id, $meta_key, $single) {
    // Check if the meta key is '_members_access_role'
    if ($meta_key === '_members_access_role') {
    // Use a static variable to prevent infinite loop
    static $is_running = false;

    if ($is_running) {
    return $meta_value;
    }

    $is_running = true;

    // Get the current language
    $current_language = apply_filters('wpml_current_language', null);

    // Get the default language
    $default_language = apply_filters('wpml_default_language', null);

    // If the current language is not the default language
    if ($current_language !== $default_language) {
    // Get the original post ID
    $original_post_id = apply_filters('wpml_object_id', $object_id, get_post_type($object_id), true, $default_language);

    // Get all values of the custom meta field from the original post
    $meta_values = get_post_meta($original_post_id, $meta_key, false);

    // Reset the static variable
    $is_running = false;

    // Return all meta values if not requesting a single value
    if (!$single) {
    return $meta_values;
    }

    // Return the first meta value if requesting a single value
    if (!empty($meta_values)) {
    return $meta_values[0];
    }

    return '';
    }

    // Reset the static variable
    $is_running = false;
    }

    return $meta_value;
    }

    add_filter('get_post_metadata', 'sync_members_access_role_meta_field', 10, 4);
    • This reply was modified 3 months ago by toondg.
    Thread Starter toondg

    (@toondg)

    And an extra question.
    If page content is blocked, the page still loads with a HTML status 200, instead of 401. Is there a way to change this?

    Thread Starter toondg

    (@toondg)

    Thank you for your reply.

    Our site is entirely translated with the advanced translation editor.
    Does your plugin contain any filter hooks, that I could use to override the permissions of a page?

    Thread Starter toondg

    (@toondg)

    Thank you for your reply. I checked that page previously, but apparently I missed this section:
    “By default, users must be able to see wp-admin pages in order to set up 2FA. If you use WooCommerce, you can enable “Show Wordfence 2FA menu on WooCommerce Account page” to allow the Customer role to see the 2FA settings on their account page. If you use a membership or forum plugin that does not allow low-privileged roles to see wp-admin, you can enable “2FA Management Shortcode”, and place a shortcode on the user’s account page. In some cases, using these options may require CSS changes, if the color or layout of the form needs to be adjusted. We recommend checking any customized pages while logged in as a customer or subscriber (or any other low-privileged user), when enabling this option.”

    I just tried the [wordfence_2fa_management] shortcode, and it shows up on a custom page.

    Thread Starter toondg

    (@toondg)

    Thank you for your reply.
    I’ll wait for the plugin update.

    Thread Starter toondg

    (@toondg)

    Importing the blob I posted did fix the problem for me.
    If I then save the post type again on the edit page, the html encoded characters are back.
    For now I’ll just copy/paste the post types from the export to the import field after I make a change, to fix the issue.

    Thread Starter toondg

    (@toondg)

    Sure, here it is.
    Thank you for taking a look.

    {"car":{"name":"car","label":"Auto's","singular_label":"Auto","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","rest_namespace":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","can_export":"true","rewrite":"true","rewrite_slug":"car","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"30","show_in_menu":"true","show_in_menu_string":"","menu_icon":"dashicons-car","register_meta_box_cb":null,"supports":["title","editor","thumbnail","excerpt"],"taxonomies":[],"labels":{"menu_name":"Auto's","all_items":"Alle Auto's","add_new":"Nieuwe toevoegen","add_new_item":"Nieuwe Auto toevoegen","edit_item":"Bewerk Auto","new_item":"Nieuw Auto","view_item":"Bekijk Auto","view_items":"Bekijk Auto's","search_items":"Zoek Auto's","not_found":"Geen Auto's gevonden","not_found_in_trash":"Geen Auto's gevonden in prullenbak","parent":"Hoofd Auto:","featured_image":"Uitgelichte afbeelding voor deze Auto","set_featured_image":"Uitgelichte afbeelding instellen voor deze Auto","remove_featured_image":"Uitgelichte afbeelding voor deze Auto verwijderen","use_featured_image":"Gebruiken als uitgelichte afbeelding voor deze Auto","archives":"Auto archieven","insert_into_item":"Invoegen in Auto","uploaded_to_this_item":"Upload naar deze Auto","filter_items_list":"Filter Auto's lijst","items_list_navigation":"Auto's lijstnavigatie","items_list":"Auto's lijst","attributes":"Auto's attributen","name_admin_bar":"Auto","item_published":"Auto gepubliceerd","item_published_privately":"Auto priv\u00e9 gepubliceerd.","item_reverted_to_draft":"Auto omgezet naar concept.","item_scheduled":"Auto ingepland","item_updated":"Auto bijgewerkt.","parent_item_colon":"Hoofd Auto:"},"custom_supports":"","enter_title_here":"Voeg Auto toe"}}

    Thread Starter toondg

    (@toondg)

    The default “Pages” menu (Pagina’s in Dutch), does show the ‘ correctly everywhere, so I thought that the error might be in CPTUI. Or maybe CPTUI does send the names html encoded, and WordPress core does html encode them again in some places.

    Thread Starter toondg

    (@toondg)

    Hi,

    The website uses the Amwerk theme, but I don’t have the license myself because the website was build by someone else.

    I will check with them for the license and try to submit a ticket.

    Thread Starter toondg

    (@toondg)

    Hi @champsupertramp

    Thank you for your reply.
    The problem is not translating the e-mail, but that the wrong language is used for the approved email.

    The approved_email is sent in the language that the admin that approves the account is using, instead of the language of the user that is being approved.

    Regards

Viewing 10 replies - 1 through 10 (of 10 total)