Mark Jansen
Forum Replies Created
-
Forum: Hacks
In reply to: Changing sample permalinkThe hook is called in my custom plugin using the following line:
add_filter( 'post_type_link', array( $this, 'better_match_permalinks' ), 10, 2 );
Your explanation about the filters makes sense, but shame that in this case you get the entire HTML, where you really wouldn’t want that ?? (well I don’t :P)
Forum: Hacks
In reply to: Changing sample permalinkOk, I found out perhaps the filter ‘get_sample_permalink_html’ could help me further, but I am a bit in the dark about some things.
1. Why do I not get the structure I am building when I hook into post_type_link. Why is the link that I see different and also for example, when I hover over a link in a connected post (using Posts2Posts for that), I get the ‘ugly’ URL, not my custom permalink structure
Perhaps if I understand that, I can fix this problem in a whole different way maybe. Maybe I am approaching this entirely wrong.
2. get_sample_permalink_html gives me the entire html from the permalink, get_sample_permalink is also a function, but that one has no filter. Perhaps that is something that I am overlooking or is that’s intended?
3. If I try to apply my custom permalink structure, see the code in my post above, it gives me 1970/01/01 as date. It looks like $post entirely disappears when autosave kicks in.
So all in all, I am not that much wiser, but I hope I’m getting somewhere. Anyone who can give me another kick in the right direction?
Forum: Plugins
In reply to: [Custom Post Template] Doesn't work with a Child ThemeI have the same issue. The fix 082net posted works, but is there a way to fix this in the theme? If I ever update this plugin, chances are I will lose this fix.
Forum: Plugins
In reply to: [The Events Calendar] Events Calendar Problem resulting in missing menu barI’m having the same problem.
Since the update to 2.0.11 which I did a few hours ago the menu generated by wp_nav_menu() is missing, it breaks the entire template. In fact, it only loads the header and then entirely breaks down at the menu.
I’ve read a few topics about it and I’ve found that a lot of the problems are being caused by the permalink structure. The structure I’m using is /%category%/%postname%/. But this should pose no problem right?
I’m a user of Events Calendar Pro btw, I’m not sure if that makes any difference.
Ok, still not entirely what I need. Now I get the field slug, but I also want the field label.
So I’m kinda back to square one. I now have a way to find the slug from the fields, but is there no easier way to find the label and the value of the custom fields in a group?
I came up using this:
<?php $group_fields = get_post_custom(4); $fields = explode(',', $group_fields['_wp_types_group_fields'][0]); foreach($fields as $field) { if(trim($field) != '') { $value = get_post_custom_values('wpcf-'.$field, get_the_ID()); echo $value[0]; } } ?>
Anyone have a better solution? Otherwise I’m sticking with this.
Ok I’ve only gotten so far.
Somehow it seems I can find the field names, but not the values that go with them.
Sooo, anyone? ??
$group_fields = get_post_meta($group_id, '_wp_types_group_fields', true);
Seems to do the trick! Now I have to find out how to dynamicly find the group_id, but I’m a few steps further already.
So in short, I want to use https://codex.www.ads-software.com/Function_Reference/get_post_custom but only on the fields in a certain group.
Forum: Plugins
In reply to: [Widget Image Field] [Plugin: Widget Image Field] Broken in FIrefoxCool, that worked for me. Thanks.
I hope Jonathan reads this, so there will be a fix in the next update ??
Thanks.
Forum: Plugins
In reply to: [Pronamic Google Maps] [Plugin: Pronamic Google Maps] Edit infowindowUnfortunately not. It’s a number of calculated divs. I was hoping for an easier way ??
It looks ok now, but a little bit of tweaking would have been nice ??
Yeah, I know. I was building on to something that already existed, but I should change that, I know.
This indeed seems to work. Thanks Remco
Thanks. Worked it out. This function is obsolete indeed.
Fixed. I forgot to map the capabilities….