• Resolved ekko848

    (@ekko848)


    Love the look and integration of WP FullCalendar with Events Manager.

    And furthermore, the integration that Events Manager has with BuddyPress. Really great stuff.

    I’m kind of shocked, though, that WP FullCalendar does not accept the owner attribute.
    This is essential for the site I’m building, as each BuddyPress user is supposed to get their own Calendar on their own page.

    I came across this support thread over a year ago: https://ww.wp.xz.cn/support/topic/fullcalendar-and-owner/
    which has this function:

    function my_em_custom_code_wpfc($args)
    		{
    		$user_ID = get_current_user_id();
    		$args['owner'] = $user_ID; // the user id
    		return  $args;
    		}
    	add_filter('wpfc_fullcalendar_args','my_em_custom_code_wpfc',10,1);

    This is close, but it’s still incredibly limiting.

    What I’m trying to do is get $user_ID based off the post/page Authors User ID.

    And I could normally do this, right, with something like

    $user_ID = get_post_field( 'post_author', $post_ID );

    But my issue is that this function seems to run before the WordPress loop is initialized, so I’m unable to get details such as the Post ID.

    This is confusing, as looking through the code at instances for wpfc_fullcalendar_args

    : https://github.com/wp-plugins/wp-fullcalendar/blob/master/wp-fullcalendar.php#L172
    : https://github.com/wp-plugins/wp-fullcalendar/blob/master/wp-fullcalendar.php#L243

    It seems to initialize global $post, but I’m still unable to get any result when using the function.

    Does the plug-in author have any support for this? Being able to specify an owner attribute seems an obvious feature to have (especially would be great in a shortcode), but is there any work around for me to be able to specify a dynamic owner until maybe this feature is added down the line?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    hi,

    sorry at the moment this is not available; it maybe in the future but no eta yet.

    Thread Starter ekko848

    (@ekko848)

    Okay.. I’ll let you know if I find a work-around.

    I’m of course biased, but it seems like this should be an essential feature.

    The functionality is obviously there (if I manually input my $user_ID, or of course using get_current_user_id();), all that is needed is the $post variable, or perhaps a later hook in the function so that it fires after to get this data.

    Anyways, thanks for the reply.

    • This reply was modified 9 years, 9 months ago by ekko848.
    Thread Starter ekko848

    (@ekko848)

    Turns out it wasn’t an issue with getting the $post_id, I did some debugging and it was returning the correct numbers in the array.

    It is just some limitation within the plug-in itself.

    Anyways, for anyone wondering, my work-around was to create Categories for each of my users, and then filter using the shortcode

    [fullcalendar type=”event” category=”‘.$category_id.'”]

    Next best thing!

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

The topic ‘WP FullCalendar Owner’ is closed to new replies.