RWD
This commit is contained in:
@@ -239,3 +239,21 @@ add_filter('wpcf7_form_elements', function($content) {
|
||||
);
|
||||
return $content;
|
||||
});
|
||||
|
||||
add_action('wp_ajax_get_full_phone', 'get_full_phone');
|
||||
add_action('wp_ajax_nopriv_get_full_phone', 'get_full_phone');
|
||||
|
||||
function get_full_phone() {
|
||||
if (!isset($_POST['post_id'])) wp_send_json_error('No post ID');
|
||||
|
||||
$post_id = intval($_POST['post_id']);
|
||||
$footer_top = get_field('top_footer_box', 'option');
|
||||
|
||||
if (!isset($footer_top['col_2']['btn'])) wp_send_json_error('Phone not found');
|
||||
|
||||
$btn = $footer_top['col_2']['btn'];
|
||||
$html = '<a class="btn_4" href="' . esc_url($btn['url']) . '" target="' . esc_attr($btn['target'] ?: '_self') . '">'
|
||||
. esc_html($btn['title']) . '</a>';
|
||||
|
||||
wp_send_json_success(['html' => $html]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user