snorklebum
Forum Replies Created
-
Forum: Plugins
In reply to: [Newsletter - Send awesome emails from WordPress] Editor accessAhh you are right, not sure how on earth I missed that!
ThanksI couldn’t find anything built in so I followed this guide
Forum: Plugins
In reply to: [SendGrid] Plugin not compatible with latest version of WPIt’s working fine for me on the latest version, always worth testing plugins on your test site though if you are unsure.
Forum: Developing with WordPress
In reply to: Adding postmeta to wp-json custom post type@timothyblynjacobs Thank you so much, I used post_type_supports() to check for ‘custom-fields’ and it was indeed disabled, I believe this is to stop them being editable via edit. I’ve just hidden the meta boxes to get around this. Now my fields are appearing in the JSON results and I can get on with creating my application ??
Forum: Plugins
In reply to: [Bulk Delete] PermissionsExcellent, thanks for fixing so quickly!
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Rest API@colinaut I raised a query on the main wordpress support and from their testing the code above works, I’ve not had the same success.
If you do get a chance to test could you let me know if you have any luck?
Thanks
Forum: Developing with WordPress
In reply to: Adding postmeta to wp-json custom post typeWell this is frustrating, at the moment I’m testing this on a clean build site with twenty-nineteen and events manager is the only plugin.
On posts I see this with the two additional fields
On events I see the standard wp meta but not those asked for in register_meta
I’ll see if any of the others who have been trying to do the same have had any further luck.
Thanks for looking in to this with me.
Forum: Developing with WordPress
In reply to: Adding postmeta to wp-json custom post typeSo I’m using post and when I navigate to wp-json/wp/v2/pages ot wp-json/wp/v2/posts I see the meta fields and obviously they are currently “” as I’d expect. When I go to wp-json/wp/v2/events the normal entries are show but no meta entry. Is there anyway to extend this so that custom types meta is supported?
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Attendees.phpHi,
https://pastebin.com/u/eventsmanager has some examples of changing the attendees.php file which you can likely customize to add
get_avatar($EM_Booking->get_person()->ID, 50)
If you use buddypress this site may cover what you are after.
Forum: Developing with WordPress
In reply to: Adding postmeta to wp-json custom post typeThanks for the reply, apologies if I’ve misunderstood but you seem to be implying that the code above is correct(register_meta( ‘post’,..), the events data I am trying to expose is in the wp_postmeta table.
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Rest APIThe default information exposed via the REST api is what would be standard on a post, none of the fields listed above will display unless show_in_rest is set to true. Personally I’m only interested in exposing a few of these and custom attributes which area also in the postmeta table, I’ve tried adding variations of the following to functions.php
// The object type. For custom post types, this is 'post'; // for custom comment types, this is 'comment'. For user meta, // this is 'user'. $object_type = 'post'; $args1 = array( // Validate and sanitize the meta value. // Note: currently (4.7) one of 'string', 'boolean', 'integer', // 'number' must be used as 'type'. The default is 'string'. 'type' => 'string', // Shown in the schema for the meta key. 'description' => 'A meta key associated with a string meta value.', // Return a single value of the type. 'single' => true, // Show in the WP REST API response. Default: false. 'show_in_rest' => true ); register_meta( $object_type, '_event_start_local', $args1 );
I’m probably doing things completely wrong ??
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Rest APIThe code above allows the events to be listed via the wp-json api which in turn lets me use the data in an app I’m playing with. My only issue at the moment is getting the custom meta relating to these events exposed using the same method.
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Rest APIHi Colinaut,
Just been looking at this myself today and added the following to functions.php
add_filter( 'register_post_type_args', 'my_post_type_args', 10, 2 ); function my_post_type_args( $args, $post_type ) { if ( 'event' === $post_type ) { $args['show_in_rest'] = true; // Optionally customize the rest_base or rest_controller_class $args['rest_base'] = 'events'; $args['rest_controller_class'] = 'WP_REST_Posts_Controller'; } return $args; }
Now I can see my events listed within wp-json/wp/v2/events and query specific events. I’ve not managed to work out how to make custom meta appear yet.
Forum: Plugins
In reply to: [Newsletter - Send awesome emails from WordPress] Default targettingThanks Robert but ideally I’m looking for something that can either be configured on the templates or setting the correct options on the form.
Although your method would work I’d then be reliant on my other contributors selecting the correct previously sent message from the list, considering I can’t get them to remember to change the settings I’ll just end up with a different problem.Forum: Plugins
In reply to: [Events Manager - OpenStreetMaps] [location] shortcodeAlso is there a reason the plugin always needs to be activated again after updating?
*edit* typical I post this and then update two of my sites and it doesn’t happen, this can likely be ignored.