Skip to content

Commit

Permalink
fix: tsdk_support_url fatal crash on cron
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Jul 16, 2024
1 parent 3e44d7b commit 2d91aa7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion includes/admin/class-rop-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public function enqueue_scripts() {
$rop_api_settings['license_data_view'] = $global_settings->get_license_data_view();
$rop_api_settings['license_type'] = $global_settings->license_type();
$rop_api_settings['fb_domain_toast_display'] = $this->facebook_exception_toast_display();
$rop_api_settings['labels'] = Rop_I18n::get_labels();
$rop_api_settings['labels'] = Rop_I18n::get_labels_frontend();
$rop_api_settings['upsell_link'] = Rop_I18n::UPSELL_LINK;
$rop_api_settings['pro_installed'] = ( defined( 'ROP_PRO_VERSION' ) ) ? true : false;
$rop_api_settings['show_li_app_btn'] = $li_service->rop_show_li_app_btn();
Expand Down
14 changes: 13 additions & 1 deletion includes/class-rop-i18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public static function get_labels( $key = '' ) {
'tweet-old-post'
),
'rop_support' => __( 'Get Support', 'tweet-old-post' ),
'rop_support_url' => defined( 'ROP_PRO_BASEFILE' ) ? tsdk_support_link( ROP_PRO_BASEFILE ) : '',
'rop_support_url' => '',
'rop_facebook_domain_toast' => __(
'You need to verify your website domain with Facebook so your shares can show as article posts on Facebook. [ <a href="https://docs.revive.social/article/1136-facebook-text-posts-vs-article-posts" target="_blank">Read this doc</a> ] for more information',
'tweet-old-post'
Expand Down Expand Up @@ -502,5 +502,17 @@ public static function get_labels( $key = '' ) {
return '';
}

/**
* Get the labels for the frontend (e.g. dashboard).
*
* @return array Localized labels.
*/
public static function get_labels_frontend() {
$labels = self::get_labels();

// NOTE: `tsdk_support_link` must be run after `init` hook run and SDK Licenser module loading.
$labels['general']['rop_support_url'] = defined( 'ROP_PRO_BASEFILE' ) ? tsdk_support_link( ROP_PRO_BASEFILE ) : '';

return $labels;
}
}

0 comments on commit 2d91aa7

Please sign in to comment.