zz_james
Forum Replies Created
-
Forum: Plugins
In reply to: [squat-radar] Getting a lot of errors?thanks, good stuff 🙂
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] POSTing file to /media endpointworks, had also to remove the part of the Content-Disposition ‘attachment;’ to make it work completely.
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] POSTing file to /media endpointAh ok I think the problem was I was generating the nonce with
wp_create_nonce(‘wp_json’)
instead of
wp_create_nonce( ‘wp_rest’ )Forum: Plugins
In reply to: [WordPress REST API (Version 2)] POSTing file to /media endpointBut the response I get is
{“code”:”rest_cookie_invalid_nonce”,”message”:”Cookie nonce is invalid”,”data”:{“status”:403}}
I dealt with this by removing some of the default filters:
function my_api_init($server) { // ...custom init code..... // we don't need all that extra data in the post global $wp_json_posts, $wp_json_pages, $wp_json_media, $wp_json_taxonomies; remove_filter( 'json_prepare_post', array( $wp_json_users, 'add_post_author_data' ), 10); remove_filter( 'json_prepare_post', array( $wp_json_media, 'add_thumbnail_data' ), 10); } add_action( 'wp_json_server_before_serve', 'my_api_init', 11, 1 );your mileage may vary…(?)
Same.
Forum: Plugins
In reply to: [WP REST API Filter Fields] Meta keysI would like to be able to do this also.
Many thanks
James
Forum: Fixing WordPress
In reply to: User Categories in 2.7you can also use ‘user_nicename’ field.
Forum: Fixing WordPress
In reply to: Allowing shortcode in custom fieldsI can’t find a hook/filter construct to handle custom fields, but I did this (below) and it worked, the disadvantage is that it is in the theme, so if you change the theme it will not work, but this is kind of a normal situation when using custom fields anyway, so I guess it’s ok.
in your theme file do
$values = get_post_custom_values(‘your custom field key’);
$shortcode_output = do_shortcode($values[0]);
print $shortcode_output;we use it on this site http://www.worldofarthurcox.co.uk/site so through the admin they can put the description of the animations in the normal post box, and the shortcode for wordtube in a custom field box underneath.