Support » Plugin: Groups » Default group assignments

  • Resolved George

    (@quantum_leap)


    Is there a way for certain groups to be applied automatically to newly created posts? I am using a CRON script to automatically import posts from another platform and I need to assign a couple of groups by default.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Kento

    (@proaktion)

    Hi George,

    You can assign access restrictions groups using Groups_Post_Access::create( $map ) where $map hold the post_id and group_id.
    For example:

    Groups_Post_Access::create( array( 'post_id' => 123, 'group_id' => 9 ) );

    Cheers

    George

    (@quantum_leap)

    Hi Kento.

    I am sorry but I missed the automatic reply to my email. Can you please be a bit more specific? Where do I write this code? What I am after: I want to automatically assign the group with id of “4” to newly created or imported posts. Is it possible for that group to be automatically assigned (top right box to be automatically populated) when I create a new post through the WordPress admin?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.