Am ?ncercat actualizarea modulului pe o instan?? local? ?i am primit eroarea fatal?:
PHP Fatal error: Uncaught TypeError: X\Inc\Woo_Checkout::alter_payment_gateways(): Argument #1 ($available_gateways) must be of type array, string given, called in /wp-includes/class-wp-hook.php on line 324 and defined in /wp-content/themes/x/inc/class-woo-checkout.php:206
?n tema site-ului (la loca?ia /wp-content/themes/x/inc/class-woo-checkout.php:206
) folosesc un filtru pentru hook-ul woocommerce_available_payment_gateways
cu un callback care are tipuri declarate PHP introduse ?ncepand cu versiunea 7.1.0. Declara?ia acestui callback arat? a?a: function alter_payment_gateways( array $available_gateways ): array
. Ei bine, acest lucru rezult? ?n eroarea de mai sus.
M-am uitat prin modulul Netopia ?i am g?sit folosit acest hook ?i acolo. Din p?cate este folosit gre?it ?i la un moment dat returneaz? un ?ir de caractere gol ?n aceast? loca?ie:wp-content/plugins/netopia-payments-payment-gateway/oney/oney-add-on-netopia.php:555
V? las aici documenta?ia oficial? a respectivului hook. Ar trebui ca valorile returnate de callback-urile puse pe el s? returneze strict vectori, nu altceva.
Mul?umesc,
Vlad Ilie
_n
— is empty when using de_CH with fallback to de_DE_formal. If I swap the order of the languages, then the correct translation is displayed.
]]>I was wondering whether it would be possible to replace a matched row’s content with an empty string, as when I attempt to do so, I get a critical error and it doesn’t allow me to do so.
What I do that causes the error: I click on the matched content and attempt to put in an empty string in the content text field and then click the blue “Replace” button.
I’m aiming for more granularity in how I replace content, so I want to replace content row by row.
I’m using the “Modify Matches” action and using the regex flags with posts content columns.
]]>I have a lot of the below warning lines in my debug log:
PHP Warning: strpos(): Empty needle in /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/w3-total-cache/UserExperience_LazyLoad_Mutator.php on line 240
This means you should check if the needle in strpos function is empty before searching for it as searching for an empty string does not make sense.
Please change the below function in UserExperience_LazyLoad_Mutator.php:
private function is_content_excluded( $content ) {
foreach ( $this->excludes as $w ) {
if ( strpos( $content, $w ) !== FALSE ) {
return true;
}
}
return false;
}
like this:
private function is_content_excluded( $content ) {
foreach ( $this->excludes as $w ) {
if ( !empty($w) ) {
if ( strpos( $content, $w ) !== FALSE ) {
return true;
}
}
}
return false;
}
This will save a lot of debug.log warnings for us.
Thank you!
Best regards,
Endre
First, I’ve added to category description (all is OK):
add_filter( 'term_description', 'filter_function_name_386', 10, 4 );
function filter_function_name_386( $value, $term_id, $taxonomy, $context ){
// filter...
return $value .= do_shortcode( '[the_ad id="1681"]' );
}
After that I tried to do the same for tags, but it fails:
add_filter( 'post_tag_description', 'filter_function_name_385', 10, 4 );
function filter_function_name_385( $value){
// filter...
//shortcode returns an empty string here
$aaa = do_shortcode( '[the_ad id="1681"]');
return $value. $aaa . 'ttt';
}
So do_shortcode returns an empty string here, how can I fix it? Thanks
]]>INVALID_DOCUMENT – “text” was “” should be not (null or an empty string) (keyPath components->1->components->6->text)
INVALID_DOCUMENT – “text” was “” should be not (null or an empty string) (keyPath components->1->components->36->text)
INVALID_DOCUMENT – “text” was “” should be not (null or an empty string) (keyPath components->1->components->58->text)
INVALID_DOCUMENT – “text” was “” should be not (null or an empty string) (keyPath components->1->components->81->text)
Any help much appreciated to help resolve this.
]]>When setting up a new xcloner install, and entering all the correct credentials for a remote webdav folder, I get the following when selecting “Verify”. Note: Nothing is “empty” in the webdav setup.
Warning: XMLReader::XML(): Empty string supplied as input in xxx/public/wp-content/plugins/xcloner-backup-and-restore/vendor/sabre/xml/lib/Service.php on line 152
WebDAV connection error: This should never happen (famous last words)
Any ideas?
]]>Apologies in advance if this is a silly question. (Relative developer n00b.)
I’m working with a client’s custom plugin on a site. How it works is, you drag a widget that the plugin creates into its own custom sidebar. Then, on a page-by-page basis, you can enable this sidebar or disable it. What I’m trying to do is, if the page has the sidebar enabled, show that ‘custom’ sidebar, otherwise show a default.
Where I’m stuck is, is_active_sidebar
still returns true for the ‘custom’ sidebar even if the plugin returns false. Here’s my code:
<?php
if(function_exists('dynamic_sidebar')){
if(is_active_sidebar('sidebar_custom')){
dynamic_sidebar('sidebar_serivces_leadgen_footer');
}
elseif(is_active_sidebar('sidebar_serivces_secondary_footer')){
dynamic_sidebar('sidebar_serivces_secondary_footer');
}
}
?>
Is there a way to check if the sidebar content is an empty string (which is the case when the sidebar is disabled on a page)? Or to have the plugin make its sidebar ‘think’ that it’s empty by returning false or exiting or something like that?
Thank you in advance.
]]>The problem is all the pages of my site have been fine up until today when displaying their content. However now (and for no discernible reason) all new pages I create are not displaying the_content() string.
I’ve checked the following to see if I can see why:
I commented out the following line of code from the_content() function
$content = apply_filters( 'the_content', $content );
and it successfully displayed the content for my page. However as expected all the formatting was broken (more obviously on every other page of my site).
I put the line back in and the content vanishes again. Has anybody experienced this before? I cannot for the life of me work out why pages I add now (as opposed to pages I added last week) are not displaying their content. As far as that function filter is concerned isn’t it just a string of content and so what on earth would cause this?
Within “page.php” the following code is present:
<?php while ( have_posts() ): the_post(); ?>
<article <?php post_class('group'); ?>>
<?php get_template_part('inc/page-image'); ?>
<div class="entry themeform">
<?php the_content(); ?>
<div class="clear"></div>
</div><!--/.entry-->
</article>
<?php if ( ot_get_option('page-comments') != '' ) { comments_template('/comments.php',true); } ?>
<?php endwhile; ?>
We are still using the querystring for the permalinks so I know we have the right page.
]]>