Support Forum » User Profile

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Plural and Singular Post Title Fields Remain Empty #46838
    Robert FeddesRobert Feddes
    Participant

    Having the same problem

    in reply to: How to output MB User Meta Custom Fields frontend #40261
    Robert FeddesRobert Feddes
    Participant

    It is solved, what was lacking was adding a query loop type: users to the div above!

    Added the query loop and now it works!

    Robert FeddesRobert Feddes
    Participant

    Thanks Long Nguyen,

    If I were smart enough to understand the documentation that would be great, but I am not.

    So please help me out, how do I do that?

    The CPT slug is: content-ctas

    The view short code is: [mbv name="cta-rugpijn"]

    The post ID of one of the cta's is 2501, so please tell me, what must the shortcode then be?

    [mbv name="cta-rugpijn" ??="2501"]????

    Thanks!

    in reply to: Importing data to custom table does not work #35579
    Robert FeddesRobert Feddes
    Participant

    Hi Long

    I added that code to code snippets, but that did not work, apparently oxygen needs different code, can you test that please?

    Thanks

    Robert

    in reply to: Importing data to custom table does not work #35565
    Robert FeddesRobert Feddes
    Participant

    I tried your instructions on: https://metabox.io/move-custom-fields-data-to-custom-tables/

    But I am on oxygen builder, so am wondering how to do this.

    I tried the following code and added it to a code snippet, and also tried it as a separate plugin, but no luck at all.

    Help MUCH appreciated

    function oxygen_child_data_testimonials() {
    	if ( empty( $_GET['move-data-testimonials'] ) || ! current_user_can( 'manage_options' ) ) {
    		return;
    	}
    
    	$paged = isset( $_GET['oxygen-child-paged'] ) ? $_GET['oxygen-child-paged'] : 0;
    	$paged += 1;
    	$url = add_query_arg( 'oxygen-child-paged', $paged, 'https://www.rugpijnweg.nl/wp-admin/?move-data-testimonials=1' );
    
    	$posts = oxygen_child_admin_records_get_testimonials( $paged );
    	if ( empty( $posts ) ) {
    		die( 'Done' );
    	} 
    
    	foreach ( $posts as $post ) {
    		oxygen_child_move_data_testimonials( $post );
    	}
    
    	echo "
    	<script>
    	setTimeout( () => {
    		window.location.href = '$url';
    	}, 3000 );
    	</script>
    	";
    
    	die;
    }
    add_action( 'admin_init', 'oxygen_child_data_testimonials' );
    
    function oxygen_child_admin_records_get_testimonials( $paged = 1 ) {
    	$args = [
    		'post_type'      => 'reviews',
    		'posts_per_page' => 100,
    		'paged'          => $paged,
    		'fields'         => 'ids',
    		'orderby'        => 'ID',
    	];
    	$query = new WP_Query( $args );
    	return $query->posts;
    }
    function oxygen_child_move_data_testimonials( $post_id ) {
    	global $wpdb;
    
    	echo 'Migrating Reviews ', $post_id, '<br>';
    
    	$data = [];
    
    	$data['ID'] = $post_id;
    
    	$data['testie_title'] = get_post_meta( $post_id, 'testie_title', true );
    	$data['testie_description'] = get_post_meta( $post_id, 'meta_description', true );
    	$data['testie_sandwich_link_text'] = get_post_meta( $post_id, 'testie_sandwich_link_text', true );
        $data['testie_linkto_text'] = get_post_meta( $post_id, 'testie_linkto_text', true );
    	$data['testie_header'] = get_post_meta( $post_id, 'testie_header', true );
        $data['testie_slogan'] = get_post_meta( $post_id, 'testie_slogan', true );
        $data['testie_text'] = get_post_meta( $post_id, 'testie_text', true );
        $data['testie_name'] = get_post_meta( $post_id, 'testie_name', true );
        $data['testie_key'] = get_post_meta( $post_id, 'testie_key', true );
        $data['testie_rating'] = get_post_meta( $post_id, 'testie_rating', true );
            
    	$data = array_filter( $data ); 
    	if ( $data ) {
    		$wpdb->insert( 'wp_custom_testies', $data );
    	}
    
    	$meta_key_array = [
    		'testie_title',
    		'testie_description',
    		'testie_sandwich_link_text',
            'testie_linkto_text',
            'testie_header',
            'testie_text',
            'testie_name',
            'testie_key',
            'testie_rating',
    	];
    	$meta_key = "'" . implode( "','", $meta_key_array ) . "'";
    	$wpdb->query( $wpdb->prepare( "
    		DELETE FROM wpqq_postmeta
    		WHERE post_id = %d AND meta_key IN ( $meta_key )",
    		$post_id
    	) );
    }
    in reply to: Importing data to custom table does not work #35564
    Robert FeddesRobert Feddes
    Participant

    I have tried the following code, adapted from your website:

    function oxygen_child_data_testimonials() {
    	if ( empty( $_GET['move-data-testimonials'] ) || ! current_user_can( 'manage_options' ) ) {
    		return;
    	}
    
    	$paged = isset( $_GET['oxygen-child-paged'] ) ? $_GET['oxygen-child-paged'] : 0;
    	$paged += 1;
    	$url = add_query_arg( 'oxygen-child-paged', $paged, 'https://www.rugpijnweg.nl/wp-admin/?move-data-testimonials=1' );
    
    	$posts = oxygen_child_admin_records_get_testimonials( $paged );
    	if ( empty( $posts ) ) {
    		die( 'Done' );
    	} 
    
    	foreach ( $posts as $post ) {
    		oxygen_child_move_data_testimonials( $post );
    	}
    
    	echo "
    	<script>
    	setTimeout( () => {
    		window.location.href = '$url';
    	}, 3000 );
    	</script>
    	";
    
    	die;
    }
    add_action( 'admin_init', 'oxygen_child_data_testimonials' );
    
    function oxygen_child_admin_records_get_testimonials( $paged = 1 ) {
    	$args = [
    		'post_type'      => 'reviews',
    		'posts_per_page' => 100,
    		'paged'          => $paged,
    		'fields'         => 'ids',
    		'orderby'        => 'ID',
    	];
    	$query = new WP_Query( $args );
    	return $query->posts;
    }
    function oxygen_child_move_data_testimonials( $post_id ) {
    	global $wpdb;
    
    	echo 'Migrating Reviews ', $post_id, '<br>';
    
    	$data = [];
    
    	$data['ID'] = $post_id;
    
    	$data['testie_title'] = get_post_meta( $post_id, 'testie_title', true );
    	$data['testie_description'] = get_post_meta( $post_id, 'meta_description', true );
    	$data['testie_sandwich_link_text'] = get_post_meta( $post_id, 'testie_sandwich_link_text', true );
        $data['testie_linkto_text'] = get_post_meta( $post_id, 'testie_linkto_text', true );
    	$data['testie_header'] = get_post_meta( $post_id, 'testie_header', true );
        $data['testie_slogan'] = get_post_meta( $post_id, 'testie_slogan', true );
        $data['testie_text'] = get_post_meta( $post_id, 'testie_text', true );
        $data['testie_name'] = get_post_meta( $post_id, 'testie_name', true );
        $data['testie_key'] = get_post_meta( $post_id, 'testie_key', true );
        $data['testie_rating'] = get_post_meta( $post_id, 'testie_rating', true );
            
    	$data = array_filter( $data ); 
    	if ( $data ) {
    		$wpdb->insert( 'wp_custom_testies', $data );
    	}
    
    	$meta_key_array = [
    		'testie_title',
    		'testie_description',
    		'testie_sandwich_link_text',
            'testie_linkto_text',
            'testie_header',
            'testie_text',
            'testie_name',
            'testie_key',
            'testie_rating',
    	];
    	$meta_key = "'" . implode( "','", $meta_key_array ) . "'";
    	$wpdb->query( $wpdb->prepare( "
    		DELETE FROM wpqq_postmeta
    		WHERE post_id = %d AND meta_key IN ( $meta_key )",
    		$post_id
    	) );
    }

    But nothing happens

    in reply to: Import data is possible with custom table extensión? #35561
    Robert FeddesRobert Feddes
    Participant

    I am using wp all import pro but when I import only the title gets imported, non of the custom fields are imported

    How can I do this?

Viewing 7 posts - 1 through 7 (of 7 total)