Plugin Directory


Ignore:
Timestamp:
10/07/2026 07:51:21 AM (3 weeks ago)
Author:
avakodeforge
Message:

Release 1.1.0 (trunk + tag; see readme changelog)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • langforge/trunk/includes/class-rest-api.php

    r3628343 r3732047  
    179179                    'title' => $trans_post->post_title,
    180180                    'status' => $trans_post->post_status,
    181                     'edit_link' => get_edit_post_link($trans_id, 'raw'),
     181                    // '' (never null) when the user has no edit screen for it: the sidebar prints no Edit link then.
     182                    'edit_link' => LANGFORGE_Post_Translation::edit_url($trans_id, 'raw'),
    182183                    'permalink' => get_permalink($trans_id),
    183184                ];
    … …  
    359360        // Only expose translations the requester may read, so a public post's
    360361        // REST entry doesn't leak draft/private translation topology.
     362        // A member whose post type WordPress does not know (the plugin that registered it is
     363        // deactivated, or it registers later than this request asks) is left out without being
     364        // asked about: current_user_can('read_post') for such a post is a _doing_it_wrong in
     365        // map_meta_cap and judged by another capability. No type, no right to read.
     366        $pt      = LANGFORGE_Post_Translation::instance();
    361367        $visible = [];
    362368        foreach ($translations as $lang => $tid) {
    363             if (current_user_can('read_post', (int) $tid)) {
     369            if ($pt->translation_type_is_registered((int) $tid) && current_user_can('read_post', (int) $tid)) {
    364370                $visible[$lang] = $tid;
    365371            }
Note: See TracChangeset for help on using the changeset viewer.