LifterLMS 확장 – Private Areas Filters

LifterLMS 확장 – Private Areas Filters

개요

필터(Filters)가 무엇인지 모르겠다면 필터에 대한 WordPress Codex 참조 및 핵심 함수인 add_filter()를 살펴보세요.

테마 또는 하위 테마의 functions.php 파일 또는 site-specific 플러그인에 필터를 추가할 수 있습니다. 이를 위해 LifterLMS에서 매우 기본적인 플러그인을 만들었으며 여기를 눌러 무료로 다운로드 할 수 있습니다.

개발자이고, 무언가를 필터링하려는 경우 사용할 수 있습니다. 여기에 나와있지 않은 경우 먼저 코드베이스를 확인한 다음 필터를 찾는데 도움이 필요하면 지원 티켓을 제출하세요.

llms_pa_comments_per_page

프라이빗 영역 게시물의 각 페이지에 표시되는 댓글 수를 사용자 지정합니다.

<?php // don't copy this to your functions.php file
/**
 * Customize the number of comments displayed on each page of a Private Area Post
 * @param    int     $number  default # of comments (50)
 * @return   int
 */
function my_llms_pa_comments_per_page( $number ) {
	return 100;
}
add_filter( 'llms_pa_comments_per_page', 'my_llms_pa_comments_per_page', 10, 1 );

llms_pa_html_discussion

프라이빗 게시물의 댓글에서 HTML 빠른 태그를 비활성화합니다.

<?php // don't copy this to your functions.php file

/**
 * Disable HTML quick tags for discussion (comments) on PA Posts
 */
add_filter( 'llms_pa_html_discussion', '__return_false' );

위와 동일하지만 관리자가 관리자 패널에서 HTML 빠른 태그를 사용할 수 있도록 합니다 (사용자 화면의 학생만 사용 안함).

<?php // don't copy this to your functions.php file
/**
 * customize PA commenting to Allow HTML quicktags for admins only
 * @param    boolean   $bool  default HTML status (true)
 * @return   boolean
 */
function my_llms_pa_html_discussion( $bool ) {
	if ( ! is_admin() ) {
		return false;
	}
	return $bool;
}
add_filter( 'llms_pa_html_discussion', 'my_llms_pa_html_discussion' );

llms_pa_post_clone_status

프라이빗 게시물을 복제할 때 비공개 영역 게시물의 기본 상태를 사용자 지정합니다.

참고: 게시를 하면 복사된 게시물의 알림까지 중복되서 갑니다.

<?php // don't copy this to your functions.php file
/**
 * Customize the default status of a Private Area post when duplicating a PA post
 * NOTE: if you set to publish, notifications will be sent IMMEDIATELY possilby resulting in a student getting a duplicate notification!
 * @param    string     $status  default status (draft)
 * @return   string
 */
function my_llms_pa_post_clone_status( $status ) {
	return 'publish;' // set this to be any valid WP Post Status
}
add_filter( 'llms_pa_post_clone_status', 'my_llms_pa_post_clone_status', 10, 1 );

llms_pa_post_excerpt_length

프라이빗 게시물 요약 영역의 문자 길이를 사용자 지정합니다.

<?php // don't copy this to your functions.php file

/**
 * Customize the length (in words) of Private Area post excerps
 * @param    int     $length  default word count (55)
 * @return   int
 */
function my_llms_pa_post_excerpt_length( $length ) {
	return 85;
}
add_filter( 'llms_pa_post_excerpt_length', 'my_llms_pa_post_excerpt_length', 10, 1 );

llms_pa_post_roles_can_discuss

관리자 화면에서 추가된 역할이 프라이빗 영역 게시물에 대해 토론하도록 허용합니다.

<?php // don't copy this to your functions.php file
/**
 * Allow additional roles to discuss a PA post from the admin panel
 * @param    array     $roles  array of WP_Role names
 * @return   array
 */
function my_llms_pa_post_roles_can_discuss( $roles ) {
	$roles[] = 'editor';
	return $roles;
}
add_filter( 'llms_pa_post_roles_can_discuss', 'my_llms_pa_post_roles_can_discuss', 10, 1 );

llms_pa_post_show_time

프라이빗 영역 게시물에 게시된 시간이 표시되지 않도록 합니다.

<?php // don't copy this to your functions.php file
/**
 * Do not show the posted time for PA posts
 */
add_filter( 'llms_pa_post_show_time', '__return_false' );

원문: https://lifterlms.com/docs/private-areas-filters/

코멘트 제출

Don`t copy text!