Skip to content

Commit

Permalink
Updated helper function to avoid conflict with elementor
Browse files Browse the repository at this point in the history
  • Loading branch information
jeawhanlee committed May 11, 2023
1 parent b8322c5 commit 617f00a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion App/Admin/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private function tools_view() : void {
'text' => 'Last saved major version is the same as the current',
'type' => 'info',
],
is_wpr_active() ? __get_option( 'rocket_last_major_version' ) === WP_ROCKET_VERSION : false
is_wpr_active() ? rocket_e2e_get_option( 'rocket_last_major_version' ) === WP_ROCKET_VERSION : false
);
}
}
8 changes: 4 additions & 4 deletions App/Modules/Cache/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public static function get_subscribed_events() : array {
* @return array
*/
public function purge_urls( array $purge_urls ) : array {
if ( ! __get_option( 'rocket_post_purge_urls' ) ) {
if ( ! rocket_e2e_get_option( 'rocket_post_purge_urls' ) ) {
return $purge_urls;
}

$rocket_post_purge_urls = __get_option( 'rocket_post_purge_urls' );
$rocket_post_purge_urls = rocket_e2e_get_option( 'rocket_post_purge_urls' );

switch ( $rocket_post_purge_urls ) {
case 'false_return':
Expand Down Expand Up @@ -72,11 +72,11 @@ public function purge_urls( array $purge_urls ) : array {
* @return array
*/
public function exclude_post_taxonomy( array $taxonomies ) : array {
if ( ! __get_option( 'rocket_exclude_post_taxonomy' ) ) {
if ( ! rocket_e2e_get_option( 'rocket_exclude_post_taxonomy' ) ) {
return $taxonomies;
}

$rocket_exclude_post_taxonomy = __get_option( 'rocket_exclude_post_taxonomy' );
$rocket_exclude_post_taxonomy = rocket_e2e_get_option( 'rocket_exclude_post_taxonomy' );

if ( 'default' === $rocket_exclude_post_taxonomy ) {
return $taxonomies;
Expand Down
2 changes: 1 addition & 1 deletion src/functions/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @param string $option Single option name.
* @return void
*/
function __get_option( string $option ) {
function rocket_e2e_get_option( string $option ) {
if ( ! get_option( CONFIG['PLUGIN_OPTION'] ) ) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions views/form_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'int' => '15',
'invalid_array' => '["yy",0,True]',
],
'state' => __get_option( 'rocket_post_purge_urls' ) ?? '',
'state' => rocket_e2e_get_option( 'rocket_post_purge_urls' ) ?? '',
],
'rocket_exclude_post_taxonomy' => [
'form_data' => [
Expand All @@ -25,7 +25,7 @@
'post_tag' => 'post_tag',
'product_cat' => 'product_cat',
],
'state' => __get_option( 'rocket_exclude_post_taxonomy' ) ?? '',
'state' => rocket_e2e_get_option( 'rocket_exclude_post_taxonomy' ) ?? '',
],

'nonce' => wp_create_nonce( CONFIG['PLUGIN_ID'] . '_filters_form_nonce' ),
Expand Down

0 comments on commit 617f00a

Please sign in to comment.