Pascal CESCATO
Forum Replies Created
-
Forum: Plugins
In reply to: [Smart Grid-Layout Design for Contact Form 7] dynamic selectfinally, I found the solution; here is the full code snippet:
add_filter( 'cf7sg_custom_dynamic_select','licencie_dynamic_options',10,3); function licencie_dynamic_options($options, $tag, $cf7_key){ if('saisie-1'!==$cf7_key || 'licencie' !== $tag->name){ return $options; } global $wpdb; $sql = "SELECT id, CONCAT(firstname, ' ', lastname) AS fullname FROM {$wpdb->prefix}_mytable"; $datas = $wpdb->get_results($sql); foreach( $datas as $row ){ $options[ $row->id ] = array( $row->fullname ); } return $options; }
So you have to put the option text in an array, or it won’t be displayed correctly. So you must write this:
$options[ $value ] = array( $text );
to have:
<option value="$value">$text</option>
Forum: Plugins
In reply to: [AIO Forms - The most complete and affordable form builder] hooksHi and thanks for answer!
I search for some before_send hook to get all datas and save them in a custom format (probably json)
Forum: Reviews
In reply to: [stop XML-RPC Attacks] GreatYou’re welcome!
Forum: Plugins
In reply to: [Post Grid Gutenberg Blocks and WordPress Blog Plugin – PostX] templatesOk, thanks. So I’ll do…
Hi, thanks for answer!
This only happens when global assets is enabled in the settings.
You’re right, I removed it disabling global assets.
I understand that you use stable beta version, but this file is gaving me a 404 error… I still don’t know why.
Let me know if there’s some change in days.Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Flexible contentThanks for reply! I’ll test it as soon as possible
Forum: Plugins
In reply to: [RecipePress Reloaded] Custom templateSometime heaven is impish… But stubbornness is useless, the problem may be an environment variable that we did not think of. So, instead of waisting time to find (to find what?) I rather like to work in a different way.
Thanks for your time and for your help.Forum: Plugins
In reply to: [RecipePress Reloaded] Custom templateThanks anyway. I switched to Pods in order to create what I want. But your plugin is some kind of state of the art in recipes plugins, so I’m a bit upset, I’d love to use it :\
Forum: Plugins
In reply to: [RecipePress Reloaded] Custom templateof course you can! https://perso.pascalcescato.gdn/recette/pate-pizza-fine-croustillante/ (there’s no other, it’s a try) and here you can see that my settings are correct: https://nimb.ws/6jlSxD
Forum: Plugins
In reply to: [RecipePress Reloaded] Custom templateExactly!
Forum: Plugins
In reply to: [RecipePress Reloaded] Custom templateHi and thanks for fast answer!
Here is my theme folder:
-astra parent theme) -astrachild (child theme) --recipepress ---rpr_blank ----recipe.php ----screenshot.png ----functions.php ----excerpt.php
I see the thumb in appearance settings with the correct template name, I can select and register it, but it doesn’t load in front.
My server config: Plesk (NGINX/Apache/PHP7.4.29+MariaDB)- This reply was modified 2 years, 6 months ago by Pascal CESCATO.
Forum: Plugins
In reply to: [LiteSpeed Cache] CSP nonceYes! It works perfectly.
ob_start
was ΤHE problem!- This reply was modified 2 years, 7 months ago by Pascal CESCATO.
Forum: Plugins
In reply to: [LiteSpeed Cache] CSP nonceTest code works perfectly.
But with my code snippet, I just had a blanck empty page. I just removed theob_start
function – now my code works perfectly.
Can be used to have a secured CSP.
Thanks for help!Forum: Plugins
In reply to: [LiteSpeed Cache] CSP nonceHere is my code:
add_action( 'template_redirect', function () { ob_start( function ( $output ) { $nonces = []; $output = preg_replace_callback( '#<script.*?\>#', function ( $matches ) use ( &$nonces ) { $nonce = wp_create_nonce( $matches[0] ); $nonces[] = $nonce; return str_replace( '<script', "<script nonce='{$nonce}'", $matches[0] ); }, $output ); $output = preg_replace_callback( '#<style.*?\>#', function ( $matches ) use ( &$nonces ) { $nonce = wp_create_nonce( $matches[0] ); $nonces[] = $nonce; return str_replace( '<style', "<style nonce='{$nonce}'", $matches[0] ); }, $output ); $nonces_csp = array_reduce( $nonces, function ( $header, $nonce ) { return "{$header} 'nonce-{$nonce}'"; }, '' ); header( sprintf( "Content-Security-Policy: base-uri 'self' data:; object-src 'none'; script-src https:%s 'strict-dynamic'", $nonces_csp ) ); return $output; } ); } );
So I tried to do the same with
litespeed_buffer_after
:
add_action( 'litespeed_buffer_after', function ($content) {…
But it does not work.
Maybe it’s not the way the hook should be used, so I ask you…Forum: Reviews
In reply to: [stop XML-RPC Attacks] thanksYou’re welcome!