Created
February 22, 2018 08:22
-
-
Save albionselimaj/f4dc33bbe2dfe9eba7d41838dd36a35f to your computer and use it in GitHub Desktop.
Hide "Add Listing" button for users with at least one active listing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_enqueue_scripts', function() { | |
if ( is_user_logged_in() && count_user_posts( get_current_user_id(), 'job_listing' ) >= 1 ) { | |
wp_add_inline_style( 'theme-styles-default', '.c27-main-header .header-button { display: none !important; }' ); | |
} | |
}, 500 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
This is for all the users, how can i do that just for the employer role and NOT for the others?
Thank You