then your echo would just be like this.. but playing with this issue I wonder if that works for you on 5.11 too?
<?php echo esc_attr($className); ?>
@hakdesign have you tried this code?
if( !empty($block['className']) ) {
$className .= ' ' . $block['className'];
}
I figured it out… with version 5.11 I have to have the following code in my block code, prior to 5.11 this was not required for whatever reason.
if( !empty($block['align']) ) {
$className .= ' align' . $block['align'];
}
I didn’t have any supports key on the affected block. Because you said that I tried adding Align=> true without any luck.
‘supports’=> [
‘align’=> true,
acf_register_block_type(array(
'name' => 'button-block',
'title' => __('Button'),
'description' => __('Custom Button'),
'render_template' => 'template-part/block/button/button.php',
'category' => 'oneper',
'icon' => 'admin-site',
'supports' => [
'align' => true
],
'keywords' => array( 'button' ),
'enqueue_assets' => function(){
wp_enqueue_script( 'block-button', get_template_directory_uri() . '/template-part/block/button/button.js', array(), '', true );
}
));
if Using CSS I would probably use this, or else it’s likely you wont be able to select your block in the backend to edit it at all.
.acf-block-preview .wp-block-acf-button-block a {
pointer-events: none;
}
Just an FYI if using ProxxiM’s solution be careful if adding this after the fact, as any blocks created and in the preview mode, will still be in preview mode and you won’t be able to change them back. For this reason it would be really nice if there was a forcemode option, as there are times you may modify an exsisting block to make it more customizable and not want it to have a preview mode anymore.
Hey @ppi Thanks for following up with your findings! I had the same issue and thought it was a function I had added, you saved me some good time there! buy you coffee if I could 🙂
Any Luck on this, I am using this plugin https://themify.me/announcement-bar and the date picker also has an issue when ACF is enabled I am unable to select the dates
+1 would be a great feature!
with all the WordPress XSS Vulnerabilities of late it would be nice if this topic could get some attention again?
Thanks! how did I miss that 🙂
Single row? wouldn’t that just be a group of fields?
Would still be nice if this feature was in the core! you can collapse table view but not row.
Yup, that is exactly how I was thinking you had it. You want to pull fields from one websites database and display them on a completely different site and have them update dynamically when you add/modify your content. this is defiantly not a simple task nor an ACF issue. This is one of the reasons WP multisite installs exist. There are other ways this can be accomplished but the question doesn’t belong on the ACF forum.
I just tested on 2 sites to confirm for you one ver 4 and one ver 5 of ACF both WP3.9.1, I get the same thing on both. you may want to move this topic to the bug section I’m not sure if that is a limitation of the shortcode field but its not clear in the documentation if so.
unfortunately your analogy is off base, people using ACF are not end users. They are not the people driving the Ferrari. You have missed out the crucial step of going through a “dealer”(Developer). you bought a car and are going to the manufacturer to learn how to “drive”(code)
-Ferrari wont teach you to drive
-ACF wont teach you basic coding (although the documentation almost does)
You are defiantly not including enough information to get a solid answer here. You should make sure you read through the documentation here http://www.advancedcustomfields.com/resources/ .
not sure what you are trying to copy to your functions.php file however your WP theme should only have 1 functions.php file perhaps you have 4 themes installed in your WP install?
is the field you are trying to display on the same page you are trying to display it on? if not make sure to include the page id where the field is located. not familiar with the theme however alot of one pagers use multiple posts or pages to create the one page so this could be misleading.
[acf field="field_name" post_id="123"]
if you created the websites using a WP multisite install you should be able to just use the <?php switch_to_blog($new_blog) ?> function and retrieve your fields. however your issue isn’t really an ACF issue I don’t think. Maybe look at using an RSS feed to create posts from one site to another.
Thanks Elliot, your support is top notch! appreciate the follow up on this.
Thanks Elliot, I was going that direction too, then I realized I could do everything I needed with ACF – this worked perfectly, do you have an example like this in the code snippets cause it works like a charm for basic content access http://www.themightymo.com/2013/05/20/how-to-limit-access-to-wordpress-pages-by-specific-user/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.