Hugo
Forum Replies Created
-
Forum: Plugins
In reply to: [SVG Support] Media library raster image previewNot by default, but with those filters above it did, up to a point.
Did a quick google search and you can see it here or here for example.
When it happened i had to look for an alternative way and tested a few, and your plugin was the only that did a decent job.
I don’t think it’s related to the upload process, but to the media grid previewing in SVG.
The SVGs i’m using have a lot of data in them (complex tables with text as curves). This alone is perhaps responsible for the poor performance once the media library is open, hence my question about using raster images in the preview.Forum: Plugins
In reply to: [SVG Support] Media library raster image previewHmm, now you got me thinking.
I assumed (i know i know, one should never assume anything), that wp got svg support back again due to all the complaining about its removal.
It might be some other plugin messing things.
Here’s the list:
– Advanced Custom Fields PRO
– Cache Enabler (by KeyCDN)
– iThemes Security
– Polylang
– Post Types Order
– UpdraftPlus – Backup/Restore
– WP Remote
– WP Sanitize Accented Uploads (you wouldn’t believe the filenames people upload)
– XML Sitemap & Google News feedsOn my end. It’s a custom theme, built on top of Themekraft. However keeping hopes that svg support would return one day, i kept these handy filters, that could also be a suspect:
function modify_post_mime_types( $post_mime_types ) { $post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Gerir PDFs' ), _n_noop( 'PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>' ) ); $post_mime_types['application/zip'] = array( __( 'ZIPs' ), __( 'Gerir ZIPs' ), _n_noop( 'ZIP <span class="count">(%s)</span>', 'ZIPs <span class="count">(%s)</span>' ) ); return $post_mime_types; } add_filter( 'post_mime_types', 'modify_post_mime_types' ); function custom_mtypes( $m ){ $m['svg'] = 'image/svg+xml'; $m['svgz'] = 'image/svg+xml'; return $m; } add_filter( 'upload_mimes', 'custom_mtypes' );
Cheers
Hugo- This reply was modified 7 years, 2 months ago by Hugo.
Forum: Plugins
In reply to: [SVG Support] Media library raster image previewHey Benbodhi!
Sorry for the absence of replies.
After a lot of work and a much needed vacation, i completely forgot about everything, including this. :\
Still wasn’t able to test it out. I have a few busy weeks ahead, and after that, i will look into this.
Cheers
HugoForum: Plugins
In reply to: [SVG Support] Media library raster image previewHi Benbodhi!
I think is more related with rendering i guess, than with size. Every button / form field in the media library becomes unresponsive for a while (a long while).
This is 79 SVG files, we’re talking about! (oO)Haven’t yet. I will try to test today with a clean install and i’ll report the findings here.
Sorry, can’t do that with this one.
Thank you
Hugo Gon?alvesForum: Plugins
In reply to: [Nested Pages] Errors errors errorsThe above errors went away simply by changing the PHP version to 5.5.
(haven’t had the chance to test all of the errors, but since php version was the issue in the most notorious ones, i’m assuming the rest will be working fine as well)
Cheers
Forum: Plugins
In reply to: [Polylang] Polylang – Temp index.php rename gives -> ERR_TOO_MANY_REDIRECTSNop, that didn’t do the trick.
But this did.
Went back to index.php name default and just used this solution below, to have a current website running (replaced under construction message with current index file code) and also having a w.i.p. to show the client.the original one:
https://www.mecannical.com/2010/tutorials/how-to-set-up-a-wordpress-under-construction-environment/updated version:
https://www.mecannical.com/2010/tutorials/how-to-set-up-a-wordpress-under-construction-environment-v-2-0/No renames, no problems ??
Thanks Chouby.
GreetsForum: Plugins
In reply to: [Polylang] pll_copy_post_metas sync updated imagesOk, my bad then, must be that.
Yes, i always took into account that it should happen after publish/update.Thanks for assistance. Keep up the good work!
Forum: Plugins
In reply to: [Polylang] pll_copy_post_metas sync updated imagesYes.
Just realized that eventually happens after a second or third try.
There are some hooks going on at the same time and is a slow server, perhaps this has some interference in this.Forum: Plugins
In reply to: [Polylang] [Plugin: Polylang] pll_copy_post_metasGreat, nice to hear that!
Keep up the good work. ??Forum: Plugins
In reply to: [Polylang] [Plugin: Polylang] pll_copy_post_metasOk, i think i nailed it!
The Culprit:
add_post_meta/Parameters$meta_value
(mixed) (required)
The value of the custom field you will add. An array will be serialized into a string.The Hero:
maybe_unserializeUnserialize value only if it was serialized.
Of course this should require a better way to integrate, perhaps some hook, but for now to solve this issue i’m botching your admin-filters.php file(hate doing this), until i find a better solution ??
Replaced this in line 386 and 455:
add_post_meta($tr_id, $key, $value);
with:
add_post_meta($tr_id, $key, maybe_unserialize($value));
If you know of a hook i can use, please let me know.
Thanx!
Forum: Plugins
In reply to: [Polylang] [Plugin: Polylang] pll_copy_post_metasOk, i’ll try to.
Thanx for the ready reply!I’m using Custom Fields Creator as i said above. Also as i earlier, this is working smooth with ACF, so must be something specific to field groups or something.
In it, i’m using groups of fields to be repeated, in one of the situations i’m using an inline listing of a team, with the following fields: name, image, position.
Once you create a new repeater group, you define a meta for it. That’s the one i use when calling pll_copy_post_metas, in this case beeing called team, somewhere near the bottom of functions.php:
function copy_post_metas($metas) { $result = array_merge($metas, array('team')); return $result; } add_filter('pll_copy_post_metas', 'copy_post_metas');
In the original list everything goes well this is recorded database in the meta_value:
a:2:{i:0;a:3:{s:4:"name";s:8:"John Doe";s:6:"image";s:3:"486";s:6:"position";s:13:"Some Position";}i:1;a:3:{s:4:"name";s:8:"Jane Doe";s:6:"image";s:3:"488";s:6:"position";s:14:"Other Position";}}
However, in the copied list in the translated page you get this in the database under meta_value with these extra s:193:” and “; : …
s:193:"a:2:{i:0;a:3:{s:4:"name";s:8:"John Doe";s:6:"image";s:3:"486";s:6:"position";s:13:"Some Position";}i:1;a:3:{s:4:"name";s:8:"Jane Doe";s:6:"image";s:3:"488";s:6:"position";s:14:"Other Position";}}";
… and in the admin you get this error in the inline list as a result:
Warning: Invalid argument supplied for foreach() in C:\wamp\www\something\wp-content\plugins\custom-fields-creator\wordpress-creation-kit-api\wordpress-creation-kit.php on line 448
Once you clean that s:193:” and “; by hand, everything goes ok.
I screened around in your admin-filters.php file, only to find that the
$value
beeing pushed in theadd_post_meta($tr_id, $key, $value);
is sending the data perfectly.Have no idea where that initial and ending extra info is coming from, numbers change, they are not consistent with any other data, have no idea for now of what they are. s:193:” and “;.
Thanx!
Got it working!
What i’ve done was to create a purpose built Template (i.e. gallery.php) and added an action hook, so every time i add or update a page which is under a certain parent, those children will have their template changed to the one i have set to diplay the CFC Meta Box.
Like so:
-Gallery (i.e. ID = 10)
–Sub Gallery 1
–Sub Gallery 2
–Sub Gallery 3function save_page_template($post_id) { global $post; if ($post->post_type=='page' && $post->post_parent == 10){ update_post_meta($post_id,'_wp_page_template', 'gallery.php'); } } add_action('save_post', 'save_page_template', 10, 1);
So, like this, every new Sub Gallery will display the CFC Meta Box and none other page.
Maybe there is a more elegant solution for this, but for now it works fine in WP version 3.4.1.
HMG