Created
August 11, 2023 09:41
-
-
Save wbcomdev/1697ae23aaa5b5c86eb7b0ab818d0555 to your computer and use it in GitHub Desktop.
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
| /** | |
| * Wbcom Designs - Hide Job Tab | |
| * | |
| <?php | |
| * @return void | |
| */ | |
| function wbcom_hide_job_tab_no_posting() { | |
| global $wpdb; | |
| $user_id = get_current_user_id(); | |
| $job_query = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'job_listing' AND post_author = $user_id " ); | |
| if ( empty( $job_query ) ) { | |
| ?> | |
| <style> | |
| #jobs-personal-li{ | |
| display: none; | |
| } | |
| </style> | |
| <?php | |
| } | |
| } | |
| add_action( 'wp_head', 'wbcom_hide_job_tab_no_posting' ); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment