Automattic / Automattic/customize-direct-manipulation

No post edit icons in Canard

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
38
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Canard doesn't display post edit icons on the front page. This is because the posts are actually excerpts, which don't normally have edit links.

From @sirbrillig:

> Maybe this is desirable as a fallback method would have to try to create the post edit URL, and that could be flawed (we have to parse out the post ID from the DOM and figure out what the root wp-admin URL is).

@kwight suggests:

> We may be able to use `get_edit_post_link()` through `wp_localize_script`, and then swap in the ID for each post. This way, it should take care of itself whether on localhost, wp-admin, or Calypso.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the front-page rendering and edit-icon behavior for excerpted posts, then trace how the WordPress Customizer exposes post data to JavaScript. Compare the proposed get_edit_post_link() and wp_localize_script() approach, and consider the localhost, wp-admin, and Calypso contexts; done means edit icons appear reliably on front-page excerpts.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, wordpress
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.