Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelogs/naming-conventions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: patch
type: fixed
entry: "Fixed naming-convention warnings reported by WordPress.org Plugin Check. Renamed several internal helper functions (llms_get_course, llms_get_lesson, llms_get_section_data, llms_get_lesson_data, llms_get_product_query_var, llms_get_available_payment_options) and the internal admin meta-box field interface (LLMS_Metabox_Field_Interface). Public API functions, template variables, WordPress core hook names, and vendored libraries were not changed. Deprecated wrappers added for backward compatibility."
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
defined( 'ABSPATH' ) || exit;

/**
* Meta_Box_Field_Interface interface
* LLMS_Metabox_Field_Interface interface
*
* @since Unknown
* @deprecated [version] The old interface name `Meta_Box_Field_Interface` is deprecated. Use `LLMS_Metabox_Field_Interface`.
*/
interface Meta_Box_Field_Interface {
interface LLMS_Metabox_Field_Interface {

public function output();
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

defined( 'ABSPATH' ) || exit;

class LLMS_Metabox_Basic_Editor_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Basic_Editor_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

public function __construct( $_field ) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Button_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Button_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @since Unknown
* @since 4.0.0 Remove reliance on `LLMS_Svg` class.
*/
class LLMS_Metabox_Checkbox_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Checkbox_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Color_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Color_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Custom_Html_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Custom_Html_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Date_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Date_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @since Unknown
* @since 3.30.3 Explicitly define class properties.
*/
class LLMS_Metabox_Editor_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Editor_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Array of editor arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Hidden_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Hidden_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @since ??
* @since 3.24.0 Unknown.
*/
class LLMS_Metabox_Image_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Image_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Number_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Number_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {


public function __construct( $_field ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Post_Content_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Post_Content_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Post_Excerpt_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Post_Excerpt_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @since 3.11.0
* @version 3.17.3
*/
class LLMS_Metabox_Repeater_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Repeater_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Search_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Search_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Select_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Select_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Table_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Table_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @since Unknown
* @since 3.36.0 When outputting the field's value convert quotes (double and single) HTML entities back to characters.
*/
class LLMS_Metabox_Text_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Text_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {


public function __construct( $_field ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Textarea_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Textarea_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @since Unknown
*/
class LLMS_Metabox_Textarea_W_Tags_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {
class LLMS_Metabox_Textarea_W_Tags_Field extends LLMS_Metabox_Field implements LLMS_Metabox_Field_Interface {

/**
* Class constructor.
Expand Down
2 changes: 1 addition & 1 deletion includes/class-llms-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LLMS_Loader {
// Meta box fields.
'llms_metabox_field' => 'includes/admin/post-types/meta-boxes/fields/llms.class.meta.box.fields.php',
'llms_metabox_textarea_w_tags_field' => 'includes/admin/post-types/meta-boxes/fields/llms.class.meta.box.textarea.tags.php',
'meta_box_field_interface' => 'includes/admin/post-types/meta-boxes/fields/llms.interface.meta.box.field.php',
'llms_metabox_field_interface' => 'includes/admin/post-types/meta-boxes/fields/class-llms-metabox-field-interface.php',

// Missing "Model" from class name.
'llms_access_plan' => 'includes/models/model.llms.access.plan.php',
Expand Down
30 changes: 28 additions & 2 deletions includes/functions/llms.functions.course.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @param array $args Arguments to pass to the LLMS_Course Constructor.
* @return LLMS_Course
*/
function get_course( $the_course = false, $args = array() ) {
function llms_get_course( $the_course = false, $args = array() ) {

if ( ! $the_course ) {
global $post;
Expand All @@ -31,6 +31,19 @@ function get_course( $the_course = false, $args = array() ) {

}

/**
* Get course object
*
* @deprecated [version] Use llms_get_course() instead.
*
* @param WP_Post|int|false $the_course Course post object or id. If `false` uses the global `$post` object.
* @param array $args Arguments to pass to the LLMS_Course Constructor.
* @return LLMS_Course
*/
function get_course( $the_course = false, $args = array() ) {
return llms_get_course( $the_course, $args );
}

/**
* Get lesson object
*
Expand All @@ -41,7 +54,7 @@ function get_course( $the_course = false, $args = array() ) {
* @param array $args Arguments to pass to the LLMS_Lesson Constructor.
* @return LLMS_Lesson
*/
function get_lesson( $the_lesson = false, $args = array() ) {
function llms_get_lesson( $the_lesson = false, $args = array() ) {

if ( ! $the_lesson ) {
global $post;
Expand All @@ -51,3 +64,16 @@ function get_lesson( $the_lesson = false, $args = array() ) {
return new LLMS_Lesson( $the_lesson, $args );

}

/**
* Get lesson object
*
* @deprecated [version] Use llms_get_lesson() instead.
*
* @param WP_Post|int|false $the_lesson Lesson post object or id. If `false` uses the global `$post` object.
* @param array $args Arguments to pass to the LLMS_Lesson Constructor.
* @return LLMS_Lesson
*/
function get_lesson( $the_lesson = false, $args = array() ) {
return llms_get_lesson( $the_lesson, $args );
}
59 changes: 53 additions & 6 deletions includes/llms.template.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ function llms_setup_lesson_data( $post ) {
$parent_course = get_post( $courseid );
}

$GLOBALS['lesson'] = get_lesson( $post );
$GLOBALS['lesson'] = llms_get_lesson( $post );

llms_setup_course_data( $parent_course );

Expand All @@ -556,7 +556,7 @@ function llms_setup_lesson_data( $post ) {
* @param array
* @return array
*/
function get_section_data( $sections ) {
function llms_get_section_data( $sections ) {
global $post;
$html = '';
$args = array(
Expand Down Expand Up @@ -584,13 +584,25 @@ function get_section_data( $sections ) {
return $array;
}

/**
* Returns post array of data for sections associated with a course
*
* @deprecated [version] Use llms_get_section_data() instead.
*
* @param array $sections Array of section IDs.
* @return array
*/
function get_section_data( $sections ) {
return llms_get_section_data( $sections );
}

/**
* Returns post array of data for lessons associated with a course
*
* @param array
* @return array
*/
function get_lesson_data( $lessons ) {
function llms_get_lesson_data( $lessons ) {
global $post;
$html = '';
$args = array(
Expand Down Expand Up @@ -618,6 +630,18 @@ function get_lesson_data( $lessons ) {
return $array;
}

/**
* Returns post array of data for lessons associated with a course
*
* @deprecated [version] Use llms_get_lesson_data() instead.
*
* @param array $lessons Array of lesson IDs.
* @return array
*/
function get_lesson_data( $lessons ) {
return llms_get_lesson_data( $lessons );
}

/**
* Get Page Title
*
Expand Down Expand Up @@ -1019,19 +1043,31 @@ function llms_person_my_courses_url() {
* @param array $vars [array of query variables]
* @return array $vars [array of query variables]
*/
function get_product_query_var( $vars ) {
function llms_get_product_query_var( $vars ) {
$vars[] = 'product';
return $vars;
}
add_filter( 'query_vars', 'get_product_query_var' );
add_filter( 'query_vars', 'llms_get_product_query_var' );

/**
* Get Product Query Var
*
* @deprecated [version] Use llms_get_product_query_var() instead.
*
* @param array $vars [array of query variables]
* @return array $vars [array of query variables]
*/
function get_product_query_var( $vars ) {
return llms_get_product_query_var( $vars );
}

/**
* Get available payment gateway options
* Get's available payment gateways options IE: single, recurring
*
* @return void
*/
function get_available_payment_options() {
function llms_get_available_payment_options() {

$_available_options = array();
$option_prefix = 'lifterlms_gateway_enable_';
Expand All @@ -1054,6 +1090,17 @@ function get_available_payment_options() {
}
}

/**
* Get available payment gateway options
*
* @deprecated [version] Use llms_get_available_payment_options() instead.
*
* @return void
*/
function get_available_payment_options() {
return llms_get_available_payment_options();
}

/**
* Get Product Object
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function set_up_before_class() {

parent::set_up_before_class();

require_once LLMS_PLUGIN_DIR . 'includes/admin/post-types/meta-boxes/fields/llms.interface.meta.box.field.php';
require_once LLMS_PLUGIN_DIR . 'includes/admin/post-types/meta-boxes/fields/class-llms-metabox-field-interface.php';
require_once LLMS_PLUGIN_DIR . 'includes/admin/post-types/meta-boxes/fields/llms.class.meta.box.fields.php';
require_once LLMS_PLUGIN_DIR . 'includes/admin/post-types/meta-boxes/fields/llms.class.meta.box.textarea.tags.php';

Expand Down
Loading