• Hello,

    Hopefully someone can help.

    I am looking to hide a button on the URL provided when there is an entry in the table above it.

    The table appears when a user creates a post (custom post type). The table is a shortcode from the WordPress User Frontend Plugin (WPUF) please see link:
    https://wedevs.com/docs/user-dashboard/

    I cannot find the right function to attach the conditional visibility to and any help would be most appreciated as I know this is a more specific and obscure request.

    Thanks in advance

    Kind regards
    Colin Tait

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Jonathan Horowitz

    (@jhorowitz)

    Hi @colt5034,

    This plugin appears to be displaying a custom post type.

    This code returns the number of published posts in the post type ‘your-custom-post-type’:
    wp_count_posts('your-custom-post-type')->publish

    You could write something like this in your theme’s functions.php

    
    function my_theme_has_published_posts_of_type($type) {
      return wp_count_posts($type)->publish > 0;
    }
    

    and then use it in the visibility screen as
    !my_theme_has_published_posts_of_type('the type you are putting in the shortcode') (notice the ! in the front, since we only want to show the content if it does not have any posts of that type!)

    Let me know if that helps! Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘WPUF Table’ is closed to new replies.