Jonas
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: nonce parameter in enqueued js-tag for CSP@jamesspi sure!
Can I ask how you inserted the nonces into your CSP from here?
That’s the next problem i’m facing right now. Because the wp_create_nonce() function depends on the time of the day, it changes every now and then. I’m thinking of writing all generated nonces in an array and adding them to the CSP via php’s header function. But i haven’t tried it so far.
Forum: Fixing WordPress
In reply to: nonce parameter in enqueued js-tag for CSPI actually found a quite simple way to do this.
It’s possible via the “script_loader_tag” hook and a filter function.The following code adds a nonce attribute, generated with the handle, to every enqueued script.
/** Add Nonce Attribute To Javascript **/ function add_nonce_attr( $tag, $handle, $src ) { return '<script type="text/javascript" nonce="'.wp_create_nonce( $handle ).'" src="'.$src.'"></script>'."\n"; } add_filter( 'script_loader_tag', 'add_nonce_attr', 10, 3 );Note: the “script_loader_tag” hook is only available since Version 4.1.0
Forum: Fixing WordPress
In reply to: nonce parameter in enqueued js-tag for CSPHey, unfortunately it didn’t really help me.
wp_localize_script allows me, as i understood it, to pass variables from php to js.
But i actually really just need a hook or function or whatever that enqueues a js script in the proper way and outputs it like<script nonce="herecomesthenonce" src="source"></script>but so far i wasn’t able to get the nonce in there..Forum: Fixing WordPress
In reply to: How to move media files from library back to computer?You could just go to the image file in your browser and download them.
Forum: Plugins
In reply to: [jQuery Maximage] Wish I could find something that works!Sorry i can’t reconstruct your error. Maybe your download is corrupt or something
Forum: Plugins
In reply to: [jQuery Maximage] SpeedHey sorry i’m answering so late.
I’ll have a look at it asap, haven’t got that problem yet.
But i’ll get back to you as soon as i’ve found the error.
Forum: Hacks
In reply to: WP Plugin won't create tables in DatabaseOk so now i’ve got it working.
The php error log wasn’t helpful but it seems that there was a problem with the terms “option” and “value”.Nethertheless, thank you guys!
Forum: Hacks
In reply to: WP Plugin won't create tables in DatabaseThanks for your replies, but unfortunately this didn’t work.
Both tables aren’t created and i still can’t figure out why…
Forum: Plugins
In reply to: [jQuery Maximage] How call slider ?Sorry that i’m answering so late.
By default, the slideshow is activated as soon as you’ve selected at least 2 images.
What JS Library do you mean? The plugin automatically calls jQuery from the internal WordPress jQuery directory.Jonas