Title: Error in function cuar_create_private_page()
Last modified: September 2, 2016

---

# Error in function cuar_create_private_page()

 *  [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/error-in-function-cuar_create_private_page/)
 * Hi,
    the function `cuar_create_private_page` in file `src/php/functions/functions-
   private-pages.php` which I understand can be used to programmatically create 
   new private pages is throwing an error on line 48 due to the format of the `$
   owners` array.
 * The documentation suggests the array format to be,
 *     ```
       array(
       'type'=>'usr',
       'ids'=>array(1,3,7)
       )
       ```
   
 * however this throws up an error in the class function `CUAR_PostOwnerAddOn:save_post_owners`.
 * I believe that line 48 in the function `cuar_create_private_page` should be changed
   to
 *     ```
       $po_addon->save_post_owners( $post_id, array($owner['type'] => $owner['ids']), true );
       ```
   
 * for it to work as per your documentation.
 * Can you please check and confirm this.

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

 *  Thread Starter [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/error-in-function-cuar_create_private_page/#post-7723225)
 * The function is not being loaded by the plugin, so maybe you guys should remove
   it altogether. I guess it is old code. I created my own function instead.
 *  Plugin Contributor [Vincent Mimoun-Prat](https://wordpress.org/support/users/vprat/)
 * (@vprat)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/error-in-function-cuar_create_private_page/#post-8159940)
 * I have corrected the function and added the file to the loader. Thanks for the
   bug report.

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

The topic ‘Error in function cuar_create_private_page()’ is closed to new replies.

 * ![](https://ps.w.org/customer-area/assets/icon-256x256.png?rev=1288039)
 * [WP Customer Area](https://wordpress.org/plugins/customer-area/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/customer-area/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/customer-area/)
 * [Active Topics](https://wordpress.org/support/plugin/customer-area/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/customer-area/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/customer-area/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Vincent Mimoun-Prat](https://wordpress.org/support/users/vprat/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/error-in-function-cuar_create_private_page/#post-8159940)
 * Status: not resolved