Skip to content

Commit

Permalink
v1.8.10 - Merge pull request #136 from JoryHogeveen/dev
Browse files Browse the repository at this point in the history
v1.8.10
  • Loading branch information
JoryHogeveen authored Nov 23, 2024
2 parents 0168027 + c5e8ef8 commit b2c6e5c
Show file tree
Hide file tree
Showing 21 changed files with 127 additions and 309 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk

# Composer
vendor/
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

184 changes: 0 additions & 184 deletions bin/install-wp-tests.sh

This file was deleted.

7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@
},
"require-dev": {
"phpmd/phpmd": "@stable",
"phpunit/phpunit": "5.*",
"mockery/mockery": "1.3.*",
"phpunit/phpunit": "^8",
"squizlabs/php_codesniffer": "2.*",
"phpcompatibility/php-compatibility": "9.*",
"yoast/phpunit-polyfills": "2.0"
"phpcompatibility/phpcompatibility-wp": "*",
"yoast/phpunit-polyfills": "3.0"
},
"extra": {
"installer-name": "view-admin-as"
Expand Down
2 changes: 1 addition & 1 deletion includes/class-compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public function filter_ure_capabilities_groups_tree( $groups ) {
$groups['view_admin_as'] = array(
'caption' => esc_html__( 'View Admin As', VIEW_ADMIN_AS_DOMAIN ),
'parent' => 'custom',
'level' => 3,
'level' => 2,
);
return $groups;
}
Expand Down
4 changes: 4 additions & 0 deletions includes/class-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,23 @@ public function init() {
*
* @since 0.1.0
* @since 1.2.0 Only check for key
* @since 1.8.10 Reset view in store
* @example http://www.your.domain/wp-admin/?reset-view
*/
if ( VAA_API::is_request( 'reset-view', 'get' ) ) {
$this->reset_view();
$this->store->set_view( array() );
}
/**
* Clear all user views.
*
* @since 1.3.4
* @since 1.8.10 Reset view in store
* @example http://www.your.domain/wp-admin/?reset-all-views
*/
if ( VAA_API::is_request( 'reset-all-views', 'get' ) ) {
$this->reset_all_views();
$this->store->set_view( array() );
}
}

Expand Down
26 changes: 22 additions & 4 deletions includes/class-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ protected function __construct( $vaa ) {
}

if ( $this->is_enabled() ) {
$this->add_action( 'vaa_view_admin_as_pre_init', array( $this, 'init' ) );
$this->add_action( 'vaa_view_admin_as_pre_init', array( $this, 'setup' ) );

if ( did_action( 'init' ) ) {
$this->init();
} else {
$this->add_action( 'init', array( $this, 'init' ) );
}
}
}

Expand Down Expand Up @@ -191,11 +197,12 @@ public function set_enable( $bool = false, $update_db = true ) {
/**
* Setup module and hooks.
*
* @since 1.8.0
* @since 1.8.0 Renamed from init()
* @since 1.8.10
* @access protected
* @return bool Successful init?
* @return bool Successful setup?
*/
public function init() {
public function setup() {

$this->store_data();

Expand All @@ -207,6 +214,17 @@ public function init() {
return false;
}

/**
* Init module and hooks.
*
* @since 1.8.10
* @access protected
* @return bool Successful init?
*/
public function init() {
return true;
}

/**
* Setup hooks.
*
Expand Down
4 changes: 2 additions & 2 deletions includes/class-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function __construct( $vaa ) {
* @return void
*/
public function maybe_db_update() {
$db_version = strtolower( $this->store->get_optionData( 'db_version' ) );
$db_version = strtolower( (string) $this->store->get_optionData( 'db_version' ) );
if ( ! $db_version ) {
self::$fresh_install = true;
}
Expand All @@ -83,7 +83,7 @@ private function db_update() {
'db_version' => $this->store->get_dbVersion(),
);

$current_db_version = strtolower( $this->store->get_optionData( 'db_version' ) );
$current_db_version = strtolower( (string) $this->store->get_optionData( 'db_version' ) );

// No need to run update script if it's a clean installation.
if ( $current_db_version ) {
Expand Down
6 changes: 6 additions & 0 deletions modules/class-caps.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,15 @@ protected function __construct( $vaa ) {
'update_view' => 10,
'do_view' => 8,
);
}

/**
* @inheritDoc
*/
public function init() {
$this->label = __( 'Capabilities', VIEW_ADMIN_AS_DOMAIN );
$this->label_singular = __( 'Capability', VIEW_ADMIN_AS_DOMAIN );
return parent::init();
}

/**
Expand Down
Loading

0 comments on commit b2c6e5c

Please sign in to comment.