| 1 |
<?php |
| 2 |
/** |
| 3 |
* Reading Position Indicator |
| 4 |
* |
| 5 |
* @package reading-position-indicator |
| 6 |
* @author Marcin Pietrzak |
| 7 |
* @copyright 2017-2024 Marcin Pietrzak |
| 8 |
* @license GPL-3.0-or-later |
| 9 |
* |
| 10 |
* @wordpress-plugin |
| 11 |
* Plugin Name: Reading Position Indicator |
| 12 |
* Plugin URI: https://github.com/iworks/reading-position-indicator |
| 13 |
* Description: Create a horizontal progress bar to show how scroll progress of current single entry. |
| 14 |
* Version: 1.0.8 |
| 15 |
* Requires at least: 6.0 |
| 16 |
* Requires PHP: 8.0 |
| 17 |
* Author: Marcin Pietrzak |
| 18 |
* Author URI: http://iworks.pl/ |
| 19 |
* Text Domain: reading-position-indicator |
| 20 |
* License: GPL v3 or later |
| 21 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt |
| 22 |
*/ |
| 23 |
|
| 24 |
if ( ! defined( 'WPINC' ) ) { |
| 25 |
die; |
| 26 |
} |
| 27 |
|
| 28 |
include_once dirname( __FILE__ ) . '/etc/options.php'; |
| 29 |
|
| 30 |
$includes = dirname( __FILE__ ) . '/includes'; |
| 31 |
|
| 32 |
if ( ! class_exists( 'iworks_options' ) ) { |
| 33 |
include_once $includes . '/iworks/options/options.php'; |
| 34 |
} |
| 35 |
include_once $includes . '/iworks/class-iworks-position.php'; |
| 36 |
|
| 37 |
/** |
| 38 |
* load options |
| 39 |
*/ |
| 40 |
|
| 41 |
global $iworks_reading_position_indicator_options; |
| 42 |
$iworks_reading_position_indicator_options = iworks_reading_position_indicator_get_options_object(); |
| 43 |
|
| 44 |
function iworks_reading_position_indicator_get_options_object() { |
| 45 |
global $iworks_reading_position_indicator_options; |
| 46 |
if ( is_object( $iworks_reading_position_indicator_options ) ) { |
| 47 |
return $iworks_reading_position_indicator_options; |
| 48 |
} |
| 49 |
$iworks_reading_position_indicator_options = new iworks_options(); |
| 50 |
$iworks_reading_position_indicator_options->set_option_function_name( 'iworks_reading_position_indicator_options' ); |
| 51 |
$iworks_reading_position_indicator_options->set_option_prefix( 'irpi_' ); |
| 52 |
$iworks_reading_position_indicator_options->init(); |
| 53 |
return $iworks_reading_position_indicator_options; |
| 54 |
} |
| 55 |
|
| 56 |
function iworks_reading_position_indicator_activate() { |
| 57 |
$iworks_reading_position_indicator_options = get_iworks_reading_position_indicator_options(); |
| 58 |
$iworks_reading_position_indicator_options->activate(); |
| 59 |
} |
| 60 |
|
| 61 |
function iworks_reading_position_indicator_deactivate() { |
| 62 |
$iworks_reading_position_indicator_options->set_option_prefix( iworks_reading_position_indicator ); |
| 63 |
$iworks_reading_position_indicator_options->deactivate(); |
| 64 |
} |
| 65 |
/** |
| 66 |
* start |
| 67 |
*/ |
| 68 |
new iworks_position(); |
| 69 |
|
| 70 |
|