Title: laportjo's Replies | WordPress.org

---

# laportjo

  [  ](https://wordpress.org/support/users/laportjo/)

 *   [Profile](https://wordpress.org/support/users/laportjo/)
 *   [Topics Started](https://wordpress.org/support/users/laportjo/topics/)
 *   [Replies Created](https://wordpress.org/support/users/laportjo/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/laportjo/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/laportjo/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/laportjo/engagements/)
 *   [Favorites](https://wordpress.org/support/users/laportjo/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[IdeaPush] Rest API meta box number of votes](https://wordpress.org/support/topic/rest-api-meta-box-number-of-votes/)
 *  Thread Starter [laportjo](https://wordpress.org/support/users/laportjo/)
 * (@laportjo)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/rest-api-meta-box-number-of-votes/#post-15008952)
 * Ok I found the solution. I put it in my theme functions file :
 *     ```
       function add_votes_field() {
       register_rest_field(
       'idea', 
       'votes', //Field Name in JSON RESPONSE
       array(
               'get_callback'    => function() {
               return get_post_meta( get_the_ID(), 'votes', true );
               }
           )
       );
       }
       add_action( 'rest_api_init', 'add_votes_field' );
   
       function idea_push_update_custom_post_type( $args, $post_type ) {
           if ( $post_type !== 'idea' ) {
                return $args;
           }
   
           // Add additional IDEA CPT options.
           $idea_args = array(
               'show_in_rest' => true,
           );
        // Merge args together.
        return array_merge( $args, $idea_args );
       }
       add_filter( 'register_post_type_args', 'idea_push_update_custom_post_type', 10, 2 );
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[IdeaPush] Translations missing for the comments](https://wordpress.org/support/topic/translations-missing-for-the-comments/)
 *  Thread Starter [laportjo](https://wordpress.org/support/users/laportjo/)
 * (@laportjo)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/translations-missing-for-the-comments/#post-15008570)
 * Yes they’re not in the POT file.
 * When everything will be in the POT file, I’ll be able to transfer you the French
   version.
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)