Link field does not save `nofollow` and `sponsored` fields added by Rank Math SEO
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, php
- Lĩnh vực
- full-stack
Hướng nghiên cứu
Tái hiện vấn đề khi Rank Math SEO được bật và có trường liên kết ACF, sau đó kiểm tra assets/build/js/acf-input.min.js và cách xử lý trường liên kết được mô tả trong báo cáo. Bản sửa hoàn tất khi các giá trị của hộp kiểm nofollow và sponsored được lưu và trả về cùng với title, url và target trong get_field('my_link').
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
I'm using Rank Math SEO and it's adding 2 checkboxes to the popup that shows link settings, which goes with the link field type. The checkboxes in question are:
- Add rel="nofollow" (CSS ID:
#wp-link-nofollow) - Add rel="sponsored" (CSS ID:
#wp-link-sponsored)
I found an old thread that ACF is not compatible with Rank Math SEO to do this. However, looking into the code, and I see that target property is managed via JS in assets/build/js/acf-input.min.js.
To Reproduce
Steps to reproduce the behavior:
- Install and enable Rank Math SEO plugin
- Add ACF link field to anywhere. For illustration purposes, the link field is called
my_link. I also attached the JSON sync file. - Navigate to any page and use the link field.
- In "Insert/edit link" popup, select or enter URL and Link Text and check all options: (1) Open link in a new tab, (2) Add rel="nofollow", and (3) Add re="sponsored"
- Click "Add Link" to save
- Save page
- Thru PHP, dump
my_linklikevar_dump( get_field('my_link') ), which will output something like:
array (size=3)
'title' => string 'Test' (length=4)
'url' => string 'https://localhost/test' (length=22)
'target' => string '_blank' (length=6)
PHP dump does not show values for the 2 attributes.
Expected behavior
PHP should return values saved for 2 attributes. If I do a dump, I should see something like:
array (size=5)
'title' => string 'Test' (length=4)
'url' => string 'https://localhost/test' (length=22)
'target' => string '_blank' (length=6)
'nofollow' => boolean true
'sponsored' => boolean true
Screenshots or Video
Code
Version Information:
- WordPress Version: 6.8.1
- PHP Version: 8.2
- ACF Version: ACF Pro 6.4.2
- Browser: Chrome
Additional context
None
- Ngôn ngữ chính
- PHP
- Star
- 948
- Fork
- 198
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AdvancedCustomFields/acf
-
PHP 8.5: "Using null as an array offset" deprecation in ACF_Data::is() when rendering a block with empty data (local-meta.php is_request)Có thể đã có người làm @faisalahammad đã nhận 7 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AdvancedCustomFields/acf#1044 ·
-
is_preview was called incorrectly notice on every early get_field() since 6.8.10 (acf_revisions::acf_validate_post_id)Có thể đã có người làm @faisalahammad đã nhận 7 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AdvancedCustomFields/acf#1041 · 1 bình luận ·
-
True / False ACF control bug on RTL layoutsCó thể đã có người làm @elicohenator đã nhận 30 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
AdvancedCustomFields/acf#1038 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AdvancedCustomFields/acf#1034 · 3 bình luận ·
-
Bug: class-acf-field-icon_picker.php calls wp_get_attachment_image_url() with string Dashicon slug, causing fatal TypeError on PHP 8+Có thể đã có người làm @antwonw đã nhận 41 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
AdvancedCustomFields/acf#1032 · 1 bình luận ·
Tất cả issue của AdvancedCustomFields/acf
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
grokability/snipe-it#19869 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Перевод устарел
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100