Skip to content

Commit

Permalink
Fix fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
raftaar1191 committed Aug 16, 2024
1 parent aff258d commit 5858e58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 52 deletions.
48 changes: 0 additions & 48 deletions admin/class-copy-link-for-buddyboss-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,56 +71,8 @@ public function __construct( $plugin_name, $version ) {

$this->plugin_name = $plugin_name;
$this->version = $version;

$this->js_asset_file = include( COPY_LINK_FOR_BUDDYBOSS_PLUGIN_PATH . 'build/js/backend.asset.php' );
$this->css_asset_file = include( COPY_LINK_FOR_BUDDYBOSS_PLUGIN_PATH . 'build/css/backend.asset.php' );
}

/**
* Register the stylesheets for the admin area.
*
* @since 1.0.0
*/
public function enqueue_styles() {

/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Copy_Link_For_BuddyBoss_Loader as all of the hooks are defined
* in that particular class.
*
* The Copy_Link_For_BuddyBoss_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/

wp_enqueue_style( $this->plugin_name, COPY_LINK_FOR_BUDDYBOSS_PLUGIN_URL . 'build/css/backend.css', $this->css_asset_file['dependencies'], $this->css_asset_file['version'], 'all' );

}

/**
* Register the JavaScript for the admin area.
*
* @since 1.0.0
*/
public function enqueue_scripts() {

/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Copy_Link_For_BuddyBoss_Loader as all of the hooks are defined
* in that particular class.
*
* The Copy_Link_For_BuddyBoss_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/

wp_enqueue_script( $this->plugin_name, COPY_LINK_FOR_BUDDYBOSS_PLUGIN_URL . 'build/js/backend.js', $this->js_asset_file['dependencies'], $this->js_asset_file['version'], false );

}

/**
* Add setting for Copy Comment
Expand Down
8 changes: 4 additions & 4 deletions includes/class-copy-link-for-buddyboss.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,6 @@ private function set_locale() {
private function define_admin_hooks() {

$plugin_admin = new Copy_Link_For_BuddyBoss_Admin( $this->get_plugin_name(), $this->get_version() );

$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );

$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );

$this->loader->add_action( 'bp_admin_setting_activity_register_fields', $plugin_admin, 'register_fields', 2 );

Expand Down Expand Up @@ -422,6 +418,10 @@ public function access_control_settings( $key_id ) {
*/
function is_access_control( $key_id, $create = true ) {

if ( ! class_exists( 'BB_Access_Control' ) ) {
return $create;
}

$create_activity_settings = $this->access_control_settings( $key_id );
$has_access = false;
if ( empty( $create_activity_settings ) || ( isset( $create_activity_settings['access-control-type'] ) && empty( $create_activity_settings['access-control-type'] ) ) ) {
Expand Down

0 comments on commit 5858e58

Please sign in to comment.