Title: assign_to short code
Last modified: August 27, 2018

---

# assign_to short code

 *  Resolved [Suiram](https://wordpress.org/support/users/suiram/)
 * (@suiram)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/assign_to-short-code/)
 * Hi!
    The text in your “Get Help” > “Shortcodes” suggest that is possible to add
   multiple post to “assign_to” parameter on “[site_reviews_form]” shortcode:
 * > The “assign_to” attribute allows you to automatically assign submitted reviews
   > to a post or page. **Accepted values are either one or more post/page ID’s (
   > separated by commas)**, or “post_id” which will assign reviews to the ID of
   > the current page.
 * Such feature should be usefull (for instance on multilanguage sites) working 
   as tags taxonomy, as otherwise it is needed to define one category for each set
   of translations… which is a bit annoying.

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

 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/assign_to-short-code/#post-10629691)
 * Please provide the plugin you are using on your multilingual website, and explain
   how you are presently using Site Reviews.
 * Also, please explain in more detail the problem you are experiencing.
 * Thanks
    -  This reply was modified 7 years, 7 months ago by [Gemini Labs](https://wordpress.org/support/users/geminilabs/).
 *  Thread Starter [Suiram](https://wordpress.org/support/users/suiram/)
 * (@suiram)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/assign_to-short-code/#post-10632477)
 * I’m using polylang.
    The point is that the review itself is about the same product/
   service, no matters the language is writen with. So I want that each product/
   service show the reviews aggregation of both languages.
 * For instance:
    - Product A in language 1: 3 reviews
    - Product A in language 2: 5 reviews
 * The review summary of product A should be about 8 reviews.
 * This could be done through the “assign_to” parameter of “site_reviews_form” shortode.
   If only could be assigned to both IDs.
 * Talking about polylang plugin, the function “pll_get_post($post_id, $slug)” could
   be used to get IDs of each product A languages:
    - In language 1: `$ID_prod_a_lang1 = pll_get_post(product_a_id, 'language-1')`
    - And in language 2: `$ID_prod_a_lang2 = pll_get_post(product_a_id, 'language-
      2')`
 * It could be great if the shortcode [site_reviews_form], could be used as follows:
   `
   echo so_shortcode('[site_reviews_form assign_to="'.$ID_prod_a_lang1.','.$ID_prod_a_lang2.'"]');`
   As the “Get Help” > “Shortcodes” suggests in the text:
 * > The “assign_to” attribute allows you to automatically assign submitted reviews
   > to a post or page. Accepted values are either one or more post/page ID’s (separated
   > by commas), or “post_id” which will assign reviews to the ID of the current
   > page.
    -  This reply was modified 7 years, 7 months ago by [Suiram](https://wordpress.org/support/users/suiram/).
    -  This reply was modified 7 years, 7 months ago by [Suiram](https://wordpress.org/support/users/suiram/).
 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/assign_to-short-code/#post-10634414)
 * How many languages do you have on your website?
 * Most sites have between 2-4 languages, so in your case it would make much more
   sense to assign to categories instead of post_ids.
 * For example, if you have three languages on your site, create a Site Reviews 
   category for each language (en, de, fr), then use the shortcodes like this:
 * **All pages:**
    [site_reviews_form category=en,fr,de] [site_reviews_summary category
   =en,fr,de hide=summary]
 * **Specific language page:**
    [site_reviews category=en] [site_reviews category
   =de] [site_reviews category=fr]
 * This makes the shortcodes much more flexible. Otherwise you lose the benefit 
   of using the dynamic “post_id” value (i.e. assigned_to=post_id) and instead would
   need to specify the specific post_id on each page (or use PHP code to determine
   the correct IDs).
    -  This reply was modified 7 years, 7 months ago by [Gemini Labs](https://wordpress.org/support/users/geminilabs/).
 *  Thread Starter [Suiram](https://wordpress.org/support/users/suiram/)
 * (@suiram)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/assign_to-short-code/#post-10635780)
 * I have two languages.
 * If I do as stated by you creating two categories (one for each language), and
   assigned on [site_reviews_form], and getted by [site_reviews_summary], then every[
   site_reviews_summary] retrieve the information for the whole language, which 
   includes the reviews of all products, posts and pages of that category.
 * And I need to keep each review withs its product. This can be done easyly thorugh“
   assign_to” and “assigned_to” parameters.
    The point is that thouse parameters
   only allow one post.
 * Returning to the origins of my post: the (for instance) product A is the same,
   regardless of the language.
    So it has sense to summarize all of its reviews 
   regardless the language. And that’s why I’d like to aggregate all reviews of 
   product A, never mind if they are written on language 1 or language2.
 * I agree that this can be done though categories: creating a category for each
   product (cat_prodA, for instance) and on the product [site_reviews_form] of both
   languages assign to that “cat_prodA” to retrieve it on [site_reviews_summary]
   of any language.
 * But, instead of assign the review to one category for each product, it’s much
   easyer to assign the review to both posts languages IDs, as then, there is no
   need of create anything.
    (Again…) The problem is that the plugin only allows
   to assign a review to a single post.
 * And that’s what I’m proposing you to improve: allow to assign the review to an
   array of posts.
 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/assign_to-short-code/#post-10636618)
 * Hi [@suiram](https://wordpress.org/support/users/suiram/)
 * You are correct and I understand the problem better now.
 * I will add support for Polylang to the roadmap. This will (most likely) be added
   to v3.0 which was **supposed** to be released this month but has been delayed
   due to other projects. It now looks like it will be released in September.
 * Until then, you may need to use the categories option as there is no easy alternate
   solution.
 *  Thread Starter [Suiram](https://wordpress.org/support/users/suiram/)
 * (@suiram)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/assign_to-short-code/#post-10638771)
 * Thank you, I hope the code mentioned above be of some use:
 * > Talking about polylang plugin, the function “pll_get_post($post_id, $slug)”
   > could be used to get IDs of each product A languages:
    - Product A ID, In language 1: `$ID_prod_a_lang1 = pll_get_post(product_a_id,'
      language-1')`
    - Product A ID, in language 2: `$ID_prod_a_lang2 = pll_get_post(product_a_id,'
      language-2')`
 *  -  This reply was modified 7 years, 7 months ago by [Suiram](https://wordpress.org/support/users/suiram/).
 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/assign_to-short-code/#post-10677431)
 * [@suiram](https://wordpress.org/support/users/suiram/) Would you be interested
   to test the beta of Site Reviews v3.0 which includes Polylang integration?
 * If yes, please send an email to `site-reviews[at]geminilabs[dot]io`, along with
   the number of existing reviews that you have.
    -  This reply was modified 7 years, 7 months ago by [Gemini Labs](https://wordpress.org/support/users/geminilabs/).
    -  This reply was modified 7 years, 7 months ago by [Gemini Labs](https://wordpress.org/support/users/geminilabs/).
    -  This reply was modified 7 years, 7 months ago by [Gemini Labs](https://wordpress.org/support/users/geminilabs/).

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

The topic ‘assign_to short code’ is closed to new replies.

 * ![](https://ps.w.org/site-reviews/assets/icon-256x256.gif?rev=3307009)
 * [Site Reviews](https://wordpress.org/plugins/site-reviews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/site-reviews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/site-reviews/)
 * [Active Topics](https://wordpress.org/support/plugin/site-reviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/site-reviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/site-reviews/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/assign_to-short-code/#post-10677431)
 * Status: resolved