• Huroman

    (@huroman)


    Hi, everybody, i’ve been trying to get the “custom field” options in a dropdown menu with no success, i work with this tutorial but my php coding knowledge is limited. Could you give a hand?

    This is the original code:

    // Add to our admin_init function
    add_action('quick_edit_custom_box',  'pde_add_quick_edit', 10, 2);
    
    function pde_add_quick_edit($column_name, $post_type) {
    	if ($column_name != 'estatus_column') return;
    	?>
        <fieldset class="inline-edit-col-left">
    	<div class="inline-edit-col">
    		<span class="title">Estatus del lote:</span>
    		<input type="hidden" name="pde_widget_set_noncename" id="pde_widget_set_noncename" value="" />
    		<?php // Get all widget sets
    			$estatus_columns = get_posts( array(
    							'post_type' => 'lotes',
    							'numberposts' => -1,
    							'post_status' => 'publish') );
    		?>
    		<select name='post_widget_set' id='post_widget_set'>
    			<option class='widget-option' value='0'>Elija un estado nuevo</option>
    			<?php
    			foreach ($estatus_columns as $estatus_column) {
    				echo "<option class='widget-option' value='{$estatus_column->ID}'>{$estatus_column->post_title}</option>\n";
    			}
    		        ?>
    		</select>
    	</div>
        </fieldset>
    	<?php
    }

    I need get the “estatus” custom field and show it in quick edit instead the post->ID and post_title (in a option element).

    Thank you in advance, i’ve been searching, trying, smashing my head with no one solution.

    Huroman

  • The topic ‘Add a custom dropdown menu in quick edit’ is closed to new replies.