Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Herman Aus

    (@barefoot_designer)

    Small amendment to the above code. There was an issue with making the event public from the admin.

    function make_event_private_by_default($result, $EM_Event) {
    
    	// Make it possible to make the event public from admin
    	if (get_post_status($result->ID) == 'private' AND $EM_Event->post_status == 'publish') return;
    
    	if( is_object($EM_Event) && !empty($EM_Event->event_id) ){
    		global $wpdb;
    		// This prevents the event from showing up in activity feeds
    		$EM_Event->event_private = 1;
    		// This makes the event post status private
    		$wpdb->update($wpdb->posts, array('post_status'=>'private'), array('ID'=>$EM_Event->post_id));
    		// This makes the event private so it doesn't show other members calendar
    		$wpdb->update(EM_EVENTS_TABLE, array('event_private'=>1), array('event_id'=>$EM_Event->event_id));
    	}
    
    	return $result;
    }
    add_filter('em_event_save', 'make_event_private_by_default',1,2);

    Marking this as resolved.

    Thread Starter Herman Aus

    (@barefoot_designer)

    After searching through the plugins files for em_event_save I came up with a fully working solution.

    Here is my solution with commentary for anyone else who wishes to make all events private by default.

    function make_event_private_by_default($result, $EM_Event) {
    
    	// Make it possible to make the event public from admin
    	if ($EM_Event->post_status == 'publish') return;
    
    	if( is_object($EM_Event) && !empty($EM_Event->event_id) ){
    		global $wpdb;
    		// This prevents the event from showing up in activity feeds
    		$EM_Event->event_private = 1;
    		// This makes the event post status private
    		$wpdb->update($wpdb->posts, array('post_status'=>'private'), array('ID'=>$EM_Event->post_id));
    		// This makes the event private so it doesn't show other members calendar
    		$wpdb->update(EM_EVENTS_TABLE, array('event_private'=>1), array('event_id'=>$EM_Event->event_id));
    	}
    
    	return $result;
    }
    add_filter('em_event_save', 'make_event_private_by_default',1,2);
    Thread Starter Herman Aus

    (@barefoot_designer)

    A month later I will answer my own question. ??

    Read the documentation : https://www.jfarthing.com/development/theme-my-login/templates/

    I used the shortcode and set it up on each template page like this :
    [theme-my-login login_template=”/my-custom-folder/my-login-template.php”]

    That did the trick but it doesn’t work for the login widget and the user-panel template. The login template for the widget and the user panel template I still kept in the themes root folder.

    Thank you!

    Herman

    Thread Starter Herman Aus

    (@barefoot_designer)

    Aha, that’s the one! Thank you very much.

    Great plugin btw! Very intuitive to use.

    Herman

    Thread Starter Herman Aus

    (@barefoot_designer)

    Figured out a partial solution :

    I made the sub-album link to a new page with that particular sub-albums shortcode. This assigns a new article id to the sub-album.
    I also created a custom menu in-order to hide the sub-album page on the main menu bar.

    This is all good but I have 7 sub-albums which means I would have to apply the CSS style 7 times to 7 separate article id’s !! Not really the best solution…

    Herman

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