nitrospectide
Forum Replies Created
-
It appears that a recent release has resolved my issue. Thanks for the fix. I did not realize it for a while since there was no reply on this ticket.
Does AAM work with WP Bakery for you?
Yet another puzzling update on this. I ran into the same issue when editing the permalink on a page. So I turned off revisions for pages, and that fixed it. Then today, out of curiosity, I turned revisions back on for both events and pages. Now, testing on the exact same event and page as before, the same edit no longer triggers the issue.
I’m stumped, but at least it is working. I mention it just for completeness, and in case the information might be useful.
Do you have any thoughts based on what I wrote?
All the same. I’m puzzled.
Both are running PHP 8.2.
Yes. The test site is a duplicate of yesterday’s live site backup – so everything is identical.
Well now I’m baffled. I ran off a test site, checked this, and the glitch doesn’t happen there. Both sites are on the same host, same environment.
I will need to spin up a dev copy of my site, so I can test this and get back to you.
The ACF field that causes this glitch is:
Text field / Field Name: id / No validation or conditional logic / all other settings: default
It’s inside a group with Field Name: booth_info
That’s the interesting bit. We are not using the Pro version. I am not trying to create a revision on an ACF value. I just have your free version installed, and it has been used to create revisions on some of our posts – the main content – not ACFs. But our problem is that on this one post type, we ran into this strange situation where simply changing the value of this one ACF (no other ACFs on this post cause the problem) makes the Update button disappear, and it will only let us schedule a revision.
After some more digging, I was able to find a solution. I do wonder though if there is much of a performance hit due to this running on all core/html blocks?
My shortcode call in an HTML block now looks like: [link_buttons post_id=”{{post_id}}”]
And the function that replaces that {{post_id}} token with the actual post ID is:
function query_loop_id_render($block_content, $block) {
if ($block['blockName'] === 'core/html') {
$block_content = str_replace("{{post_id}}", get_the_ID(), $block_content);
}
return $block_content;
}
add_filter('render_block', 'query_loop_id_render', 10, 2);And now my shortcode is updated to:
/*
================================================================================
== SHORTCODE: Output Link Buttons
================================================================================
*/
function shrt_link_buttons( $atts ) {
$theTitle = get_the_title($atts['post_id']);
$theLink = get_the_permalink($atts['post_id']);
$content = "";
$content .= '<div class="btn-cta">
<a class="btn" href="'. $theLink .'">
See Details >
</a>
<a class="btn" href="/get-property-showing?property='. $theTitle .'">
See in Person >
</a>
</div>';
return $content;
}
add_shortcode( 'link_buttons', 'shrt_link_buttons');Credit to this comment: https://wordpress.org/support/topic/query-loop-posts-in-gutenberg/#post-17758832
- This reply was modified 1 year, 10 months ago by nitrospectide.
- This reply was modified 1 year, 10 months ago by nitrospectide.
What I currently have is this in my functions.php
/*
================================================================================
== SHORTCODE: Output Link Buttons
================================================================================
*/
function shrt_link_buttons( $atts ) {
$theTitle = get_the_title();
$theLink = get_the_permalink();
$content = "";
$content .= '<div class="btn-cta">
<a class="btn" href="'. $theLink .'">
See Details >
</a>
<a class="btn" href="/get-property-showing?property='. $theTitle .'">
See in Person >
</a>
</div>';
return $content;
}
add_shortcode( 'link_buttons', 'shrt_link_buttons');What it looks like that example you linked is doing, is targeting 3 block types, and running any shortcodes used in them through this to create the proper context for targeting the data retrieval. But the particulars of what it is doing to accomplish that are completely opaque to me. Do I need everything in that example? Does it need to be a class like the way it’s set up? Does that mean it needs to be a completely independent plugin to work properly? (No use in functions.php or combining with existing custom plugin that is just procedural functions?)
I can make a simple shortcode, but how would I implement that render_block solution in my shortcode?
The capabilities I am trying to enable look like:
vc_access_rules_post_types/events
vc_ is Visual Composer – now known as WP Bakery Page Builder. This setting enables the use of the builder on the CPT named after the / (events in this case).
I have my live site, plus two development site copies. At first, my one development site let me check these boxes, no problem. My live site did not. I tried it on the other dev site, and it also would not let me check the boxes. I looked at differences between the sites, and noticed that my core WordPress had not been updated in a bit on the dev site where I was able to set the checkbox (6.4.x, I think). The live and other dev sites both had newer (but not current – they were at 6.5.x) versions of WP. I updated WordPress (6.6.x) on the site where the checkboxes worked, and now I can no longer set the checkboxes on that dev site.
On the dev site that I had updated to the current WP core version, I updated my other plugins, including WP Bakery Page Builder. It still does not let me set these checkboxes. Although now, when I click one, it jumps me back up to the top of the page, and if I scroll all the way back down, I see this error message at the bottom of the page:
“Unexpected Issue
An unexpected application issue has arisen. Please feel free to report this issue to us, and we will promptly provide you with a solution. Report issue”
Note also that while I have not tested all of the vc_ capabilities for each CPT, I CAN set/unset checkboxes on other vc_ capabilities, and other things unrelated to WPB/Visual Composer.
The reason this is such a sticking point, is that without the boxes checked, the role I am creating is unable to use WPB to edit content on those posts, which is a necessity.