• Resolved fduranruiz

    (@fduranruiz)


    I can create private pages automatically by creating a script that inserts the page data in the wp_post table, but I can’t understand how to assign the page to a user. How is this data stored in the database?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Foobar Studio

    (@foobarstudio)

    Hi,

    Best is to use our PHP functions in your script.

    Has a look at the files in ? customer-area/src/php/functions ?. They provide all you need to set the private page owner.

    Thread Starter fduranruiz

    (@fduranruiz)

    Hi,

    I think I found what I need in wp-content/plugins/customer-area/src/php/functions/functions-private-pages.php.

    In this file there is a single function that creates the POST, retrieves its ID and sets the owners.

    This function has two parameters, one is an array with the post data which is easy to know because they are the columns of the wp_posts table.

    The owners parameter is an array whose fields I don’t know, could you help me with an example of this array?

    Plugin Contributor Foobar Studio

    (@foobarstudio)

    Hi,

    It is an array which associates an owner type with a list of IDs.

    For example, if you want to set owner to the user 10, you should pass:

    'owners' => ['usr' => [10] ]

    Thread Starter fduranruiz

    (@fduranruiz)

    Hello,

    Thank you very much, your responses have been very helpful. Thank you also for the speed in responding, I will give you a very good review

    • This reply was modified 2 years, 2 months ago by fduranruiz.

    Hello,

    Is it possible to prepare a template with this plugin and reflect the excel data to the user according to the prepared template?

    Plugin Author Thomas

    (@tlartaud)

    Hi, @webtr

    Please consider opening a new thread when posting a new request.

    Also, not sure I understand your question, sorry.

    Could you please clarify what you’re attempting to do?

    Best regards.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Asign private pages’ is closed to new replies.