Browse Source

Update to 2.1.9

master
Sam Black 3 years ago
parent
commit
a314f43f04
Signed by: samwwwblack GPG Key ID: 0FF0223994EA47D8
  1. 21
      README.txt
  2. 8
      core/class-admin.php
  3. BIN
      languages/business-hours-indicator-hr.mo
  4. BIN
      languages/business-hours-indicator-lt_LT.mo
  5. BIN
      languages/business-hours-indicator-nb_NO.mo
  6. BIN
      languages/business-hours-indicator-nl_BE.mo
  7. 143
      mabel-business-hours-indicator.php

21
README.txt

@ -3,8 +3,8 @@ Contributors: maartenbelmans, studiowombat
Donate link: https://www.paypal.me/maartenbelmans
Tags: business hours, opening times, opening hours, open indication, currently open, business hours overview, indicator, closed, open times, closing times
Requires at least: 3.7
Tested up to: 4.9.4
Stable tag: 2.1.5
Tested up to: 5.0
Stable tag: 2.1.9
Requires PHP: 5.4.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -54,7 +54,8 @@ Check out a complete list of features below.
* Include special hours such as holidays
* Include vacation hours
* Highlight the current day
* Frontend translated in: NL, GR, EN, DE, ES, IT, FR, BG, SE, SK, SL
* Frontend translated in: Dutch, German, English, Greek, Spanish, Italian, French, Bulgarian, Swedish, Danish,
Slovakian, Slovenian, Lithuanian, Croatian, Russian, Czech, Norwegian.
= Displaying opening times =
@ -140,6 +141,20 @@ find all classes [here](https://studiowombat.com/knowledge-base/styling-the-outp
== Changelog ==
= version 2.1.9 =
* Added: Norwegian translations.
= version 2.1.8 =
* Added: Croation translations.
* Added: Lithuanian translations.
= version 2.1.7 =
* Added: added NL_BE language.
* Update: fixed warning for create_function in PHP 7.2.
= version 2.1.6 =
* Enhancements: added a filter 'mbhi_capability' allowing you to change who can edit hours.
= version 2.1.5 =
* Fix: fixed a bug when deleting one or more holidays within the same month.

8
core/class-admin.php

@ -38,7 +38,13 @@ namespace MABEL_BHI_LITE\Core
}
public function add_menu()
{
add_options_page('', Config_Manager::$name, 'manage_options', Config_Manager::$slug, array($this,'display_settings'));
$capability = 'manage_options';
if(has_filter('mbhi_capability')) {
$capability = apply_filters( 'mbhi_capability', $capability );
}
add_options_page('', Config_Manager::$name, $capability, Config_Manager::$slug, array($this,'display_settings'));
}
public function init_settings()

BIN
languages/business-hours-indicator-hr.mo

Binary file not shown.

BIN
languages/business-hours-indicator-lt_LT.mo

Binary file not shown.

BIN
languages/business-hours-indicator-nb_NO.mo

Binary file not shown.

BIN
languages/business-hours-indicator-nl_BE.mo

Binary file not shown.

143
mabel-business-hours-indicator.php

