Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 76 through 90 (of 93 total)
  • Author
    Posts
  • in reply to: Display element based on 'post' #1353
    carassiuscarassius
    Participant

    Dont mind the errors, it is because I removed the square brackets, but left it as

    // start customer
        $meta_boxes = array(

    instead of

    // start customer
        $meta_box = array(
    in reply to: Display element based on 'post' #1352
    carassiuscarassius
    Participant

    Warning: Illegal string offset 'title' in C:\wamp\www\wordpress\wp-content\plugins\project52\plugins\meta-box\inc\meta-box.php on line 343

    Warning: Invalid argument supplied for foreach() in C:\wamp\www\wordpress\wp-content\plugins\project52\plugins\meta-box\inc\meta-box.php on line 386

    Warning: Invalid argument supplied for foreach() in C:\wamp\www\wordpress\wp-content\plugins\project52\plugins\meta-box\inc\meta-box.php on line 150

    in reply to: Display element based on 'post' #1350
    carassiuscarassius
    Participant

    removing square brackets, [] breaks my site completely

    in reply to: Display element based on 'post' #1348
    carassiuscarassius
    Participant

    If it is to hard, or beyond the scope of support to help me out, just let me know, no probs

    Thank You for everything so far, I do appreciate your time.

    Jon

    in reply to: Display element based on 'post' #1347
    carassiuscarassius
    Participant

    Yes, I have loads.

    This is the full code for my quote cpt

    https://pastebin.com/YiLH0HWv

    in reply to: Display element based on 'post' #1345
    carassiuscarassius
    Participant

    I keep getting that foreach error on line 81

    https://pastebin.com/Wr6E0kmA

    in reply to: Display element based on 'post' #1335
    carassiuscarassius
    Participant

    Thanks Tan, I am still trying to break down your code and get it to work, can I ask another question?

    In my contact post type, my prefix for the phone is p52_contact_ to give me the id p52_contact_phone, and given that nothing is working (field not being shown nor any value in it) I am assuming something in here is wrong

    // Save data to phone field
    add_action('rwmb_before_save_post', function($post_id)
    {
    	// Get person ID to save from "Select a Customer" field
    	$person_to_save = intval( $_POST['p52_quote_name'] );
    	// Save related field to phone field
    	$_POST['p52_quote_phone'] = $_POST['p52_quote_phone_' . $person_to_save];
    	// Unset all hidden fields
    	foreach ( $_POST as $key => $value )
    	{
    		if ( strpos( $key, 'p52_quote_phone_' ) )
    			unset( $_POST[$key] );
    	}
    } );
    in reply to: Display element based on 'post' #1328
    carassiuscarassius
    Participant

    Just redownloaded my core plugins and added that version, and the error is now gone, maybe a corrupt download

    in reply to: Display element based on 'post' #1327
    carassiuscarassius
    Participant

    also, if I do a var_dump ($customers) I dont get any of the metabox fields, so I must have something wrong with loading them into the loop when creating my cpt

    in reply to: Display element based on 'post' #1326
    carassiuscarassius
    Participant

    Warning: Invalid argument supplied for foreach() in C:\wamp\www\wordpress\wp-content\plugins\project52\plugins\meta-box-conditional-logic\inc\class-conditional-logic.php on line81

    this is how i am installing it
    if( !class_exists( 'MB_Conditional_Logic' ) ) {
    include( plugin_dir_path( __FILE__ ) . '/plugins/meta-box-conditional-logic/meta-box-conditional-logic.php');
    }

    in reply to: Display element based on 'post' #1324
    carassiuscarassius
    Participant

    I get an error installing conditional logic

    in reply to: Display element based on 'post' #1311
    carassiuscarassius
    Participant

    Warning: Invalid argument supplied for foreach() in C:\wamp\www\wordpress\wp-content\plugins\project52\plugins\meta-box-conditional-logic\inc\class-conditional-logic.php on line81

    in reply to: Display element based on 'post' #1310
    carassiuscarassius
    Participant

    Cant seem to get my head around how I can use the conditional logic.

    I can see how it makes different elements visible but that is now what I am after (unless I am thinking this wrong?)

    I want to look at the post selector

    $name = rwmb_meta( 'p52_quote_name', 'type=text' );

    and then take that and return the associated phone number to that contact
    $phone = rwmb_meta( 'p52_contact_phone', 'type=text' );

    So I could have something sort of like this (which is totally incorrect, I know)

    <?php

    function p52_register_quote_meta_boxes( $meta_boxes ) {

    $prefix = 'p52_quote_';
    $meta_boxes[] = array(
    'id' => $prefix . 'customer',
    'title' => 'Customer Info',
    'pages' => 'p52-quote',
    'context' => 'normal',
    'priority' => 'low',

    'fields' => array(

    array(
    'name' => 'Name',
    'id' => $prefix . 'name',
    'type' => 'post',
    'post_type' => 'p52-contact',
    'placeholder' => 'Select a Customer',
    'columns' => 6
    ),

    array(
    'name' => 'Phone',
    'id' => $prefix . 'phone',
    'post_type' => 'p52-contact',
    'std' => get_post_meta($post->ID, 'p52_quote_phone', true),
    'type' => 'text',
    'columns' => 6
    ),
    return $meta_boxes;
    }

    add_filter( 'rwmb_meta_boxes', 'p52_register_quote_meta_boxes' );

    in reply to: Display element based on 'post' #1309
    carassiuscarassius
    Participant

    Ok, will try and see if I can get it to work and come back if I have any questions ๐Ÿ™‚

    Thanks
    Jon

    in reply to: Random Image Layout #1266
    carassiuscarassius
    Participant

    Got it

    $images = rwmb_meta( 'p52_gallery_image', 'type=image' );
    if ($random == 'true') {
    shuffle($images);
    }
    foreach ( $images as $image ) {

    }

Viewing 15 posts - 76 through 90 (of 93 total)