Using pods_by_current_user
-
Hi guys!
Pods is the TRUTH! Thanks a lot for your hardwork, I expect to donate again soon… Keep the good work!
I am sorry to bother you but i am using the pods_by_current_user code in my functions theme and its working great but I was wondering if it is possible to add another piece of code or line of code so a message appears…. something like “Sorry, no data for this user”.
I was trying to do this like the example below but it has been unsuccesfull:
`function pods_by_current_user($atts, $content = null) {
if ( ! function_exists( ‘wp_get_current_user’ ) )
return 0;
$user = wp_get_current_user();
else( ! function_exists( echo “No data for this user” ) );
$user_id = ( isset( $user->ID ) ? (int) $user->ID : 0 );
$atts[ ‘where’ ] = ‘post_author = ‘ . (int) $user_id;
return pods_shortcode( $atts, $content );
}
function register_shortcodes() {
add_shortcode(‘pods_by_current_user’, ‘pods_by_current_user’);
}
add_action( ‘init’, ‘register_shortcodes’);Please help and beforehand thanks a lot!
- The topic ‘Using pods_by_current_user’ is closed to new replies.