post_content ); $post->post_content = reset( $content ) . '[_1pass]'; } } /** * This function decides whether to show a post or not. * * If it returns true, the post will be truncated. * * Filter on onepass_restrictions to add a condition. * * @return bool */ function onepass_restrict_post( $post ) { return apply_filters( 'onepass_restrictions', false, $post ); } /** * This function sets a rule for which users see the button. * If it returns true, the button will be shown. * Feel free to unhook it and override it. * * @return bool */ function onepass_reject_unauthorised_users() { return !current_user_can( 'edit_posts' ); } add_filter( 'onepass_restrictions', 'onepass_reject_unauthorised_users' );