ignore ) ) { $this->ignore = empty( $this->ignore ) ? array() : array( $this->ignore ); $this->save(); } return in_array( $slug, $this->ignore, true ); } /** * @param $as * @param $slug */ public function mark( $as, $slug ) { foreach ( [ 'issues', 'fixed', 'ignore' ] as $list ) { $arr = $this->$list; $index = array_search( $slug, $arr, true ); if ( $index !== false ) { unset( $arr[ $index ] ); } $this->$list = $arr; } if ( \WP_Defender\Controller\Security_Tweaks::STATUS_RESTORE === $as ) { $as = \WP_Defender\Controller\Security_Tweaks::STATUS_ISSUES; } $list = $this->{$as}; $list[] = $slug; $this->{$as} = $list; $this->save(); } /** * Define labels for settings key. * * @param string|null $key * * @return string|array|null */ public function labels( $key = null ) { $labels = array( 'data' => 'data', 'fixed' => __( 'Actioned', 'wpdef' ), 'issues' => __( 'Recommendations', 'wpdef' ), 'ignore' => __( 'Ignored', 'wpdef' ), 'automate' => 'automate', ); if ( ! is_null( $key ) ) { return $labels[ $key ] ?? null; } return $labels; } }