Hello Ian,
Please try following PHP snippet.
function geodir_claim_link_sc($atts) {
if (function_exists('geodir_load_translation_geodirclaim')) {
global $post, $preview;
$defaults = array(
'class' => 'supreme-btn supreme-btn-small supreme-edit-btn',
'icon' => "true",
'link_text' => __('Claim', 'directory-starter')
);
$params = shortcode_atts($defaults, $atts);
ob_start();
$geodir_post_type = array();
if (get_option('geodir_post_types_claim_listing'))
$geodir_post_type = get_option('geodir_post_types_claim_listing');
$posttype = (isset($post->post_type)) ? $post->post_type : '';
if (in_array($posttype, $geodir_post_type) && !$preview) {
$is_owned = absint(geodir_get_post_meta($post->ID, 'claimed', true));
if (get_option('geodir_claim_enable') == 'yes' && empty($is_owned)) {
if (is_user_logged_in()) {
echo '<div class="geodir-company_info" style="border: none;margin: 0;padding: 0">';
echo '<div class="geodir_display_claim_popup_forms"></div>';
echo '<a href="javascript:void(0);" class="'.$params['class'].' geodir_claim_enable">';
if ($params['icon'] == 'true') {
echo '<i class="fa fa-question-circle"></i>';
}
echo $params['link_text'];
echo '</a>';
echo '</div>';
echo '<input type="hidden" name="geodir_claim_popup_post_id" value="' . $post->ID . '" />';
} else {
$site_login_url = geodir_login_url();
echo '<a href="' . $site_login_url . '" class="'.$params['class'].'">';
if ($params['icon'] == 'true') {
echo '<i class="fa fa-question-circle"></i>';
}
echo $params['link_text'];
echo '</a>';
}
}
}
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
add_shortcode('gd_claim_link', 'geodir_claim_link_sc');
Add above code via PHP snippet plugin or add in parent theme/child theme functions.php file.
Use shortcode
[gd_claim_link class="" icon="false"]
to show claim link with text.
Kiran