Skip to content

Commit

Permalink
LearnPress and Uncaught Error after update
Browse files Browse the repository at this point in the history
  • Loading branch information
iworks committed Dec 14, 2024
1 parent bc49ce5 commit 0f2e18a
Show file tree
Hide file tree
Showing 9 changed files with 479 additions and 57 deletions.
6 changes: 3 additions & 3 deletions includes/iworks/class-iworks-omnibus.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ public function __construct() {
}

public function action_plugins_loaded() {
$dir = dirname( __FILE__ ) . '/omnibus';
$dir = dirname( __FILE__ ) . '/omnibus';
$v4_directory = $this->is_migrated_v4() ? '/v4' : '';
/**
* WooCommerce
*
Expand All @@ -117,7 +118,6 @@ public function action_plugins_loaded() {
defined( 'WC_PLUGIN_FILE' )
&& defined( 'WC_VERSION' )
) {
$v4_directory = $this->is_migrated_v4() ? '/v4' : '';
/**
* Check minimal WooCommerce version to run.
*
Expand Down Expand Up @@ -152,7 +152,7 @@ public function action_plugins_loaded() {
* @since 1.0.1
*/
if ( defined( 'LP_PLUGIN_FILE' ) ) {
include_once $dir . '/integration/class-iworks-omnibus-integration-learnpress.php';
include_once $dir . '/integration' . $v4_directory . '/class-iworks-omnibus-integration-learnpress.php';
$this->objects['learnpress'] = new iworks_omnibus_integration_learnpress();
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ public function __construct() {
add_action( 'shutdown', array( $this, 'action_shutdown_maybe_delete_older_records' ) );
}

/**
* helper to decide show it or no
*/
protected function should_it_show_up( $post_id ) {
}

/**
* helper to add logs
*
* @since 4.0.0
*/
protected function maybe_add_price_log( $element ) {
}

/**
* Delete older records
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ public function __construct() {
add_filter( 'debug_bar_panels', array( $this, 'filter_debug_bar_panels' ) );
}

/**
* helper to decide show it or no
*/
protected function should_it_show_up( $post_id ) {
}

/**
* helper to add logs
*
* @since 4.0.0
*/
protected function maybe_add_price_log( $element ) {
}

public function filter_debug_bar_panels( $panels ) {
if ( is_singular( 'product' ) ) {
include_once __DIR__ . '/class-iworks-omnibus-integration-debug-bar-panel.php';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

use LearnPress\Helpers\Config;

/**
* Class LP_Settings_Permalink
*
* @author ThimPress
* @package LearnPress/Admin/Settings
* @since 4.1.7.3.2
* @version 1.0.0
*/
class iworks_omnibus_integration_learnpress_settings extends LP_Abstract_Settings_Page {
/**
* Construct
*/
public function __construct() {
$this->id = 'omnibus';
$this->text = esc_html__( 'Omnibus', 'omnibus' );

parent::__construct();
}

/**
* Return fields for settings page.
*
* @param string $section
* @param string $tab
*
* @return mixed
*/
public function get_settings( $section = '', $tab = '' ) {
return apply_filters( 'iworks/omnibus/learn-press/settings', array() );
}

}

return new iworks_omnibus_integration_learnpress_settings();
Loading

0 comments on commit 0f2e18a

Please sign in to comment.