Custom post metadata not appearing in public API

Try using the rest_api_allowed_public_metadata filter to whitelist the facebook custom field. It will then appear in the response: add_filter( ‘rest_api_allowed_public_metadata’, ‘jeherve_allow_fb_metadata’ ); function jeherve_allow_fb_metadata() { // only run for REST API requests if ( ! defined( ‘REST_API_REQUEST’ ) || ! REST_API_REQUEST ) return $allowed_meta_keys; $allowed_meta_keys[] = ‘facebook’; return $allowed_meta_keys; }

Build dynamic page from cURL (HTML page) response with plugin

To make this work with WordPress use the AJAX API. While that technically refers to Javascript it will handle any request if the appropriate values are sent. You would create a callback like this one form the Codex: add_action(‘wp_ajax_my_action’, ‘my_action_callback’); function my_action_callback() { global $wpdb; // this is how you get access to the database … Read more

Display content according to current URL

For this to work, you would have to add a rewrite that rewrites https://example.com/[manufacturer slug]/[brand slug] to index.php with e.g. manufacturer=[manufacturer slug]&brand=[brand slug]. e.g.: add_filter( ‘rewrite_rules_array’,’jf_insert_rewrite_rules’ ); function jf_insert_rewrite_rules( $rules ) { $newrules[‘^(.*)/(.*)/?$’] = ‘index.php?manufacturer=$matches[1]&brand=$matches[2]’; return $newrules + $rules; } Remember to goto permalinks page and hit save for the rewrite rules to be updated. … Read more

curl POST work with user meta but not the custom user meta

arguments get_callback and update_callback receive different arguments. try this exemple which works for a field user_continent add_action(“rest_api_init”, function () { register_rest_field( “user” , “user_continent” , [ “get_callback” => function ($user, $field_name, $request, $object_type) { return get_user_meta($user[“id”], $field_name, TRUE); }, “update_callback” => function ($value, $user, $field_name, $request, $object_type) { update_user_meta($user->ID, $field_name, $value); }, ] ); });

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)