Skip to content

Commit

Permalink
fix: widget sprintf waring issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbir1991 committed Sep 4, 2018
1 parent c100224 commit 82b25ac
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 90 deletions.
43 changes: 1 addition & 42 deletions classes/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Dokan_Upgrade {
'2.7.6' => 'upgrades/dokan-upgrade-2.7.6.php',
'2.8.0' => 'upgrades/dokan-upgrade-2.8.0.php',
'2.8.3' => 'upgrades/dokan-upgrade-2.8.3.php',
'2.9.0' => 'upgrades/dokan-upgrade-2.9.0.php'
'2.8.6' => 'upgrades/dokan-upgrade-2.8.6.php'
];

/**
Expand Down Expand Up @@ -104,8 +104,6 @@ public function show_update_notice() {
public function do_updates() {
if ( isset( $_GET['dokan_do_update'] ) && $_GET['dokan_do_update'] ) {
$this->perform_updates();
} else if ( $this->running_background_process() ) {
$this->continue_background_processes();
}
}

Expand Down Expand Up @@ -138,43 +136,4 @@ public function perform_updates() {
exit();
}

/**
* Is running any background updater
*
* @since 2.9.0
*
* @return bool
*/
public function running_background_process() {
$processes = get_option( 'dokan_background_updater_processes', array() );

if ( ! empty( $processes ) ) {
return true;
}

return false;
}

/**
* Continue background updaters
*
* @since 2.9.0
*
* @return void
*/
public function continue_background_processes() {
$processes = get_option( 'dokan_background_updater_processes', array() );

if ( empty( $processes ) ) {
return;
}

foreach ( $processes as $process => $run_process ) {
if ( $run_process ) {
include_once DOKAN_INC_DIR . '/upgrades/background-processes/class_' . $process . '.php';
$processor = new $process();
}
}
}

}
2 changes: 1 addition & 1 deletion includes/product-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ function dokan_product_get_row_action( $post ) {
/**
* Change bulk product status in vendor dashboard
*
* @since 2.9.0
* @since 2.8.6
*
* @return string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class Dokan_Background_Updater extends WP_Background_Process {
*
* Override this action in your updater class
*
* @since 2.9.0
* @since 2.8.6
*
* @var string
*/
Expand All @@ -29,7 +29,7 @@ abstract class Dokan_Background_Updater extends WP_Background_Process {
/**
* Execute after complete a task
*
* @since 2.9.0
* @since 2.8.6
*
* @return void
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
/**
* Update vendor and product geolocation data
*
* @since 2.9.0
* @since 2.8.6
*/
class dokan_update_2_9_0_vendor_and_product_geolocations extends Dokan_Background_Updater {
class dokan_update_2_8_6_vendor_and_product_geolocations extends Dokan_Background_Updater {

/**
* Action
*
* @since 2.9.0
* @since 2.8.6
*
* @var string
*/
protected $action = 'dokan_update_2_9_0_vendor_and_product_geolocations';
protected $action = 'dokan_update_2_8_6_vendor_and_product_geolocations';

/**
* Perform updates
*
* @since 2.9.0
* @since 2.8.6
*
* @param mixed $item
*
Expand All @@ -48,7 +48,7 @@ public function task( $item ) {
/**
* Update vendors
*
* @since 2.9.0
* @since 2.8.6
*
* @param int $paged
*
Expand Down Expand Up @@ -104,7 +104,7 @@ private function update_vendors( $paged ) {
/**
* Update products
*
* @since 2.9.0
* @since 2.8.6
*
* @param int $paged
*
Expand Down
19 changes: 19 additions & 0 deletions includes/upgrades/dokan-upgrade-2.8.6.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* Update extra fee recipient settings
*
* @since 2.8.6
*
* @return void
*/
function dokan_update_2_8_6_fees_recipient() {

$options = get_option( 'dokan_general', array() );
$options['shipping_fee_recipient'] = ! empty( $options['extra_fee_recipient'] ) ? $options['extra_fee_recipient'] : 'seller';
$options['tax_fee_recipient'] = ! empty( $options['extra_fee_recipient'] ) ? $options['extra_fee_recipient'] : 'seller';

update_option( 'dokan_general', $options );
}

dokan_update_2_8_6_fees_recipient();
35 changes: 0 additions & 35 deletions includes/upgrades/dokan-upgrade-2.9.0.php

This file was deleted.

5 changes: 2 additions & 3 deletions templates/store.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<?php
if ( ! dynamic_sidebar( 'sidebar-store' ) ) {
$args = array(
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'before_widget' => '<aside class="widget %s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
Expand All @@ -40,7 +40,6 @@
the_widget( 'Dokan_Store_Contact_Form', array( 'title' => __( 'Contact Vendor', 'dokan-lite' ) ), $args );
}
}

}
?>

Expand Down Expand Up @@ -91,4 +90,4 @@

<?php do_action( 'woocommerce_after_main_content' ); ?>

<?php get_footer( 'shop' ); ?>
<?php get_footer( 'shop' ); ?>

0 comments on commit 82b25ac

Please sign in to comment.