mypluginurl.'front.css', // src false, // deps ATTMGR::PLUGIN_VERSION, // ver 'all' // media ); // js wp_enqueue_script( ATTMGR::PLUGIN_ID.'_script', // handle $attmgr->mypluginurl.'front.js', // src array( 'jquery' ), // deps ATTMGR::PLUGIN_VERSION, // ver true // in footer ); } /** * Get user portrait */ public function get_portrait( $portrait, $staff ) { global $attmgr; $option = get_option( ATTMGR::PLUGIN_ID ); $p = null; // Use Featured image if ( empty( $option['general']['use_avatar'] ) ) { $p = get_the_post_thumbnail( $staff->data[ATTMGR::PLUGIN_ID.'_mypage_id'], 'thumbnail' ); } // Use Avatar else { $p = get_avatar( $staff->data['ID'] ); $search = array( "class='", 'class="' ); $replace = array( "class='wp-post-image ", 'class="wp-post-image ' ); $p = str_replace( $search, $replace, $p ); } if ( ! empty( $p ) ) { $portrait = $p; } else { $portrait = sprintf( '', $attmgr->mypluginurl ); } // Link if ( ! empty( $staff->data['user_url'] ) ) { $portrait = sprintf( '%s', $staff->data['user_url'], $portrait ); } return $portrait; } }