• 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

    (@aurovrata)

    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

    (@vprat)

    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.