• Resolved scysys

    (@scysys)


    UsersWP is only showing default post_status like publish on profile tabs. I have custom post_status types in Geodirectory. Is there an way to tell UsersWP to also show those custom post_status entries?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter scysys

    (@scysys)

    Actually i only have the option to override the templates like: https://userswp.io/docs/developers/override-templates/

    But with the required file “includes/libraries/class-geodirecory-plugin.php” this is not possible. Any Ideas?

    Best would be you respect in future custom post_status over settings or anything else. Or allow to override the file above. But actually it is boring to take care of this file on each update.

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

    Hi @scysys

    I will surely forward your query to our development team.
    they will add a filter there to change the query parameters.

    meanwhile, you can try below code snippet.

    add_action('pre_get_posts','alter_query');
    
    function alter_query($query) {
    	
    	if (  !is_uwp_profile_page() )
    		return;
    	
    	$post_status = array( 'publish', 'draft', 'private', 'pending', 'gd-closed', 'gd-expired' ); // add your extra post status here.
    	$query->set('post_status' , $post_status );
    	
    	//we remove the actions hooked on the '__after_loop' (post navigation)
    	remove_all_actions ( '__after_loop');
    }
    • This reply was modified 2 years, 7 months ago by 1naveengiri.
    • This reply was modified 2 years, 7 months ago by 1naveengiri. Reason: remove unwanted code
    Thread Starter scysys

    (@scysys)

    @1naveengiri That really works. Big thanks!

    Glad it worked, have a good day ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Geodirectory Integration – Show custom post_status’ is closed to new replies.