Skip to content

Commit

Permalink
Moving setting of translatable strings until later.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhogg committed Nov 18, 2024
1 parent 667bd5e commit aeb401b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
15 changes: 5 additions & 10 deletions includes/integrations/class.llms.integration.bbpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class LLMS_Integration_BBPress extends LLMS_Abstract_Integration {
*/
protected function configure() {

$this->title = __( 'bbPress', 'lifterlms' );
$this->description = sprintf( __( 'Restrict forums and topics to memberships, add forums to courses, and %1$smore%2$s.', 'lifterlms' ), '<a href="https://lifterlms.com/docs/lifterlms-and-bbpress/" target="_blank">', '</a>' );
add_action( 'init', array( $this, 'set_title_and_description' ) );

if ( $this->is_available() ) {

Expand Down Expand Up @@ -78,7 +77,11 @@ protected function configure() {
add_action( 'llms_content_restricted_by_bbp_course_forum', array( $this, 'handle_course_forum_restriction' ), 10, 1 );

}
}

public function set_title_and_description() {
$this->title = __( 'bbPress', 'lifterlms' );
$this->description = sprintf( __( 'Restrict forums and topics to memberships, add forums to courses, and %1$smore%2$s.', 'lifterlms' ), '<a href="https://lifterlms.com/docs/lifterlms-and-bbpress/" target="_blank">', '</a>' );
}

/**
Expand Down Expand Up @@ -176,7 +179,6 @@ public function engagement_query_args( $query_args, $action, $orig_args ) {
}

return $query_args;

}

/**
Expand Down Expand Up @@ -205,7 +207,6 @@ public function handle_course_forum_restriction( $restriction ) {

llms_add_notice( $msg, 'error' );
llms_redirect_and_exit( get_permalink( $restriction['restriction_id'] ) );

}

/**
Expand Down Expand Up @@ -237,7 +238,6 @@ public function get_course_forum_ids( $course ) {
* @param LLMS_Course $course LifterLMS course object.
*/
return apply_filters( 'llms_bbp_get_course_forum_ids', $ids, $course );

}

/**
Expand Down Expand Up @@ -268,7 +268,6 @@ public function get_forum_course_restrictions( $forum_id ) {
$query = array_map( 'absint', $query );

return $query;

}

/**
Expand Down Expand Up @@ -347,7 +346,6 @@ public function restriction_checks_courses( $results ) {
}

return $results;

}

/**
Expand Down Expand Up @@ -389,7 +387,6 @@ public function restriction_checks_memberships( $results ) {
}

return $results;

}

/**
Expand Down Expand Up @@ -435,7 +432,5 @@ public function save_course_settings( $post_id ) {
update_post_meta( $post_id, '_llms_bbp_forum_ids', $ids );

return $ids;

}

}
21 changes: 6 additions & 15 deletions includes/integrations/class.llms.integration.buddypress.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ class LLMS_Integration_Buddypress extends LLMS_Abstract_Integration {
*/
protected function configure() {

$this->title = __( 'BuddyPress', 'lifterlms' );
$this->description = sprintf( __( 'Add LifterLMS information to user profiles and enable membership restrictions for activity, group, and member directories. %1$sLearn More%2$s.', 'lifterlms' ), '<a href="https://lifterlms.com/docs/lifterlms-and-buddypress/" target="_blank">', '</a>' );
add_action( 'init', array( $this, 'set_title_and_description' ) );

if ( $this->is_available() ) {

Expand All @@ -78,7 +77,11 @@ protected function configure() {
add_filter( 'llms_groups_maybe_hide_dashboard_tab', array( $this, 'return_true_on_bp_my_profile' ) );

}
}

public function set_title_and_description() {
$this->title = __( 'BuddyPress', 'lifterlms' );
$this->description = sprintf( __( 'Add LifterLMS information to user profiles and enable membership restrictions for activity, group, and member directories. %1$sLearn More%2$s.', 'lifterlms' ), '<a href="https://lifterlms.com/docs/lifterlms-and-buddypress/" target="_blank">', '</a>' );
}

/**
Expand Down Expand Up @@ -109,7 +112,6 @@ public function get_integration_settings() {
}

return $settings;

}

/**
Expand Down Expand Up @@ -177,14 +179,13 @@ public function add_profile_nav_items() {
'slug' => $profile_endpoint['endpoint'],
'parent_slug' => $main_nav_slug,
'parent_url' => $parent_url,
'screen_function' => function() use ( $ep_key, $profile_endpoint ) {
'screen_function' => function () use ( $ep_key, $profile_endpoint ) {
$this->endpoint_content( $ep_key, $profile_endpoint['content'] );
},
'user_has_access' => $bp_is_my_profile,
)
);
}

}

/**
Expand Down Expand Up @@ -270,7 +271,6 @@ public function courses_screen() {
add_action( 'bp_template_content', array( $this, 'remove_courses_paginate_links_filter' ), 15 );

bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );

}

/**
Expand Down Expand Up @@ -303,7 +303,6 @@ public function endpoint_content( $ep_key, $ep_template_cb ) {

// This triggers 'bp_template_content' action hook.
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );

}

/**
Expand Down Expand Up @@ -334,7 +333,6 @@ public function enqueue_assets() {
"window.llms.address_info = '" . wp_json_encode( llms_get_countries_address_info() ) . "';"
);
}

}

/**
Expand Down Expand Up @@ -378,7 +376,6 @@ public function modify_courses_paginate_links( $link ) {

$this->current_endpoint_key;
return $this->modify_paginate_links( $link );

}

/**
Expand Down Expand Up @@ -476,7 +473,6 @@ public function modify_paginate_links( $link ) {
}

return $query ? $link . '?' . $query : $link;

}

/**
Expand Down Expand Up @@ -554,7 +550,6 @@ public function restriction_checks( $results ) {
}

return $results;

}

/**
Expand All @@ -574,7 +569,6 @@ private function get_profile_endpoints_options() {
array_keys( $endpoints ),
array_column( $endpoints, 'title' )
);

}

/**
Expand Down Expand Up @@ -606,7 +600,6 @@ private function populate_profile_endpoints() {
* @param array $endpoints Array of endpoint data.
*/
$this->endpoints = apply_filters( 'llms_buddypress_profile_endpoints', $endpoints );

}

/**
Expand Down Expand Up @@ -650,7 +643,5 @@ function ( $endpoint ) {
}

return $endpoints;

}

}

0 comments on commit aeb401b

Please sign in to comment.