Albin
Forum Replies Created
-
Forum: Plugins
In reply to: [Gutenberg] setDefaultBlockName makes dissapear the BlockControlsHello again
As I was using this block since time ago without any problem, I have tried to restore WP 6.8.3 and it works in that version, so it must be something changed in the new WP 6.9.
Any body knows what could be the problem?
Thanks
Forum: Developing with WordPress
In reply to: How to list the available blocks when pressing «/»Hello @darerodz
Many thanks because it works, it does what I need.
I didn´t pay attention to __experimentalWhatever because I think that this feature exists since the very beginning and I expected to find some other way to make it work. Some kind of component wrapping or attribute like onSlash or … who knows.
In fact, I would sleep better if I found another way (not experimental) to implement this feature but, as it works, I am happy and looking forward to continue my development.
– Albin
- This reply was modified 3 years, 6 months ago by Albin.
Forum: Developing with WordPress
In reply to: How to list the available blocks when pressing «/»Hi @darerodz
Think about a new Post, you only have an empty core/paragraph block, then you type “/” and a list of available blocks is shown in a pop-up, to let you choose which one insert.
That’s exactly what I want to do in my block. When the user has the focus on my RichText and types “/”, how do I show that pop-up?
Thanks for taking a look at my issue.
– AlbinHello again Niklas,
What I meant is that if your plugin needs a hook being called (like woocommerce_whatever) or a script being registered (like wp_enqueue_script(‘paypal_whatever’, ‘…’)), I will make sure that it happens.
I want to do some test and if it keeps failing I resume this thread with the information you have requested.
Thanks.
Hello Niklas,
I bet it works in Storefront but I expect that it works also in my theme as it has all the hooks, the same hooks that can be found in woocommerce templates folder.
In payment.php I list the available gateways:
foreach($available_gateways as $gateway) { wc_get_template( 'checkout/payment-method.php', array('gateway'=>$gateway)); }And in payment-method.php I let each gateway to put its own fields.
<li class="wc_payment_method payment_method_<?php echo esc_attr( $gateway->id ); ?>"> <input id="payment_method_<?php echo esc_attr( $gateway->id ); ?>" type="radio" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php checked( $gateway->chosen, true ); ?> data-order_button_text="<?php echo esc_attr( $gateway->order_button_text ); ?>" /> <label for="payment_method_<?php echo esc_attr( $gateway->id ); ?>"> <?php echo $gateway->get_title(); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?> <?php // $gateway->get_icon(); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?> </label> <?php if(!empty($gateway->get_description())) : ?> <? $gateway->payment_fields(); ?> <?php endif; ?> </li>jQuery is available.
Do you mean that the paypal gateway listed with this code should be hidden and a different button (smart button) should appear magically (for me) somewhere in the screen?
That’s definitly not happening.
Where could be the error? What js file is missing? Where is it registered? How can I register it?
Let’s work together to fix it, please.
Thanks
– MarioSolution:
wp.blocks.registerBlockType( 'melange/test-aligns', { apiVersion: 2, ... });As seen in https://developer.ww.wp.xz.cn/block-editor/developers/block-api/block-edit-save/
But, I don´t know why, they don´t need it in Gutenberg source code.
More info Stackoverflow with images.
Hello again,
I got a fix. I have moved my ob_start to init hook and the ob_get_flush to shutdown hook.
I removed the ob_start and ob_ob_get_clean from your Main/Head.php and it did not solve the problem. But ob is not being used in any other relevant place. Despite this, it looks like the problem is:
· You start a buffer in template_redirect hook
· I start my bufffer in header.php
· You close your buffer in wp_footer before I close mine
· I run into troubles XDI logged ob_get_status in some places and never reported your buffers but I don´t figure out any other explanation.
Just telling it to you in case someone else complains about the same.
– Albin
Sorry, I meant $site_url, an undefined variable, not function.
This variable is perfectly defined in siblings functions.
- This reply was modified 8 years, 9 months ago by Albin.
Forum: Plugins
In reply to: [No Category Base (WPML)] Bug with WPMLYes. Go to the file no-category-base-wpml.php and change
add_filter( ‘terms_clauses’, array( $sitepress, ‘terms_clauses’ ) );
for
add_filter( ‘terms_clauses’, array( $sitepress, ‘terms_clauses’ ), 10, 4 );Hi,
Is get_category_link supposed to work?
It doesn´t work for me. It always returns “” whether I send the category ID as a parameter or not.
I checked the code and I saw you have this filter:
add_filter(‘category_link’, ‘qTranslateSlug_category_link’, 0, 2);
but also this comment inside the function:
//TODO: implement it!
but there is a lot of code so I don´t know what to think.– Albin