$.ajax({
url: url,
dataType: 'json',
data: data,
success: callback
});
function ajax_get_gallery(){
$gallery = get_field('gallery',$_REQUEST['post_id']);
wp_send_json( $gallery );
}
$terms = get_terms( array(
'orderby'=>'count',
'taxonomy' => 'category'
) );
if( $terms && ! is_wp_error($terms) ){
echo "<ul>";
foreach( $terms as $term ){
echo "<li>". $term->name ."</li>";
}
echo "</ul>";
}
[term_id] => 162
[name] => Здоровье
[slug] => zdorove
[term_group] => 0
[term_taxonomy_id] => 170
[taxonomy] => my_taxonomy
[description] =>
[parent] => 0
[count] => 2
pdf.php
add_action('user_register', 'my_user_registration');
function my_user_registration($user_id)
{
$meta_com = get_user_meta($user_id, 'user_type', true);
$user = new WP_User($user_id);
$value_yes = 'yes';
$role_yes = 'company';
$role_no = 'customer';
if ($meta_com == $value_yes) {
$user->add_role($role_yes);
} else {
$user->add_role($role_no);
}
}
add_action()
add_action('user_register', 'send_welcome_email_to_new_user (111)');
вам нужно написать следующим образом add_action('user_register', 'send_welcome_email_to_new_user');
send_welcome_email_to_new_user()
получить id пользователя автоматически см. user_register$meta = get_post_meta($post->ID, $field['id'], true);
$meta = get_post_meta($post->ID, $field['id'], true);
$meta = esc_attr($meta);
function action_function_name_11() {
// Проверки и прочее
wp_safe_redirect( $location, 301);
}
add_action( 'template_redirect', 'action_function_name_11' );