@ -1,77 +1,68 @@
<?php
/*
* Plugin Name: Business Hours Indicator
* Plugin URI: https://businesshourplugin.maartenbelmans.com/
* Description: Add an indication of being currently open or closed. Show business hour tables. Conditional logic: show/hide content only when open/closed.
* Version: 2.1.5
* Author: Maarten Belmans
* Author URI: https://maartenbelmans.com/
* Text Domain: business-hours-indicator
*/
if(!defined('ABSPATH')){die;}
/**
* Auto loader for Plugin classes
*
* @param string $class_name Name of the class that shall be loaded
*/
function mabel_bhi_lite_auto_loader ($class_name) {
// Not loading a class from our plugin.
if ( !is_int(strpos( $class_name, 'MABEL_BHI_LITE')) )
return;
// Remove root namespace as we don't have that as a folder.
$class_name = str_replace('MABEL_BHI_LITE\\','',$class_name);
$class_name = str_replace('\\','/',strtolower($class_name)) .'.php';
// Get only the file name.
$pos = strrpos($class_name, '/');
$file_name = is_int($pos) ? substr($class_name, $pos + 1) : $class_name;
// Get only the path.
$path = str_replace($file_name,'',$class_name);
// Append 'class-' to the file name and replace _ with -
$new_file_name = 'class-'.str_replace('_','-',$file_name);
// Construct file path.
$file_path = plugin_dir_path(__FILE__) . str_replace('\\', DIRECTORY_SEPARATOR, $path . strtolower($new_file_name));
if (file_exists($file_path))
require_once($file_path);
}
spl_autoload_register('mabel_bhi_lite_auto_loader');
/* Don't allow upgrades */
function bhi_remove_update_notification($value) {
if ( isset( $value->response[ plugin_basename( __FILE__ ) ] ) ) {
unset( $value->response[ plugin_basename( __FILE__ ) ] );
}
return $value;
}
add_action( 'site_transient_update_plugins', 'bhi_remove_update_notification' );
// API
if(!function_exists('MBHILITE'))
{
function MBHILITE() {
return \MABEL_BHI_LITE\API\API::instance();
}
}
function run_mabel_bhi_lite()
{
// todo, this can probably go? Not sure why I left it here ^^
if (!defined('MABEL_BHI_LITE_SETTINGS'))
define('MABEL_BHI_LITE_SETTINGS', 'mb-bhi-settings');
$plugin = new \MABEL_BHI_LITE\Business_Hours_Indicator(
plugin_dir_path( __FILE__ ),
plugin_dir_url( __FILE__ ),
plugin_basename( __FILE__ ),
'Business Hours Indicator',
'2.1.5'
);
$plugin->run();
}
<?php
/*
* Plugin Name: Business Hours Indicator
* Plugin URI: https://businesshourplugin.maartenbelmans.com/
* Description: Add an indication of being currently open or closed. Show business hour tables. Conditional logic: show/hide content only when open/closed.
* Version: 2.1.9
* Author: Maarten Belmans
* Author URI: https://maartenbelmans.com/
* Text Domain: business-hours-indicator
*/
if(!defined('ABSPATH')){die;}
/**
* Auto loader for Plugin classes
*
* @param string $class_name Name of the class that shall be loaded
*/
function mabel_bhi_lite_auto_loader ($class_name) {
// Not loading a class from our plugin.
if ( !is_int(strpos( $class_name, 'MABEL_BHI_LITE')) )
return;
// Remove root namespace as we don't have that as a folder.
$class_name = str_replace('MABEL_BHI_LITE\\','',$class_name);
$class_name = str_replace('\\','/',strtolower($class_name)) .'.php';
// Get only the file name.
$pos = strrpos($class_name, '/');
$file_name = is_int($pos) ? substr($class_name, $pos + 1) : $class_name;
// Get only the path.
$path = str_replace($file_name,'',$class_name);
// Append 'class-' to the file name and replace _ with -
$new_file_name = 'class-'.str_replace('_','-',$file_name);
// Construct file path.
$file_path = plugin_dir_path(__FILE__) . str_replace('\\', DIRECTORY_SEPARATOR, $path . strtolower($new_file_name));
if (file_exists($file_path))
require_once($file_path);
}
spl_autoload_register('mabel_bhi_lite_auto_loader');
// API
if(!function_exists('MBHILITE'))
{
function MBHILITE() {
return \MABEL_BHI_LITE\API\API::instance();
}
}
function run_mabel_bhi_lite()
{
// todo, this can probably go? Not sure why I left it here ^^
if (!defined('MABEL_BHI_LITE_SETTINGS'))
define('MABEL_BHI_LITE_SETTINGS', 'mb-bhi-settings');
$plugin = new \MABEL_BHI_LITE\Business_Hours_Indicator(
plugin_dir_path( __FILE__ ),
plugin_dir_url( __FILE__ ),
plugin_basename( __FILE__ ),
'Business Hours Indicator',
'2.1.9'
);
$plugin->run();
}
run_mabel_bhi_lite();
Loading…
Cancel
Save