Initial commit: Atomaste website
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace AIOSEO\Plugin\Lite\Options;
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use AIOSEO\Plugin\Common\Options as CommonOptions;
|
||||
use AIOSEO\Plugin\Lite\Traits;
|
||||
|
||||
/**
|
||||
* Class that holds all internal options for AIOSEO.
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
class InternalOptions extends CommonOptions\InternalOptions {
|
||||
use Traits\Options;
|
||||
|
||||
/**
|
||||
* Defaults options for Lite.
|
||||
*
|
||||
* @since 4.0.0
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $liteDefaults = [
|
||||
// phpcs:disable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
|
||||
'internal' => [
|
||||
'activated' => [ 'type' => 'number', 'default' => 0 ],
|
||||
'firstActivated' => [ 'type' => 'number', 'default' => 0 ],
|
||||
'installed' => [ 'type' => 'number', 'default' => 0 ],
|
||||
'connect' => [
|
||||
'key' => [ 'type' => 'string' ],
|
||||
'time' => [ 'type' => 'number', 'default' => 0 ],
|
||||
'network' => [ 'type' => 'boolean', 'default' => false ],
|
||||
'token' => [ 'type' => 'string' ]
|
||||
]
|
||||
]
|
||||
// phpcs:enable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
namespace AIOSEO\Plugin\Lite\Options;
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use AIOSEO\Plugin\Common\Options as CommonOptions;
|
||||
use AIOSEO\Plugin\Lite\Traits;
|
||||
|
||||
/**
|
||||
* Class that holds all options for AIOSEO.
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
class Options extends CommonOptions\Options {
|
||||
use Traits\Options;
|
||||
|
||||
/**
|
||||
* Defaults options for Lite.
|
||||
*
|
||||
* @since 4.0.0
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $liteDefaults = [
|
||||
// phpcs:disable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
|
||||
'advanced' => [
|
||||
'usageTracking' => [ 'type' => 'boolean', 'default' => false ]
|
||||
]
|
||||
// phpcs:enable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
|
||||
];
|
||||
|
||||
/**
|
||||
* Sanitizes, then saves the options to the database.
|
||||
*
|
||||
* @since 4.7.2
|
||||
*
|
||||
* @param array $options An array of options to sanitize, then save.
|
||||
* @return void
|
||||
*/
|
||||
public function sanitizeAndSave( $options ) {
|
||||
if ( isset( $options['advanced']['emailSummary']['recipients'] ) ) {
|
||||
$options['advanced']['emailSummary']['recipients'] = [ array_shift( $options['advanced']['emailSummary']['recipients'] ) ];
|
||||
$options['advanced']['emailSummary']['recipients'][0]['frequency'] = 'monthly';
|
||||
}
|
||||
|
||||
parent::sanitizeAndSave( $options );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user